I have an xml generated by a webservice based on openerp, it contains a prefix pp for many elements. I want to convert that xml file to another xml using xslt by selecting many elements. When i try to execute the transformation, it shows me the error 'the prefix xsl for element is not bound' for the prefix pp. I can't declare pp as it is described in many answers, how I can ignore the use of that prefix?
XPath provides the pp:*
syntax to select all elements/attributes with a particular namespace URI regardless of their local names, but not (directly) to select all elements/attributes with a particular local name regardless of namespace. If you don't know in advance what the namespace URI will be then instead of
pp:foo/pp:bar
you have to use tricks like
*[local-name() = 'foo']/*[local-name() = 'bar']
The fact that the document uses "pp" as the prefix is irrelevant, what matters to XPath and XSLT (and to any other namespace-aware XML processing tools) is the local name of an element and its namespace URI. The prefix is simply a device to allow the parser to attach the correct namespace URI to each node.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With