Perl, LibXML and Schemas

做~自己de王妃 提交于 2019-12-04 19:14:00

From the XML::LibXML docs:

A common mistake about XPath is to assume that node tests consisting of an element name with no prefix match elements in the default namespace. This assumption is wrong - by XPath specification, such node tests can only match elements that are in no (i.e. null) namespace. ...(and later)... ...The recommended way is to use the XML::LibXML::XPathContext module

So, from the perspective of XPath, there is no "default" namespace...for any non-null namespace, you have to specify it in your XPath. The XML::LibXML::XPathContext module lets you create a prefix for any namespace to use in your XPath expression.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!