I have also tried using the XPathNSResolverImpl instead of PrefixResolverDefault.
I still have to specify the prefix in the xpath expression.
Anyone ...help please!
I've been watching this thread from the start and believe that part of the confusion has to do with namespaces in general -- frankly, it's one of the most misunderstood XML concepts.
You really have to think about your source document in more concrete terms. Namespaces are not a simple decoration -- they are a necessary means of establishing element "ownership" and distinguishing between two elements that may have the same name but mean entirely different things.
Just because you have a priori knowledge that there are no conflicts in your source document doesn't mean you get to break the rules. In XPath, you get to ask certain types of questions... one of them being "give me element x". Asking for plain element x is asking for the element x that is not associated with any namespace. If you want an element x that has been associated with a namespace, you have to include the namespace when you ask the question... not because there are conflicts in your document but because the potential for conflicts exists in general.
That said... it would be nice if XPath processors allowed you to ask the question "give me element x in any namespace". I'm new to Xalan, but have worked with other parsers -- none of which support a simple syntax for doing this. AFAIK, the only way to do this is to ask for "/*[local-name()='x']" which is much less efficient.
Namespaces are there to help you... really!!! Don't get tied up in the prefixes -- they are a convenience. If you get in the habit of declaring your own prefixes for namespace URI's that you need to consume in your program, you'll developer more robust XML applications.
Brenda http://opensource.theotherbell.com
