commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joerg Lensing <i...@softcon-lensing.de>
Subject [jxpath] newbie: iterator doesn't return sinlge object
Date Fri, 11 Apr 2003 18:18:58 GMT
hi list,
I'm using xpath-String :
         String xpathString = "/*";

and

>           JXPathContext context = JXPathContext.newContext(recipes);
>           System.out.println("Activated the XMLSource");
>
>           Iterator resultSet = context.iterate(xpathString);
>           //String result = (String) context.getValue(xpathString);
>
>           while (resultSet.hasNext()) {
>               Object aObj = (Object) resultSet.next();
>             String result = (String) aObj;
>             System.out.println("The result is: " + result);
>           }     

The first retrieved object from resultSet.next() contains the complete
values from all nodes. That is not what i expected.
My questions:
1. How can i iterate through the nodes?
2. How can i get the node-name (like the name()-function in xpath)?


joerg


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message