No, it's not dead, as you can see, but yeah sometimes an answer may take
longer to come by...

1. This should work, and in fact I can get the exact code that you are
providing to work on my box. I am using XmlBeans 2.2.0 and this is my
classpath:

$XMLBEANS_HOME/build/lib/xbean.jar:$XMLBEANS_HOME/build/lib/jsr173_1.0_a
pi.jar:xmltypes.jar:.:$XMLBEANS_HOME/external/lib/saxon8.jar:$XMLBEANS_H
OME/external/lib/saxon8-dom.jar:$XMLBEANS_HOME/build/lib/xbean_xpath.jar

2. According to XmlCursor.setTextValue(String) JavaDoc

"For elements that have nested children this first removes all the
content of the element and replaces it with the given text."

So based on that I would say it is not a bug. If you want to insert
text, take a look at

XmlCursor.insertChars(String)

Radu

-----Original Message-----
From: Tony Dean [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, July 19, 2006 2:22 PM
To: Tony Dean; dev@xmlbeans.apache.org; user@xmlbeans.apache.org
Cc: [EMAIL PROTECTED]
Subject: RE: Help with xmlbeans 2.2.0

Is this listserve dead?  Where do you get help with xmlbeans these days?

thanks.

> _____________________________________________ 
> From:         Tony Dean  
> Sent: Friday, July 14, 2006 9:05 PM
> To:   'dev@xmlbeans.apache.org'; 'user@xmlbeans.apache.org'
> Subject:      Help with xmlbeans 2.2.0
> 
> Hi,
> 
> Could someone answer a couple of questions that I can not resolve.
> 
> 1. xpath works for the most part with simple expressions, but when I
introduce a predicate xmlbeans differs to saxon (I have saxonb8.6.1 on
my classpath).  saxon always returns an empty node list for the
following expression:
> 
> Sring ns = "declare namespace ns='http://tempuri.org/myService';";
> String xpath = ns + 
> "$this/ns:copyintoout/ns:[EMAIL PROTECTED]'Tony']";
> XmlObject[] selections = soapBody.selectPath(xpath);
> 
> soapBody points to the start of the soap body (ns:copyintoout) in the
following instance document:
> 
> <soapenv:Envelope
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xmlns:xsd="http://www.w3.org/2001/XMLSchema";
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/";
xmlns:mys="http://tempuri.org/myService";>
>    <soapenv:Body>
>       <mys:copyintoout>
>          <mys:parameters myname="Tony">
>             <mys:parm1/>
>             <mys:parm2/>
>             <mys:parm3/>
>             <mys:parm4/>
>             <mys:parm5/>
>             <mys:parm6/>
>          </mys:parameters>
>          <mys:streams>
>             <mys:instream/>
>          </mys:streams>
>       </mys:copyintoout>
>    </soapenv:Body>
> </soapenv:Envelope>
> 
> selections always comes back empty.
> 
> Should this work?  Am I doing something wrong?  I noticed that you are
using particular saxon classes instead of using JAXP and letting it
decide what saxon xpath factory to use via saxon8-xpath.jar?
> 
> 2. when not using a predicate, I get expected selections and
everything looks good... for instance suppose my xpath expression is the
following:
> 
> Sring ns = "declare namespace ns='http://tempuri.org/myService';";
> String xpath = ns + "$this/ns:copyintoout/ns:parameters";
> XmlObject[] selections = soapBody.selectPath(xpath);
> 
> XmlObject selection = selections[0];
> XmlCursor cursor = selection.newCursor();
> 
> cursor.setTextValue("Added Text");
> 
> I would expect the instance data to now look like the following:
> 
>       <mys:copyintoout>
>          <mys:parameters myname="Tony">Added Text
>             <mys:parm1/>
>             <mys:parm2/>
>             <mys:parm3/>
>             <mys:parm4/>
>             <mys:parm5/>
>             <mys:parm6/>
>          </mys:parameters>
>          <mys:streams>
>             <mys:instream/>
>          </mys:streams>
>       </mys:copyintoout>
> 
> Instead I get the following:
> 
>       <mys:copyintoout>
>          <mys:parameters myname="Tony">Added Text
>       </mys:copyintoout>
> 
> All children of the node that text was added to were deleted.  This
seems like a bug.  Do you agree otherwise, please explain.
> 
> 
> 
> Thank you very much for helping.
> 
> -Tony
> 
> Tony Dean
> SAS Institute Inc.
> 919.531.6704
> [EMAIL PROTECTED]
> 
> SAS... The Power to Know
> http://www.sas.com
> 

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

_______________________________________________________________________
Notice:  This email message, together with any attachments, may contain
information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated
entities,  that may be confidential,  proprietary,  copyrighted  and/or
legally privileged, and is intended solely for the use of the individual
or entity named in this message. If you are not the intended recipient,
and have received this message in error, please immediately return this
by email and then delete it.

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

Reply via email to