Tips on Using Xpath In Orchestration
Here's a couple of minor tips on how to use the xpath command in an orchestration.
First why would you want to do this. You may need to access an XML element or attribute that was not promoted as a property field nor a distinguished field.
1) Go to the schema, click on the element you want, then copy from value of "Instance Xpath" from the property window. It's long and nasty - too difficult for you to build on your own (see a prior blog).
2) Create a variable of type string (in this example, my variable is called vXpath).
3) Using an Expression Shape, use the following syntax (paste the "Instance Xpath") as the value of your variable.
vXpath = "/*[local-name()='spBTSPollOAStatusResp' and namespace-uri()='http://YourSite/spBTSPollOAStatus']/*[local-name()='OA_Status' and namespace-uri()='http://YourSite/spBTSPollOAStatus']/@*[local-name()='StatusID' and namespace-uri()='']";
vStrStatusID = xpath(yourMessage, "string(" + vXpath + ")");
You may ask why I use the vXpath variable. It's just for my own sanity.
The Xpath is so long and nasty (see my prior blog on why). Then the syntax for the xpath command is not straight forward either. I always found myself leaving off a quotation mark or parenthese or something on the end. So I find the above much clearer.


<< Home