You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Naveen <na...@yahoo.com> on 2005/07/20 16:56:02 UTC
[JXPath] different output for 1.1 & 1.2
Hello all,
my question may be little weired. Iam have some
problem when i upgraded to jxpath1.2 from jxpath1.1.
Iam attaching the sample code below.
When i use jxpath1.1 with jdk1.3 and wl6.1 i get the
output.
But when i use jxpath1.2 with jdk1.3 and wl6.1 there
is no output.
Iam attaching the code below.
Appreciate your response
Thanks,
Naveen.
--------------------------------------------------
public static void main(String[] args) throws
ParserConfigurationException, IOException,
SAXException
{
String xmlString = "<OOO
xmlns=\"http://zvon.org/xnumber\"
xmlns:lower=\"http://zvon.org/lowercase\"
ooo=\"222\">\n" +
" <aaa
xmlns:lower=\"http://zvon.org/uppercase\">\n" +
" <lower:BBB
xmlns:lower=\"http://zvon.org/ws\">\n" +
" <lower:x111
a=\"1\"/>\n" +
" <sss
xmlns:lower=\"http://zvon.org/xnumber\">\n" +
" <lower:x111
a=\"2\"/>\n" +
" </sss>\n" +
" </lower:BBB>\n" +
" <lower:x111
a=\"3\"/>\n" +
" </aaa>\n" +
" <aaa
xmlns=\"http://zvon.org/uppercase\">\n" +
" <BBB
xmlns:upper=\"http://zvon.org/uppercase\" U=\"A\"
lower:U=\"A\" upper:U=\"A\"/>\n" +
" </aaa>\n" +
" <aaa
xmlns=\"http://zvon.org/lowercase\">\n" +
" <upper:BBB
xmlns=\"http://zvon.org/xnumber\"
xmlns:upper=\"http://zvon.org/uppercase\">\n" +
" <x111 a=\"5\"/>\n"
+
" </upper:BBB>\n" +
" <Tmp
xmlns=\"http://zvon.org/uppercase\">\n" +
" <x111 a=\"6\"/>\n"
+
" </Tmp>\n" +
" </aaa>\n" +
"</OOO>";
InputStream inputStream = new
ByteArrayInputStream(xmlString.getBytes());
DocumentBuilderFactory dbf =
DocumentBuilderFactory.newInstance();
DocumentBuilder parser =
dbf.newDocumentBuilder();
Document document = parser.parse(new
InputSource(inputStream));
JXPathContext jxPathContext =
JXPathContext.newContext(document.getDocumentElement());
jxPathContext.setLenient(false);
Iterator iterator =
jxPathContext.iteratePointers("//x111");
while(iterator.hasNext())
{
System.out.println(iterator.next());
}
}
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org