Xpath query on adjacent Node

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • amollokhande1
    New Member
    • Feb 2008
    • 33

    Xpath query on adjacent Node

    Hi,

    This is my first question that I have posted on this site.

    I have xml in following format.

    <Pre>
    <UInfo>
    <Uid>100</Uid>
    </UInfo>
    <Data>
    <level>9</level>
    </Data>
    </Pre>

    How do I write the xpath query that will return me true for Uid=100 and level=9.
    I mean, I want to check whether above xml contains (Uid=100 and level=9) or not.

    I tried to use .SelectSingleNo de(//UInfo[Uid='100'] and //Data[level='9'])
    But is won't work here. Can anybody provide me the solution on it?

    Thanks
    Amol
  • jkmyoung
    Recognized Expert Top Contributor
    • Mar 2006
    • 2057

    #2
    .SelectSingleNo de(/*[//UInfo/Uid='100'][//Data[level='9']])

    Comment

    • amollokhande1
      New Member
      • Feb 2008
      • 33

      #3
      Thanks a lot. It works.

      Comment

      Working...