xalan-c-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From afrenger <aaron_fren...@trilliumsoftware.com>
Subject Re: mapping a prefix to a namespace URI
Date Wed, 25 Sep 2013 19:35:00 GMT
Thank you very much for your reply Steven.  

My xml has xmlns="http://someweb.com" (i.e. no prefix which is what I've
always understood to be referred to as having default namespace).

If you run a series of XML through the Xalan SimpleXPathAPI sample then, if
you have no name space (no xmlns at all in the doc), you can use XPath like
"/node1/node2/etc" and if you have a defined namespace, you can use XPath
like /myns:node1/myns:nod2e/myns:etc.  But if you run a document with
"default namespace"  through the SimpleXPathAPI sample, it returns no node
found.

I've also found that when you interrogate a document like this in XMLQuire
it puts out "/dft:node1/dft:node2/dft:etc".

I found a few post where folks had hit this same issue and were told to"

"You'll also need to implement a PrefixResolver derivative and pass an 
instance of that into the XPathEvaluator, so the XPath implementation can 
map the namespace prefix to the proper namespace URI.  You can look at the 
existing PrefixResolver instances to see what's involved."  -Dave Bertoni

http://apache-xml-project.6118.n7.nabble.com/xpath-expression-with-namespace-td22110.html#a22111


That post is rather old an maybe I'm heading in the wrong direction as there
may be better ways to do this now.

Thanks again for any help you can give me.

Aaron



--
View this message in context: http://apache-xml-project.6118.n7.nabble.com/mapping-a-prefix-to-a-namespace-URI-tp40498p40507.html
Sent from the Xalan - C - Users mailing list archive at Nabble.com.

Mime
View raw message