commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Julian <cerebr...@yahoo.com>
Subject [JXPath] Pointers Iterator Returning Wrong Number Results
Date Mon, 19 May 2003 20:39:03 GMT
Hi All,

I am trying to use JXPath for the first time and when
I try to iterate over pointers for a given context, I
only get one of the two child objects expected. I have
tried various xpath expressions to retrieve the
children, but to no avail (e.g. /*,*, and child::*). 
Once I retrieve them I want to delete them, but again
only one is deleted from the Document. I must add that
I am doing this to test the capabilities of JXPath...I
will prob want to conduct more complicated xpaths and
iterations.  Could someone help me with this problem? 


Thanks A Lot,
Julian

<snippet>
            JXPathContext context =
JXPathContext.newContext(genNode);//node with children
in question
            Iterator genValues =
context.iteratePointers("*");//get all node's children

                while(genValues.hasNext()) {
                    
                    NodePointer nodePointer =
(NodePointer)genValues.next();
                   
                      Node testNode =
(Node)nodePointer.getNode();//get Node from pointer
                     
genNode.removeChild(testNode);//remove node in
question 
                }
</snippet>

__________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
http://search.yahoo.com

Mime
View raw message