Home Page › Forums › BizTalk 2004 – BizTalk 2010 › Orchestration expression and using the xpath function › Orchestration expression and using the xpath function
Thanks for you replies thus far. A couple of weeks ago, I learned of the trick of obtaining the query using the Instance Xpath property. It’s a nice feature.
Anyhow, I have spent the last few days trying to get an Xpath expression that will work. I have tried just about every variation that I can think of. In my expression I need to specify both a position (i.e., [1]) and a predicate (i.e., ID=’SAPInterface’) to get to the element I desire. My lastest xpath is as follows (from the expression shape in my orchestration):
strXpath = \”/*[local-name()=’ProductionPerformance’ and namespace-uri()=’http://www.wbf.org/xml/b2mml-v02′%5D/*%5Blocal-name()=’ProductionResponse’ and namespace-uri()=’http://www.wbf.org/xml/b2mml-v02′%5D/*%5Blocal-name()=’SegmentResponse’ and namespace-uri()=’http://www.wbf.org/xml/b2mml-v02′%5D/*%5Blocal-name()=’MaterialConsumedActual’ and namespace-uri()=’http://www.wbf.org/xml/b2mml-v02′%5D%5B1%5D/*%5Blocal-name()=’MaterialConsumedActualProperty’ and namespace-uri()=’http://www.wbf.org/xml/b2mml-v02′ and * = ‘SAPInterface’]/*[local-name()=’Value’ and namespace-uri()=’http://www.wbf.org/xml/b2mml-v02′%5D/*%5Blocal-name()=’ValueString’ and namespace-uri()=’http://www.wbf.org/xml/b2mml-v02′%5D\”;
strSAPInterface = xpath(msgB2MMLProductionPerformance_In,strXpath);
This produced the error \”There is an error in the XML document.\”.
If I change the predicate \”* = ‘SAPInterface’\” to ns0:ID = \”‘SAPInterface’\”, I get an error \”Namespace Manager or XsltContext needed. This query has a prefix, variable, or user-defined function.\”.
Both of these expressions are valid in XML Spy. Again, I thank you for you help in figuring this out…