vb.net - How do I find XML nodes which don't contain an attribute using XPath? -
i'm using xpath in vb.net following xml:
<bookstore> <book> <title lang="eng">harry potter</title> <price>29.99</price> </book> <book> <title lang="eng">learning xml</title> <price>39.95</price> </book> <book> <title>english-french dictionary</title> <price>29.95</price> </book> </bookstore> according this guide, it's easy list of nodes have particular attributes.
//title[@lang]
selects title elements have attribute named lang
but how list of nodes don't have particular attribute? (e.g. third book above, has no lang attribute.)
you can use:
//title[not(@lang)]
Comments
Post a Comment