Thanks for help but it doesn't solve my problem.

I limited my XmlObject to this content and call newCursor():

<ParameterRefEntry parameterRef="MyPara02">
        <LocationInContainerInBits referenceLocation="containerStart">
                <FixedValue>311</FixedValue>
        </LocationInContainerInBits>
</ParameterRefEntry>


How can i move the cursor to the "FixedValue" to change the 311 in xxx? The 
content of the XmlObject is not always the same and the "FixedValue" is not 
always on the same position. How do i find out, how many times i have to move 
the cursor?

Thanks.

Christian



Yana Kadiyska schrieb:

>You can call newCursor() on your XmlObject, and then, using the cursor,
>move it by calls to toFirstChild() and toNextSibling(), etc until you
>get to the desired location.
>
>Your approach has 2 pitfalls: 1. It is not the correct query if you're
>starting from the root of the document (i.e. it doesn't return the node
>you want) 2. execQuery returns a copy, rather than a pointer to the
>original object
>
>You can look at the tutorial on the website for examples on cursor
>navigation:
>http://xmlbeans.apache.org/documentation/tutorial_getstarted.html (in
>particular, see the section on the cursor)
>
>--Yana
>-----Original Message-----
>From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
>Sent: Monday, November 14, 2005 5:06 AM
>To: [email protected]
>Subject: XmlCursor
>
>Hello there,
>
>i have a XmlObject (myXml) with this content:
>
>            <SequenceContainer name="MyContainer" 
>shortDescription="Blablabla">
>                <EntryList>
>                    <ParameterRefEntry parameterRef="MyPara01">
>                        <LocationInContainerInBits 
>referenceLocation="containerStart">
>                            <FixedValue>319</FixedValue>
>                        </LocationInContainerInBits>
>                    </ParameterRefEntry>
>                    <ParameterRefEntry parameterRef="MyPara02">
>                        <LocationInContainerInBits 
>referenceLocation="containerStart">
>                            <FixedValue>311</FixedValue>
>                        </LocationInContainerInBits>
>                    </ParameterRefEntry>
>                </EntryList>
>            </SequenceContainer>
>
>Now, i will change the "Fixed Value" of  "MyPara02". How can i do this?
>
>I've tried something like that but it doesn't work :(
>
>            XmlCursor cursor = 
>myXml.newCursor().execQuery("ParameterRefEntry[parameterRef="MyPara02"]"
>);
>            QName test = new QName("FixedValue");
>            cursor.setAttributeText(test, "123");
>
>Hope for help.
>
>Thanks.
>
>Christian
>
>
>---------------------------------------------------------------------
>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]
>
>


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

Reply via email to