What's the xpath syntax to get tag names? What's the xpath syntax to get tag names? xml xml

What's the xpath syntax to get tag names?


You can use the name() or local-name() XPath function.

See the examples on zvon.


I know it's a bit outdated but you should do: xml.xpath('//meagerie/*[not(penguin)]/name()') as the expression. Note the slash, not the dot. This is how you call methods on the current node in XPath.