XPATH to reference a multiple node in a xml

Home Page Forums BizTalk 2004 – BizTalk 2010 XPATH to reference a multiple node in a xml

Viewing 1 reply thread
  • Author
    Posts
    • #15554

      Hi,

      I have the following XML,

      I need to refrence one POSTALCODE from POSTALCODES using RECCOUNT.

      <Root><NoOfBookingReference>4</NoOfBookingReference><PostalCodes><PostalCode>JE2

      6QP</PostalCode></PostalCodes><PostalCodes><PostalCode>JE27QE</PostalCode></PostalCodes><PostalCodes><PostalCode>WS7

      3XL</PostalCode></PostalCodes><PostalCodes><PostalCode>ALB4BA</PostalCode></PostalCodes><PostalCodes><PostalCode>BH4

      9LG</PostalCode></PostalCodes></Root>

      I am trying to reference every individual postalcodes using the following xpath.

      xpath(PostCodeMsg,"/*[local-name()='Root' and namespace-uri()='']/*[local-name()='PostalCodes' and namespace-uri()=''][recCount]/*[local-name()='PostalCode' and namespace-uri()='']");

      and tried

      tempString = System.String.Format("/Root/PostalCodes[{0}]/PostalCode",recCount);

      PLEASE GUIDE me in the right was to access these in the message assignment.

      Thanking you all in advance.

    • #15564

      Have you tried using the string function on the xpath:

      xpath(PostCodeMsg,"string(/*[local-name()='Root' and namespace-uri()='']/*[local-name()='PostalCodes' and namespace-uri()=''][recCount]/*[local-name()='PostalCode' and namespace-uri()=''])");

Viewing 1 reply thread
  • The forum ‘BizTalk 2004 – BizTalk 2010’ is closed to new topics and replies.