You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by bu...@apache.org on 2002/05/16 18:35:41 UTC
DO NOT REPLY [Bug 9167] New: -
internally declared namespaces not resolved correctly by XPath processor
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=9167>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND
INSERTED IN THE BUG DATABASE.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=9167
internally declared namespaces not resolved correctly by XPath processor
Summary: internally declared namespaces not resolved correctly by
XPath processor
Product: XalanJ2
Version: 2.3
Platform: Other
OS/Version: Other
Status: NEW
Severity: Major
Priority: Other
Component: org.apache.xpath
AssignedTo: xalan-dev@xml.apache.org
ReportedBy: adunstan@hiddenmind.com
output below should explain
[adunsta:samples]$ cat foo.xml
<a:b xmlns:a="q">
<b:c xmlns:b="w">
<b:d>Foobar</b:d>
</b:c>
</a:b>
[adunsta:samples]$ java -
cp ../bin/xalan.jar:../bin/xalansamples.jar:../bin/xercesImpl.jar:. ApplyXPath
foo.xml '/a:b'
Loading classes, parsing foo.xml, and setting up serializer
Querying DOM using /a:b
<output>
<a:b xmlns:a="q">
<b:c xmlns:b="w">
<b:d>Foobar</b:d>
</b:c>
</a:b>
</output>
[adunsta:samples]$ java -
cp ../bin/xalan.jar:../bin/xalansamples.jar:../bin/xercesImpl.jar:. ApplyXPath
foo.xml '//b:c'
Loading classes, parsing foo.xml, and setting up serializer
Querying DOM using //b:c
Exception in thread "main" javax.xml.transform.TransformerException: Prefix
must resolve to a namespace: b
at org.apache.xpath.compiler.XPathParser.error(XPathParser.java:602)
at org.apache.xpath.compiler.Lexer.mapNSTokens(Lexer.java:674)
at org.apache.xpath.compiler.Lexer.tokenize(Lexer.java:397)
at org.apache.xpath.compiler.Lexer.tokenize(Lexer.java:139)
at org.apache.xpath.compiler.XPathParser.initXPath(XPathParser.java:143)
at org.apache.xpath.XPath.<init>(XPath.java:217)
at org.apache.xpath.XPathAPI.eval(XPathAPI.java:279)
at org.apache.xpath.XPathAPI.selectNodeIterator(XPathAPI.java:172)
at org.apache.xpath.XPathAPI.selectNodeIterator(XPathAPI.java:152)
at ApplyXPath.doMain(ApplyXPath.java:128)
at ApplyXPath.main(ApplyXPath.java:183)
[adunsta:samples]$ pwd
/home/adunsta/xalan-j_2_3_1/samples
[adunsta:samples]$