Hi, there are several things going on here:

First, please note that most cursor advancing methods return a Boolean
value -- you are of course free to discard the result, but then you
won't know if the operation actually succeeded.

I would like to try to help with your problem but from the snippet you
provide it is also unclear what the relationship between cursor0 and c
is?
Where is cursor1 positioned when you obtain cursor c from it?

As a last note, method toChild(String name) is case sensitive, so I'm a
little surprised cursor0.toChild("PEN"); works given the xml you
supplied -- does it actually return true?

-----Original Message-----
From: Celinio Fernandes [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, August 16, 2005 2:24 AM
To: [email protected]
Subject: toNextSibling

Hi,
I really regret the lack of detailed examples about the use of XML
cursors.
Does anyone know links to programs that use XML cursors to go up and
down through 
the elements of an XML document, in a very explicit way ?

I have this extract of an XML document:

<father>
        ....
        <something>
                <pen>peeeeeeeeen</pen>
                <pot>pooooooooooot</pot>
                <pile>piiiiiiiiiiiiiiile</pile>
        <something>
        ...
</father>

=================== THIS DOES NOT WORK =================== 

XmlCursor c = cursor1.newCursor();      
c.toChild("something");
cursor0.toChild("PEN");
String thepen =  cursor0.getTextValue();        // works : peeeeeeeeen

cursor0.toNextSibling("pile"); 
String thepile = cursor0.getTextValue();        // doesnt work, it
returns pooooooooooot instead of piiiiiiiiiiiiiiile

=================== THIS WORKS ========================== 

XmlCursor c = cursor1.newCursor();      
c.toChild("something");
cursor0.toChild("pen");
String thepen =  cursor0.getTextValue();        // works : peeeeeeeeen

cursor0.toParent();
cursor0.toChild("pile");
String thepile = cursor0.getTextValue();        // works :
piiiiiiiiiiiiiiile


Can anyone explain me why cursor0.toNextSibling("pile");  doesnt work ?
Thanks !





---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to