Title: RE: Help with xmlbeans 2.2.0
Mikael,
if you are using XMLBeans 2.1, then you should use Saxon 8.1.1; but if you are using XMLBeans 2.2, then you should use Saxon 8.6.1 (or later - although I haven't tried anything later). Some Saxon classes changed packages between 8.1 and 8.6, and so it's not possible to maintain compatibility.
- Wing Yew

From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Monday, July 24, 2006 7:55 AM
To: user@xmlbeans.apache.org
Subject: SV: Help with xmlbeans 2.2.0

Hi,
 
did you try using Saxon 8.1.1 instead?
 
Regards, Mikael
 


Från: Tony Dean [mailto:[EMAIL PROTECTED]
Skickat: må 2006-07-24 14:02
Till: user@xmlbeans.apache.org
Ämne: RE: Help with xmlbeans 2.2.0

yes, I didn't have sasxon-dom.jar at first, but added it and it still fails with classcast exception.

-----Original Message-----
From: Wing Yew Poon [mailto:[EMAIL PROTECTED]]
Sent: Sunday, July 23, 2006 5:52 PM
To: user@xmlbeans.apache.org
Subject: RE: Help with xmlbeans 2.2.0

Tony,
do you have both saxon8.jar and saxon8-dom.jar in your classpath?
- Wing Yew

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

Radu,

Thanks for the response!

On item #2, you are right.  I should have read deeper into my options on inserting element content.

On item #1, I tried using the exact same jars as you by subsetting my list.  I am using jars from xmlbeans 2.2.0 and saxon 8.6.1 as the documentation suggests.  What verson of saxon jars are you using?

In any event I'm getting a classcast exception:

Caused by: java.lang.ClassCastException:
org.apache.xmlbeans.impl.store.Xobj$DocumentFragXobj
        at
org.apache.xmlbeans.impl.store.DomImpl._node_getOwnerDocument(DomImpl.ja
va:1180)
        at
org.apache.xmlbeans.impl.store.Xobj$NodeXobj.getOwnerDocument(Xobj.java:
2568)
        at
net.sf.saxon.dom.DOMObjectModel.unravel(DOMObjectModel.java:137)
        at net.sf.saxon.Controller.unravel(Controller.java:1291)
        at net.sf.saxon.value.Value.convertToBestFit(Value.java:1025)
        at
net.sf.saxon.value.Value.convertJavaObjectToXPath(Value.java:865)
        at net.sf.saxon.trans.Variable.setValue(Variable.java:119)
        at
org.apache.xmlbeans.impl.xpath.saxon.XBeansXPath.selectNodes(XBeansXPath
.java:95)
        at
org.apache.xmlbeans.impl.xpath.saxon.XBeansXPath.selectPath(XBeansXPath.
java:108)
        at
org.apache.xmlbeans.impl.store.Path$SaxonPathImpl$SaxonPathEngine.next(P
ath.java:496)
        at
org.apache.xmlbeans.impl.store.Cursor._toSelection(Cursor.java:931)
        at
org.apache.xmlbeans.impl.store.Cursor._toNextSelection(Cursor.java:920)
        at
org.apache.xmlbeans.impl.store.Cursor._hasNextSelection(Cursor.java:912)
        at
org.apache.xmlbeans.impl.store.Cursor.hasNextSelection(Cursor.java:2652)
        at
org.apache.xmlbeans.impl.values.XmlObjectBase.selectPath(XmlObjectBase.j
ava:433)
        at
org.apache.xmlbeans.impl.values.XmlObjectBase.selectPath(XmlObjectBase.j
ava:415)
        at
com.sas.soa.wsdl.impl.RequestImpl.update(RequestImpl.java:244)
        ... 16 more

Any ideas?

Thank you very much.

-Tony

-----Original Message-----
From: Radu Preotiuc-Pietro [mailto:[EMAIL PROTECTED]]
Sent: Friday, July 21, 2006 11:11 PM
To: dev@xmlbeans.apache.org; user@xmlbeans.apache.org
Subject: RE: Help with xmlbeans 2.2.0

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]


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