Home Page › Forums › BizTalk 2004 – BizTalk 2010 › How to ‘XPATH’ this type of message?
- This topic has 10 replies, 1 voice, and was last updated 6 years, 11 months ago by
community-content.
-
AuthorPosts
-
-
April 27, 2006 at 11:06 PM #13444
Thanks guys, I’ve attempted both paths and I receive the same value:
[code:1:ff13b42d90]xsi:nil=\"true\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"[/code:1:ff13b42d90]
This is the same result whether or not I have a valid error returned.
Any ideas?
-Rich
-
April 28, 2006 at 12:17 AM #13445
Yes, I’ve validated it by saving the message as an XML doc and saving it out right before I run the query.
-
April 27, 2006 at 8:38 PM #13446
Not sure exaclty the rules here:
This xpath will return the value \”HP\” from your example if the <params> node contains a param with a name attribute of ‘mnDocumentOrderInvoice’
[code:1:4f93931824]\"//params/param[@name = ‘mnDocumentOrderInvoice’]/parent::*/param[@name = ‘szErrorCode’]/text()\"[/code:1:4f93931824]-
April 28, 2006 at 11:04 PM #13447
Is the message exactly the same as the one posted earlier.
Are there any namespaces involved.-
May 2, 2006 at 9:29 AM #13448
Rich,
Can you email me your project, so I can take a look-
April 27, 2006 at 5:10 PM #13449
I have a new application that sends me a response message based on an INSERT operation call, and I’m looking to extract one point of data from this XML.
SO, from an expression, how can I do the following:
[code:1:9c3ee063a4]errCode = xpath(msgResp, ???)[/code:1:9c3ee063a4]from this XML message where I need to get the \”HP\” value returned when the \”name\” attrib = mnDocumentOrderInvoice\”?
[code:1:9c3ee063a4]
<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<appResponse>
<callINSERT>
<params>
<param name=\"szCompanyKeyOrderNo\">12345</param>
<param name=\"mnDocumentOrderInvoice\">9999999</param>
<param name=\"szErrorCode\">HP</param>
</params>
</callINSERT>
</appResponse>[/code:1:9c3ee063a4]TIA
-Rich-
May 1, 2006 at 2:35 PM #13450
Hey Greg,
Yes, the output is the exact same and there are no namespaces. I can compile and send you the schemas and example output if you’d like.
Thanks again!
-Rich-
May 1, 2006 at 2:52 PM #13451
Here’s something I found…this was in the Event Viewer, and HAT blew up on me as well:
[code:1:bc03e84586]<param xmlns=”> was not expected.[/code:1:bc03e84586]
Again, from the actual output, there are no namespaces.
-Rich
-
May 2, 2006 at 1:58 PM #13452
Thanks Greg,
I ended up writing a helper class using the XmlDocument object with SelectSingleNode…unfortunately, I had to get this working in a much narrow time frame than I had originally thought.
If you’re still curious, as I am, I can loop back and put something together within the next few days.
Again, I truly appreciate the assistance.
-Rich-
April 27, 2006 at 8:30 PM #13453
Rich,
The following should work:
strResp = xpath(msg, \”/appResponse/callINSERT/params/param[@name=’szErrorCode’]\”);
-
April 27, 2006 at 11:14 PM #13454
You shouldn’t be getting that. Are you *sure* that’s the instance document you’re running the query on? If you are getting all that other stuff, then the message certainly contains other stuff.
-
-
-
-
-
-
-
-
-
-
-
AuthorPosts
- The forum ‘BizTalk 2004 – BizTalk 2010’ is closed to new topics and replies.