Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > Biztalk
|
Biztalk General discussion about Biztalk server.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Biztalk section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 22nd, 2008, 02:08 AM
Registered User
 
Join Date: May 2008
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Problem with xpath function

I have to retreive an xml element using an xpath query it is working fine if i give the query in this manner
Message_3=xpath(Message_2,"string(/*[local-name()='DataItems' and namespace-uri()='']/*[local-name()='DataItem' and namespace-uri()='']/*[local-name()='ItemName' and namespace-uri()=''][12])");
but giving a null value if given the query in this way
Variable_1=System.String.Format("/*[local-name()='DataItems' and namespace-uri()='http://BizTalk_Server_Project14.Schema3']/*[local-name()='DataItem' and namespace-uri()='']/*[local-name()='ItemName' and namespace-uri()=''][{0}]",8);
Message_3=xpath(Message_2,"string(Variable_1)");
Please suggest some solution for this.


 
Old May 22nd, 2008, 02:32 AM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

I don't follow this, the first example is retrieving an element based on one xpath the second creates a completely different xpath but tyen discards it and uses the xpath of "Variable_1" as a string. I think you need:
Code:
Message_3=xpath(Message_2,"string(" + Variable_1 + ")");
--

Joe (Microsoft MVP - XML)





Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem in Using xpath() function in Biztalk mamatharocks Biztalk 2 September 9th, 2013 02:57 AM
TRANSLATE FUNCTION INSIDE XPATH pallone XSLT 8 February 8th, 2008 05:30 PM
Formating xpath function result number ronisc XSLT 4 December 20th, 2006 09:04 AM
Sum function and XPath problems tslag XSLT 2 June 26th, 2006 10:23 AM
Xpath: sum function gracehanh XSLT 13 September 27th, 2005 09:30 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.