How to check if an element exists in the xml using xpath?

后端 未结 6 1185
野性不改
野性不改 2020-12-08 18:47

Below is my element hierarchy. How to check (using xpath) that AttachedXml element is present under CreditReport of Primary

6条回答
  •  遥遥无期
    2020-12-08 18:59

    Use:

    boolean(/*/*[@subjectIdentifier="Primary"]/*/*/*/*
                               [name()='AttachedXml' 
                              and 
                                namespace-uri()='http://xml.mycompany.com/XMLSchema'
                               ]
           )
    

提交回复
热议问题