How to select following sibling/xml tag using xpath

How to select following sibling/xml tag using xpath

Asked on January 4, 2019 in XML.
Add Comment


  • 2 Answer(s)

         To select the siblings xml tag using xpath use the given code below,

    tr/td[@class='name']/following-sibling::td
    

    Also use:

    tr[td[@class='name'] ='Brand']/td[@class='desc']
    

    This may estimetes that:

    • The context node, against which the XPath expression is evaluated is the parent of all tr elements.
    • Each tr element has only one td with class attribute valued ‘name’ and only one td with class attribute valued ‘desc’.
    Answered on January 4, 2019.
    Add Comment

         This could be an alternative for selecting the folowing siblings xml tag using xpath by the following-sibling axis (following-sibling::td).

    Answered on January 4, 2019.
    Add Comment


  • Your Answer

    By posting your answer, you agree to the privacy policy and terms of service.