Page 1 of 1

How to specify a namespace resolver.

Posted: Mon Feb 22, 2010 5:19 pm
by mveerasamy
How do I specify a namespace resolver for xpath evaluation? For e.g. we want to use the attribute from an external namespace xlink ( xmlns:xlink=http://www.w3.org/1999/xlink).

Basically, I would like to call setNamespaceResolver(NamespaceResolver namespaceContext) on XPathEvaluator to register the namespace

Re: How to specify a namespace resolver.

Posted: Mon Feb 22, 2010 6:58 pm
by Radu
Hi,

You can either run the XPath like:

Code: Select all


//*/@*:href[namespace-uri()='http://www.w3.org/1999/xlink']
or in the Oxygen Preferences XML / XSLT-FO-XQuery / XPath add a new mapping to the default namespace mappings table for xlink and then run it like:

Code: Select all


//*/@xlink:href
Regards,
Radu