xpath expression

Home Page Forums BizTalk 2004 – BizTalk 2010 xpath expression

Viewing 1 reply thread
  • Author
    Posts
    • #17401

      Hi,

      I am trying to retrieve all the books nodes with an an interact value of 104.from the following xml.

      Am doing this within the expression shape. But getting exceptions like "Expression must evaluate to node set etc"

      Please help.

      <Parent1>
        <childBooks>
          <childBook>
           <interact>104</interact>
           <books>
             <book>
               <author>SomeBook</author>
             </book>
             <book>
               <author>SomeOtherBook</author>
            </book>
           </books>
          </childBook>
        <childBook>
           <interact>105</interact>
           <books>
             <book>
               <author>SomeBook</author>
             </book>
             <book>
               <author>SomeOtherBook</author>
            </book>
           </books>
          </childBook>
        </childBooks>
      </Parent1>

    • #17403

      please kindly post the expression you are using.

      -wa 

      • #17405

        i was trying this

         

        /*[local-name()='Parent1']/*[local-name()='childBooks']/*[local-name()='childBook']/*[local-name()='interact'='104']/*[local-name()='books']

        • #17422

          Here is the error in your construct, onlybiz,

           *[local-name()='interact'='104']

          I think this may have been what you intended:

          /*[local-name()='Parent1']/*[local-name()='childBooks']/*[local-name()='childBook']/*[local-name()='books'][../interact = '104']/*
           

           – wa
           

          • #17423

            Also, I should have mentioned this one:  

            //*[local-name()='books'][../interact = '104']/*

            This finds all books nodes across the document that have an interact value of 104

            -wa
             

            • #17444

              Thanks for your replies. the expression got crazy trying to put in the namespaces and local-name's stuff. but whew it worked.

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