Sample XML:
<root>
<element1 a="hello" b="world"/>
<element2 c="world" d="hello"/>
<element3 e="world" f="world"/>
</root>
Suppose, we need to select elements which have any attribute containing h
. In this sample: element1
, element2
. We can use this XPath:
//*[@*[starts-with(., 'h')]]
In your sample:
/xs:schema/node()/descendant::node()
[@*[starts-with(@my-specific-attribute-name-here, 'my-search-string')]]
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…