commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dmitri Plotnikov <dplot...@yahoo.com>
Subject Re: [jxpath] newbie: iterator doesn't return sinlge object
Date Sat, 12 Apr 2003 11:34:50 GMT
Jeorg,

1. Use iteratePointers instead of iterate.
2. The name() function works fine with JXPath.

- Dmitri

--- Joerg Lensing <info@softcon-lensing.de> wrote:
> 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
> 


__________________________________________________
Do you Yahoo!?
Yahoo! Tax Center - File online, calculators, forms, and more
http://tax.yahoo.com

---------------------------------------------------------------------
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