How do I select multiple sets of attributes within an XML document using XPath?

后端 未结 2 1932
野性不改
野性不改 2020-12-06 12:57

I am having trouble constructing a single XPath statement to return two different sets of attributes.

For example take the following XML document:

         


        
相关标签:
2条回答
  • 2020-12-06 13:19
    //@*[name()='alpha' or name()='beta']
    
    0 讨论(0)
  • 2020-12-06 13:28

    By using the | operator in an XPath expression you can select several paths:

    //@alpha | //@beta
    
    0 讨论(0)
提交回复
热议问题