Hi there folks,
I'm using the version of Xalan that comes with J2SE 1.4.2 and I'm having difficulty with namespaces.
I have a system that allows users to set SOAP message routing policies and I'm trying to add the ability to accept or reject requests based on an XPath pattern match.
I've tried two ways to make the CachedXPathAPI object aware of my namespaces, but neither of these works:
1) Building a fake CoreDocumentImpl and setting some fake attributes with the correct namespaces, and using this as a namespaceNode;
2) Implementing a simple PrefixResolver and calling CachedXPathAPI.getXPathContext().setNamespaceContext() with it.
The problem is that I always get something like this, and in the PrefixResolver case, my PrefixResolver is never called.
WARNING: Caught TransformerException during XPath query
javax.xml.transform.TransformerException: Prefix must resolve to a namespace: soapenv
at org.apache.xpath.compiler.XPathParser.error(XPathParser.java:649)
at org.apache.xpath.compiler.Lexer.mapNSTokens(Lexer.java:676)
at org.apache.xpath.compiler.Lexer.tokenize(Lexer.java:303)
at org.apache.xpath.compiler.Lexer.tokenize(Lexer.java:134)
at org.apache.xpath.compiler.XPathParser.initXPath(XPathParser.java:155)
at org.apache.xpath.XPath.<init>(XPath.java:202)
at org.apache.xpath.CachedXPathAPI.eval(CachedXPathAPI.java:322)
at org.apache.xpath.CachedXPathAPI.selectNodeIterator(CachedXPathAPI.java:216)
at org.apache.xpath.CachedXPathAPI.selectNodeIterator(CachedXPathAPI.java:196)
Any hints?
Thanks!
-0xe1a