Hi!
Actually my XPath works, I just tested it.
Important: The OP stated that the element IssuerIdentificationNumber only occurs once, and the key here is the double
// path in the middle of the XPath. It's an "any" path, so that the XPath finds all
Tender/CreditDebit/IssuerIdentificationNumber node(s) in any sub-tree situated below
/RetailTransaction.
Given this schema:
and this input XML:
<ns0:Root xmlns:ns0="http://interchangeid_xmldocument.Schema1">
<action>action_0</action>
<RetailTransaction>
<LineItem>
<Tender>
<Amount>Amount_0</Amount>
<CreditDebit>
</CreditDebit>
</Tender>
</LineItem>
<LineItem>
<Tender>
<Amount>Amount_1</Amount>
<CreditDebit>
</CreditDebit>
</Tender>
</LineItem>
<LineItem>
<Tender>
<Amount>Amount_2</Amount>
<CreditDebit>
<IssuerIdentificationNumber>IssuerIdentificationNumber_2</IssuerIdentificationNumber>
</CreditDebit>
</Tender>
</LineItem>
<LineItem>
<Tender>
<Amount>Amount_3</Amount>
<CreditDebit>
</CreditDebit>
</Tender>
</LineItem>
</RetailTransaction>
</ns0:Root>
and the following code in an Expression shape:
varIssuerIdentificationNumber = xpath(msgReceived, "string(/*[local-name()='Root' and namespace-uri()='http://interchangeid_xmldocument.Schema1']/*[local-name()='RetailTransaction' and namespace-uri()='']//*[local-name()='Tender' and namespace-uri()='']/*[local-name()='CreditDebit' and namespace-uri()='']/*[local-name()='IssuerIdentificationNumber' and namespace-uri()=''])");
System.Diagnostics.EventLog.WriteEntry("BizTalk Server", varIssuerIdentificationNumber);
the event log contains the text
IssuerIdentificationNumber_2
Peter Lindgren