Answer the question
In order to leave comments, you need to log in
XPath: what does "namespace" axis mean?
Good afternoon!
Can you please explain what the "namespace" axis means?
The official documentation defines it as: Selects all nodes in the namespace of the current node .
Please explain what this means and give an example.
Thank you!
Answer the question
In order to leave comments, you need to log in
Namespaces are needed to resolve tag name conflicts in xml.
For example, organizations and their clients
<?xml version="1.0" encoding="UTF-8" ?>
<root xmlns:company="http://example.com/company" xmlns:customer="http://example.com/customer">
<company:company>
<company:name>ACME</company:name>
<customer:name>Vasya</customer:name>
<customer:name>Tom</customer:name>
</company:company>
<company:company>
<company:name>Scrooge McDuck Inc</company:name>
<customer:name>Mary</customer:name>
<customer:name>Bob</customer:name>
<customer:name>Rob</customer:name>
</company:company>
</root>
//company:company[customer:name = 'Vasya']/company:name
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question