Can XPath (1.0) be used to return the namespace nodes in an XML document?
Note: I am not asking for nodes which have a given namespace, but the namespace nodes themselves. So NOT:
//node()[namespace-uri()='http://a.b']
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If the namespace axis is implemented (Firefox/Mozilla refuses to do that) then
//namespace::node()gives you all namespace nodes. But note that namespace nodes in the XSLT/XPath data model are different from namespace declaration attributes in the XML document, with the markupall three elements each have two in scope namespace nodes, the default one declared on the root element and the built-in one for the
xmlnamespace.