From userzcarey@example.org Sun Apr 02 22:46:08 2006 Return-Path: <userzcarey@example.org> Delivered-To: zcarey@example.org Received: (qmail 65106 invoked from network); 2 Apr 2006 22:46:08 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 2 Apr 2006 22:46:08 -0000 Received: (qmail 95656 invoked by uid 500); 2 Apr 2006 22:46:07 -0000 Delivered-To: zcarey@example.org Received: (qmail 95638 invoked by uid 500); 2 Apr 2006 22:46:07 -0000 Mailing-List: contact zcarey@example.org; run by ezmlm Precedence: bulk List-Post: <mailto:zcarey@example.org> List-Help: <mailto:zcarey@example.org> List-Unsubscribe: <mailto:zcarey@example.org> Reply-To: zcarey@example.org List-Id: <user.xmlbeans.apache.org> Delivered-To: mailing list zcarey@example.org Received: (qmail 95627 invoked by uid 99); 2 Apr 2006 22:46:06 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 02 Apr 2006 15:46:06 -0700 X-ASF-Spam-Status: No, hits=1.8 required=10.0 tests=DNS_FROM_RFC_ABUSE,RCVD_IN_BL_SPAMCOP_NET X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy includes SPF zcarey@example.org) Received: from [83.161.120.155] (HELO web27305.mail.ukl.yahoo.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with SMTP; Sun, 02 Apr 2006 15:46:05 -0700 Received: (qmail 24114 invoked by uid 60001); 2 Apr 2006 22:45:43 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.it; h=Message-ID:Received:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type; b=2QIcdXlETmQGqN2mW9lpZqfORfnNLSzr8uUozsfN7CjAjdNOyaIM6PygQyN3neZKJvvkA64Lg3HCHLO5CuVXQ4x1N7yip+LYrV0Q/9K2IZxKYwOpjgK9EwaePjdPaWc2z6rdLxthBLw4vr/RWXGron3JW4/PClPI6L08ZQsl0UU= ; Message-ID: <zcarey@example.org> Received: from [83.161.120.155] by web27305.mail.ukl.yahoo.com via HTTP; Mon, 03 Apr 2006 00:45:43 CEST Date: Mon, 3 Apr 2006 00:45:43 +0200 (CEST) From: Stefano Peruzzi <zcarey@example.org> Subject: RE: validation error, but validate line command says it's ok To: zcarey@example.org In-Reply-To: <zcarey@example.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Thanks for the kind answer Radu, You're right, I didn't explain the problem very well (my poor English knowledge doesn't help). I have an XSD file. I compiled it with scomp command. I used the resulting classes to parse XML data generated by a remote procedure (a poor implementation of a web service, but I have no control over it). I'm writing some code to manage this XML data. Now, I am interested in testing my code. I want to write a STUB of the remote proc. I used .toString() to log the XML data, saved it on a file, and used a testing class to: - load XML from file system - feed my code with XML, simulting the remote procedure response. For the moment, I had to give up! I cannot read XML files, they are valid but something goes wrong during parsing! Does anyone have the same problem? I'll investigate further, and I'll check if I have more then one XSD file in the classpath. Thanks, Stefano --- Radu Preotiuc-Pietro <zcarey@example.org> ha scritto: > Hard to say where you are wrong, since you give very > little detail of > what you are doing ;-) > In fact, what the "validate" implementation does is > parse the document > provided in an XmlObject, then call .validate() on > it (in addition to > parsing the Schema files of course). > > So what I can suggest is make sure that you don't > have some older/newer > compiled Schemas on your classpath when you execute > your java class, > since XmlBeans does dynamic lookup of Schema > information when validating > documents. > > Radu > > -----Original Message----- > From: Stefano Peruzzi [mailto:zcarey@example.org] > Sent: Wednesday, March 29, 2006 1:40 AM > To: zcarey@example.org > Subject: validation error, but validate line command > says it's ok > > Hi all, > something strange is happening. When I parse my xml > file from my java > class, I obtain this error: > >> D:\[...]\documenti\sbnmarc_response.xml:0: error: > cvc-complex-type.4: Expected attribute: > schemaVersion > > Of course, the file does have the schemaVersion > attribute! > I also tried the 'validate' line command (specifying > the xsd file) and > it says: > sbnmarc_response.xml valid. > > Where am I wrong? > Maybe I should specify the xsd file to parse() o > validate() method in my class? (I don't know how) > But the parse method > is on a generated factory class, using 'scomp' > command on the same xsd. > I think XMLBeans should do the magic for me. > > Thanks for your help, > Stefano > > > > > > > ___________________________________ > Yahoo! Mail: gratis 1GB per i messaggi e allegati da > 10MB > http://mail.yahoo.it > > --------------------------------------------------------------------- > To unsubscribe, e-mail: > zcarey@example.org > For additional commands, e-mail: > zcarey@example.org > > _______________________________________________________________________ > 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: > zcarey@example.org > For additional commands, e-mail: > zcarey@example.org > > ___________________________________ Yahoo! Mail: gratis 1GB per i messaggi e allegati da 10MB http://mail.yahoo.it ___________________________________ Yahoo! Mail: gratis 1GB per i messaggi e allegati da 10MB http://mail.yahoo.it --------------------------------------------------------------------- To unsubscribe, e-mail: zcarey@example.org For additional commands, e-mail: zcarey@example.org From userzcarey@example.org Mon Apr 03 21:31:03 2006 Return-Path: <userzcarey@example.org> Delivered-To: zcarey@example.org Received: (qmail 63170 invoked from network); 3 Apr 2006 21:31:03 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 3 Apr 2006 21:31:03 -0000 Received: (qmail 45465 invoked by uid 500); 3 Apr 2006 21:31:02 -0000 Delivered-To: zcarey@example.org Received: (qmail 45418 invoked by uid 500); 3 Apr 2006 21:31:01 -0000 Mailing-List: contact zcarey@example.org; run by ezmlm Precedence: bulk List-Post: <mailto:zcarey@example.org> List-Help: <mailto:zcarey@example.org> List-Unsubscribe: <mailto:zcarey@example.org> Reply-To: zcarey@example.org List-Id: <user.xmlbeans.apache.org> Delivered-To: mailing list zcarey@example.org Received: (qmail 45407 invoked by uid 99); 3 Apr 2006 21:31:01 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Apr 2006 14:31:01 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=HTML_MESSAGE X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [83.161.120.155] (HELO mx2.leapwireless.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Apr 2006 14:31:00 -0700 Received: from 83.161.120.155 [83.161.120.155] by mx2.leapwireless.com with XWall v3.36 ; Mon, 3 Apr 2006 14:37:51 -0700 X-MimeOLE: Produced By Microsoft Exchange V6.5.7226.0 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C65765.DA21CD48" Subject: XML Beans Factory vs Constructor Date: Mon, 3 Apr 2006 14:30:38 -0700 Message-ID: <zcarey@example.org> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: XML Beans Factory vs Constructor Thread-Index: AcZXZdm78sbpymbNSeKeBNB5RnAgUQ== From: "Mike Cassisa" <zcarey@example.org> To: <zcarey@example.org> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N ------_=_NextPart_001_01C65765.DA21CD48 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hello, =20 we are attempting to migrate a web service from JBoss.Net a-la Jboss 3.2.7 to JBossWS4EE which is using jax-rpc and an underlying axis. We have the ser/deserialization working correctly but have run into problems with enumerations. The problem that we also had to deal with mainly for the initial use of JBoss.Net and that was how to create new objects. =20 So here is the question: Is there any way for XML beans to support constructors over factories? Seems like a simple wrapping constructor should do the trick? Currently our wscompile operation fails due to enumerations in one of our simpleTypes. Java beans are required to have a no argument constructor at a minimum so it seems reasonable to put one on the generated xml beans so that they can work with things that are expecting basic java beans. =20 Also is there any plan for supporting JAXB 2.0 conventions? Since the web services standards are headed that way it would be nice if we could continue to use xml beans. If not there may not be any good way to integrate xml beans with future web services which would be a big dissapointment. =20 Thanks, Mike Cassisa Engineering Manager Cricket Communications 10307 Pacific Center Court San Diego, CA 92121 218.435.3799 Office =20 "There are two ways of constructing a software design... one way is to make it so simple there are obviously no deficiencies, the other way is to make it so complicated that there are no obvious deficiencies. =20 The first method is far more difficult." -Unknown =20 ------_=_NextPart_001_01C65765.DA21CD48 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META http-equiv=3DContent-Type content=3D"text/html; = charset=3Dus-ascii"> <META content=3D"MSHTML 6.00.2800.1528" name=3DGENERATOR></HEAD> <BODY> <DIV><SPAN class=3D997500321-03042006><FONT face=3DArial=20 size=3D2>Hello,&nbsp;&nbsp;&nbsp; </FONT></SPAN></DIV> <DIV><SPAN class=3D997500321-03042006>&nbsp;&nbsp;&nbsp; <FONT = face=3DArial=20 size=3D2>we are attempting to migrate a web service from JBoss.Net a-la = Jboss=20 3.2.7 to JBossWS4EE which is using jax-rpc and an underlying axis.&nbsp; = We have=20 the ser/deserialization working correctly but have run into problems = with=20 enumerations.&nbsp; The problem that we also had to deal with mainly for = the=20 initial use of JBoss.Net and that was how to create new=20 objects.</FONT></SPAN></DIV> <DIV><SPAN class=3D997500321-03042006><FONT face=3DArial=20 size=3D2></FONT></SPAN>&nbsp;</DIV> <DIV><SPAN class=3D997500321-03042006><FONT face=3DArial size=3D2>So = here is the=20 question:</FONT></SPAN></DIV> <DIV><SPAN class=3D997500321-03042006><FONT face=3DArial size=3D2>Is = there any way for=20 XML beans to support constructors over factories?&nbsp; Seems like a = simple=20 wrapping constructor should do the trick?&nbsp; Currently our wscompile=20 operation fails due to enumerations in one of our simpleTypes.&nbsp; = Java beans=20 are required to have a no argument constructor at a minimum so it seems=20 reasonable to put one on the generated xml beans so that they can work = with=20 things that are expecting basic java beans.</FONT></SPAN></DIV> <DIV><SPAN class=3D997500321-03042006><FONT face=3DArial=20 size=3D2></FONT></SPAN>&nbsp;</DIV> <DIV><SPAN class=3D997500321-03042006><FONT face=3DArial size=3D2>Also = is there any=20 plan for supporting JAXB 2.0 conventions?&nbsp; Since the web services = standards=20 are headed that way it would be nice if we could continue to use xml=20 beans.&nbsp; If not there may not be any good way to integrate xml beans = with=20 future web services which would be a big = dissapointment.</FONT></SPAN></DIV> <DIV><SPAN class=3D997500321-03042006><FONT face=3DArial=20 size=3D2></FONT></SPAN>&nbsp;</DIV> <DIV><SPAN class=3D997500321-03042006><FONT face=3DArial=20 size=3D2>Thanks,</FONT></SPAN></DIV> <DIV align=3Dleft> <DIV align=3Dleft><FONT face=3DArial size=3D2>Mike Cassisa</FONT></DIV> <DIV align=3Dleft><FONT face=3DArial size=3D2>Engineering = Manager</FONT></DIV> <DIV align=3Dleft><FONT face=3DArial size=3D2> <DIV>Cricket Communications</DIV> <DIV>10307 Pacific Center Court</DIV> <DIV>San Diego, CA 92121</DIV> <DIV>218.435.3799 Office</DIV> <DIV>&nbsp;</DIV> <DIV><FONT size=3D2> <P>"There are two ways of constructing a software design...&nbsp;one way = is to=20 make it so simple there are obviously no deficiencies, the other way is = to make=20 it so complicated that there are no obvious deficiencies.&nbsp; <BR>The = first=20 method is far more = difficult."<BR>-Unknown</P></FONT></DIV></FONT></DIV></DIV> <DIV>&nbsp;</DIV></BODY></HTML> ------_=_NextPart_001_01C65765.DA21CD48-- From userzcarey@example.org Mon Apr 03 22:13:30 2006 Return-Path: <userzcarey@example.org> Delivered-To: zcarey@example.org Received: (qmail 80835 invoked from network); 3 Apr 2006 22:13:30 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 3 Apr 2006 22:13:30 -0000 Received: (qmail 13921 invoked by uid 500); 3 Apr 2006 22:13:28 -0000 Delivered-To: zcarey@example.org Received: (qmail 13903 invoked by uid 500); 3 Apr 2006 22:13:28 -0000 Mailing-List: contact zcarey@example.org; run by ezmlm Precedence: bulk List-Post: <mailto:zcarey@example.org> List-Help: <mailto:zcarey@example.org> List-Unsubscribe: <mailto:zcarey@example.org> Reply-To: zcarey@example.org List-Id: <user.xmlbeans.apache.org> Delivered-To: mailing list zcarey@example.org Received: (qmail 13892 invoked by uid 99); 3 Apr 2006 22:13:28 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Apr 2006 15:13:28 -0700 X-ASF-Spam-Status: No, hits=0.1 required=10.0 tests=HTML_MESSAGE,HTML_TAG_EXIST_TBODY,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of zcarey@example.org designates 83.161.120.155 as permitted sender) Received: from [83.161.120.155] (HELO ussjmh01.bea.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Apr 2006 15:13:26 -0700 Received: from ussjfe01.amer.bea.com (ussjfe01b.bea.com [83.161.120.155]) by ussjmh01.bea.com (Switch-3.0.5/Switch-3.0.0) with ESMTP id k33MCvvr011311 for <zcarey@example.org>; Mon, 3 Apr 2006 15:13:04 -0700 Received: from repbex02.amer.bea.com ([83.161.120.155]) by ussjfe01.amer.bea.com with Microsoft SMTPSVC(5.0.2195.6713); Mon, 3 Apr 2006 15:11:33 -0700 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C6576B.90FC7B20" Subject: RE: how to find full path to the element on which velidation failed. Date: Mon, 3 Apr 2006 15:11:33 -0700 Message-ID: <zcarey@example.org> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: how to find full path to the element on which velidation failed. Thread-Index: AcZTgMlouAHcg5CRQD6AVGsZGyzJnQArg40QAM7Vz7A= From: "Radu Preotiuc-Pietro" <zcarey@example.org> To: <zcarey@example.org> X-OriginalArrivalTime: 03 Apr 2006 22:11:33.0791 (UTC) FILETIME=[91534AF0:01C6576B] X-PMX-Version: 83.161.120.155621, Antispam-Engine: 83.161.120.155, Antispam-Data: 283.161.120.155110 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N ------_=_NextPart_001_01C6576B.90FC7B20 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable You can not only get the element, but then you can also get its location, with filename, line and column number (see the org.apache.xmlbeans.XmlError class for an example of how to do this) =20 And if you do elem.newCursor(), then you can use .toParent() to build the path in a couple lines of code or navigate from it any other way you wish. =20 Radu ________________________________ From: Jinyuan Zhou [mailto:zcarey@example.org]=20 Sent: Thursday, March 30, 2006 11:28 AM To: zcarey@example.org Subject: how to find full path to the element on which velidation failed.=20 With Collected xmlerror objects, I can only get the element name. some time it It would be nice if there is a way to get the full path to the troubled element.=20 Thanks, =20 ________________________________ From: Rob Eger [mailto:zcarey@example.org]=20 Sent: Wednesday, March 29, 2006 2:33 PM To: zcarey@example.org Subject: RE: elementFormDefault=3D'qualified" and xmlText I sort of have the opposite problem: I don't want xmlText() to give me any prefixes or namespace declarations (I just want the raw xml for the element). Anyone know how to accomplish this? I've tried a few things with XmlOptions, but no luck so far. Thanks, Rob. On Wed, 2006-03-29 at 09:35 -0800, Jinyuan Zhou wrote:=20 I dont' have this problem. but I passed an XmlOptions with a call to opts.setSaveSuggestedPrefixes(map) to specify my choices of prefix names.=20 I wonder if this will give you back the prefixes.=20 =09 =09 ________________________________ From: Martin Wegner [mailto:zcarey@example.org]=20 Sent: Wednesday, March 29, 2006 9:25 AM To: zcarey@example.org Subject: elementFormDefault=3D'qualified" and xmlText =09 =09 =09 Greetings. =09 I have elementFormDefault=3D"qualfied" in my schema. I am using XMLBeans 2.0. When I use the xmlText() method to serialize my XMLBeans object, the elements are not prefixed. XMLBeans correctly spits out the default namespace declaration, so it semanticaly valid XML. But I really need the elements to be prefixed directly (downstream clients are brain dead, what can you do?). =09 What am I missing? Thanks in advance. =09 =09 --Marty =09 =09 Rob Eger Senior Software Engineer Local Matters, Inc. =20 1221 Auraria Parkway Denver, CO 80204 zcarey@example.org www.localmatters.com <BLOCK888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4http://www.localmatters.com/>=20 O 218.435.3799 F 218.435.3799=20 =09 _______________________________________________________________________ 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. ------_=_NextPart_001_01C6576B.90FC7B20 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META http-equiv=3DContent-Type content=3D"text/html; charset=3Dus-ascii"> <META content=3D"MSHTML 6.00.2800.1528" name=3DGENERATOR></HEAD> <BODY> <DIV dir=3Dltr align=3Dleft><SPAN class=3D092390122-03042006><FONT face=3DA= rial=20 color=3D#0000ff size=3D2>You can not only get the element, but then you can= also get=20 its location, with filename, line and column number (see the=20 org.apache.xmlbeans.XmlError class for an example of how to do=20 this)</FONT></SPAN></DIV> <DIV dir=3Dltr align=3Dleft><SPAN class=3D092390122-03042006><FONT face=3DA= rial=20 color=3D#0000ff size=3D2></FONT></SPAN>&nbsp;</DIV> <DIV dir=3Dltr align=3Dleft><SPAN class=3D092390122-03042006><FONT face=3DA= rial=20 color=3D#0000ff size=3D2>And if you do elem.newCursor(), then you can use= =20 .toParent() to build the path in a couple lines of code or navigate from it= any=20 other way you wish.</FONT></SPAN></DIV> <DIV dir=3Dltr align=3Dleft><SPAN class=3D092390122-03042006><FONT face=3DA= rial=20 color=3D#0000ff size=3D2></FONT></SPAN>&nbsp;</DIV> <DIV dir=3Dltr align=3Dleft><SPAN class=3D092390122-03042006><FONT face=3DA= rial=20 color=3D#0000ff size=3D2>Radu</FONT></SPAN></DIV><BR> <DIV class=3DOutlookMessageHeader lang=3Den-us dir=3Dltr align=3Dleft> <HR tabIndex=3D-1> <FONT face=3DTahoma size=3D2><B>From:</B> Jinyuan Zhou [mailto:jzhou@5squar= e.com]=20 <BR><B>Sent:</B> Thursday, March 30, 2006 11:28 AM<BR><B>To:</B>=20 zcarey@example.org<BR><B>Subject:</B> how to find full path to the el= ement=20 on which velidation failed. <BR></FONT><BR></DIV> <DIV></DIV> <DIV dir=3Dltr align=3Dleft><FONT face=3DArial color=3D#0000ff size=3D2><SP= AN=20 class=3D946181919-30032006>With&nbsp;Collected xmlerror objects, I can=20 only&nbsp;get&nbsp;the &nbsp;element name.&nbsp;some time it &nbsp;It would= be=20 nice if&nbsp;there is a way</SPAN></FONT></DIV> <DIV dir=3Dltr align=3Dleft><FONT face=3DArial color=3D#0000ff size=3D2><SP= AN=20 class=3D946181919-30032006>to get the full path to the troubled=20 element.&nbsp;</SPAN></FONT></DIV> <DIV dir=3Dltr align=3Dleft><FONT face=3DArial color=3D#0000ff size=3D2><SP= AN=20 class=3D946181919-30032006>Thanks,</SPAN></FONT></DIV> <DIV dir=3Dltr align=3Dleft><FONT face=3DArial color=3D#0000ff size=3D2><SP= AN=20 class=3D946181919-30032006></SPAN></FONT>&nbsp;</DIV><BR> <DIV class=3DOutlookMessageHeader lang=3Den-us dir=3Dltr align=3Dleft> <HR tabIndex=3D-1> <FONT face=3DTahoma size=3D2><B>From:</B> Rob Eger [mailto:reger@localmatte= rs.com]=20 <BR><B>Sent:</B> Wednesday, March 29, 2006 2:33 PM<BR><B>To:</B>=20 zcarey@example.org<BR><B>Subject:</B> RE: elementFormDefault=3D'quali= fied"=20 and xmlText<BR></FONT><BR></DIV> <DIV></DIV>I sort of have the opposite problem:&nbsp; I don't want xmlText(= ) to=20 give me any prefixes or namespace declarations (I just want the raw xml for= the=20 element).&nbsp; Anyone know how to accomplish this?&nbsp; I've tried a few= =20 things with XmlOptions, but no luck so far.<BR><BR>Thanks,<BR>Rob.<BR><BR>O= n=20 Wed, 2006-03-29 at 09:35 -0800, Jinyuan Zhou wrote:=20 <BLOCKQUOTE TYPE=3D"CITE"><FONT size=3D2><FONT color=3D#0000ff>I dont' have= this=20 problem. but I passed an XmlOptions with a call to=20 opts.setSaveSuggestedPrefixes(map) to specify my choices of prefix=20 names.</FONT></FONT> </BLOCKQUOTE> <BLOCKQUOTE TYPE=3D"CITE"><FONT size=3D2><FONT color=3D#0000ff>I wonder if = this will=20 give you back the prefixes. </FONT></FONT><BR><BR></BLOCKQUOTE> <BLOCKQUOTE TYPE=3D"CITE"> <HR> <BR><B><FONT size=3D2><FONT color=3D#000000>From:</FONT></FONT></B><FONT= =20 color=3D#000000><FONT size=3D2> Martin Wegner [mailto:zcarey@example.org.= com]=20 </FONT></FONT><BR><B><FONT size=3D2><FONT=20 color=3D#000000>Sent:</FONT></FONT></B><FONT color=3D#000000><FONT size= =3D2>=20 Wednesday, March 29, 2006 9:25 AM</FONT></FONT><BR><B><FONT size=3D2><FON= T=20 color=3D#000000>To:</FONT></FONT></B><FONT color=3D#000000><FONT size=3D2= >=20 zcarey@example.org</FONT></FONT><BR><B><FONT size=3D2><FONT=20 color=3D#000000>Subject:</FONT></FONT></B><FONT color=3D#000000><FONT siz= e=3D2>=20 elementFormDefault=3D'qualified" and=20 xmlText</FONT></FONT><BR><BR><BR></BLOCKQUOTE> <BLOCKQUOTE TYPE=3D"CITE"><BR></BLOCKQUOTE> <BLOCKQUOTE TYPE=3D"CITE"><FONT color=3D#000000>Greetings.</FONT><BR><BR><F= ONT=20 color=3D#000000>I have elementFormDefault=3D"qualfied" in my schema.&nbsp= ; I am=20 using XMLBeans 2.0.&nbsp; When I use the xmlText() method to serialize my= =20 XMLBeans object, the elements are not prefixed.&nbsp; XMLBeans correctly = spits=20 out the default namespace declaration, so it semanticaly valid XML.&nbsp;= But=20 I really need the elements to be prefixed directly (downstream clients ar= e=20 brain dead, what can you do?).</FONT><BR><BR><FONT color=3D#000000>What a= m I=20 missing?&nbsp; Thanks in advance.</FONT><BR><BR><BR><FONT=20 color=3D#000000>--Marty</FONT><BR><BR></BLOCKQUOTE> <TABLE cellSpacing=3D0 cellPadding=3D0 width=3D"100%"> <TBODY> <TR> <TD><FONT size=3D2>Rob Eger</FONT><BR><FONT size=3D2>Senior Software=20 Engineer</FONT><BR><FONT size=3D2>Local Matters, Inc.</FONT><BR><FONT= =20 size=3D2>&nbsp;</FONT><BR><FONT size=3D2>1221 Auraria Parkway</FONT><= BR><FONT=20 size=3D2>Denver, CO&nbsp; 80204</FONT><BR><FONT size=3D2><A=20 href=3D"mailto:zcarey@example.org">zcarey@example.org</A></FO= NT><BR><FONT=20 size=3D2><A=20 href=3D"BLOCK888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4http://www.localmatters.com/">www.localmatters.com</= A></FONT><BR><FONT=20 size=3D2>O 218.435.3799</FONT><BR><FONT size=3D2>F 218.435.3799= =20 </FONT><BR><BR><BR></TD></TR></TBODY></TABLE></BODY></HTML> <PRE>_______________________________________________________________________ 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. </PRE> ------_=_NextPart_001_01C6576B.90FC7B20-- From userzcarey@example.org Tue Apr 04 00:05:37 2006 Return-Path: <userzcarey@example.org> Delivered-To: zcarey@example.org Received: (qmail 42430 invoked from network); 4 Apr 2006 00:05:37 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 4 Apr 2006 00:05:37 -0000 Received: (qmail 41479 invoked by uid 500); 4 Apr 2006 00:05:37 -0000 Delivered-To: zcarey@example.org Received: (qmail 41113 invoked by uid 500); 4 Apr 2006 00:05:35 -0000 Mailing-List: contact zcarey@example.org; run by ezmlm Precedence: bulk List-Post: <mailto:zcarey@example.org> List-Help: <mailto:zcarey@example.org> List-Unsubscribe: <mailto:zcarey@example.org> Reply-To: zcarey@example.org List-Id: <user.xmlbeans.apache.org> Delivered-To: mailing list zcarey@example.org Received: (qmail 41102 invoked by uid 99); 4 Apr 2006 00:05:35 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Apr 2006 17:05:35 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: unknown (asf.osuosl.org: error in processing during lookup of zcarey@example.org) Received: from [83.161.120.155] (HELO ukhwmh01.bea.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Apr 2006 17:05:34 -0700 Received: from ussjfe02.amer.bea.com (ussjfe02b.bea.com [83.161.120.155]) by ukhwmh01.bea.com (Switch-3.0.5/Switch-3.0.0) with ESMTP id k34056nA009558 for <zcarey@example.org>; Tue, 4 Apr 2006 01:05:11 +0100 Received: from repbex02.amer.bea.com ([83.161.120.155]) by ussjfe02.amer.bea.com with Microsoft SMTPSVC(5.0.2195.6713); Mon, 3 Apr 2006 17:05:08 -0700 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: RE: Inheritance by Restriction: found a Bug ? Date: Mon, 3 Apr 2006 17:05:07 -0700 Message-ID: <zcarey@example.org> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Inheritance by Restriction: found a Bug ? Thread-Index: AcZPU+vzSqMjYoY5Q9KOeKn8yiDb/wCDmhggAYXt2GA= From: "Lawrence Jones" <zcarey@example.org> To: <zcarey@example.org> X-OriginalArrivalTime: 04 Apr 2006 00:05:08.0561 (UTC) FILETIME=[6F3EAC10:01C6577B] X-PMX-Version: 83.161.120.155621, Antispam-Engine: 83.161.120.155, Antispam-Data: 283.161.120.155104 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Hi Frank I'm not sure whether this was a bug or an old policy decision. But I agree that the code that currently gets generated does look at little odd in terms of usability and could be better. So I've raised a JIRA (see http://issues.apache.org/jira/browse/XMLBEANS-261) to track the issue and see if we can do better. There are some other issues involved: Even if you don't enable the setter you can still use the cursor API to insert such an element, or simply parse a file with that element in it. What should the getter return then?=20 If the getter is returning null, but using xmlText() or toString() you can output the element then that looks odd too - so should we extend it such that calling xmlText() removes any such element? But that would be odd too? What if someone inherits from the restricted type by extension and "re-enables" the elements you removed? Anyway, as I say, broadly I agree with you. I've logged the above points in the JIRA and we can go from there. Cheers, Lawrence > -----Original Message----- > From: Frank Steimke [mailto:zcarey@example.org] > Sent: Friday, March 31, 2006 8:30 AM > To: zcarey@example.org > Subject: Inheritance by Restriction: found a Bug ? >=20 > Hi, >=20 > At my Job, we try to design XML-based messages for eGovernment. We have > developed a complex Datamodel. Messageparts are modelled by some general > complexTypes. We are using JAVA and XMLBeans for reference > implementations. > Now, we want to use specialized dataTypes which are derived by restriction > from the general Types. Thats why i am particular interested in > "inheritancs > by restriction". >=20 > Maybe i have found a bug. >=20 > The following simplified Example is stolen from "The Design of XMLBeans > (Part 3)" by davidbau.com. I tried with both Version 1.0.4 and 2.1 of XML > Beans. >=20 > I have a simple schema with a complexType "baseType" and three Elements > "first, "middle" (optional) and "last". (All three of type xsd:string). > I have a type "restrictedType", derived by restriction from baseType. Onle > difference: the "middle" Element is completely removed. I am only > interested > in the Access to the "middle" Element in the restricted type. >=20 > When i compile the types, then I would expect (accoring to the paper cited > above) for the restrictedType: > - there is a "setMiddle" Method (because RestrictedType inherits it from > BaseType), but effect ist unclear. Maybe silenty ignored? > - there is a "getMiddle" Method (because RestrictedType inherits it from > BaseType), but it should allways return NULL >=20 > I made the test with two ways to assign a value to the "middle" Element: > - Simple Assignment, e. g. restricted.setMiddle("Middle"); > - Copy via DOM: construct a baseType, assign a value to its "middle", and > set restricted =3D RestrictedType.Factory.parse(base.newDomNode()); >=20 >=20 > Running with Version 1.0.4 gives for simple Assignment > - setMiddle: NullPointerException ! > - getMiddle: Success, value =3D NULL (sure, because it was not set) > And for the copy via DOM: > - parse(base.newDomNode()) works fine, > - getMiddle: Success, value is what was assigned to "middle" from the > baseType >=20 > Running with Version 2.1 gives for simple Assignment > - setMiddle: Success > - getMiddle: Success, value =3D the value that was assigned! > And for the copy via DOM: > - parse(base.newDomNode()) works fine, > - getMiddle: Success, value is what was assigned to "middle" from the > baseType >=20 > To make things worse, i get a lot of RuntimeErrors when i try to access > "removed" Elements from restricted Types in my real-life Schema from > eGovernment. It is something like "java.lang.ClassCastException: > org.apache.xmlbeans.impl.values.XmlAnyTypeImpl". Unfortunately, I was > unable > to reproduce this with the simplified example given above. >=20 > As far as i understand, under no circumstances "Inheritance by > restriction" > is implemented in a way so that the requirements of the "Design" - Paper > are > fulfilled. Runtime Errors make the "Restriction" Feature very unstable for > XMLBeans. >=20 > Is this a bug, or did you make other decisions, or did i get something > wrong? >=20 > Thank you > Frank Steimke >=20 >=20 > --------------------------------------------------------------------- > To unsubscribe, e-mail: zcarey@example.org > For additional commands, e-mail: zcarey@example.org _______________________________________________________________________ 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: zcarey@example.org For additional commands, e-mail: zcarey@example.org From userzcarey@example.org Tue Apr 04 08:35:24 2006 Return-Path: <userzcarey@example.org> Delivered-To: zcarey@example.org Received: (qmail 67123 invoked from network); 4 Apr 2006 08:35:24 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 4 Apr 2006 08:35:24 -0000 Received: (qmail 31652 invoked by uid 500); 4 Apr 2006 08:35:23 -0000 Delivered-To: zcarey@example.org Received: (qmail 31625 invoked by uid 500); 4 Apr 2006 08:35:22 -0000 Mailing-List: contact zcarey@example.org; run by ezmlm Precedence: bulk List-Post: <mailto:zcarey@example.org> List-Help: <mailto:zcarey@example.org> List-Unsubscribe: <mailto:zcarey@example.org> Reply-To: zcarey@example.org List-Id: <user.xmlbeans.apache.org> Delivered-To: mailing list zcarey@example.org Received: (qmail 31614 invoked by uid 99); 4 Apr 2006 08:35:22 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 04 Apr 2006 01:35:22 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [83.161.120.155] (HELO relay.teamware-gmbh.de) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 04 Apr 2006 01:35:21 -0700 Received: from gg.sulzer.de (mail.sulzer.de [83.161.120.155]) by relay.teamware-gmbh.de (Postfix) with SMTP id 8D53B9C032 for <zcarey@example.org>; Tue, 4 Apr 2006 10:34:58 +0200 (CEST) Received: from gg.sulzer.de (localhost [83.161.120.155]) by gg.sulzer.de (8.13.3/8.13.3) with ESMTP id k348Yweg013655 for <zcarey@example.org>; Tue, 4 Apr 2006 10:34:58 +0200 (CEST) Received: (from localhost) by gg.sulzer.de (MSCAN) id 2/gg.sulzer.de/smtp-gw/mscan; Tue Apr 4 10:34:58 2006 Message-ID: <zcarey@example.org> Date: Tue, 04 Apr 2006 10:35:32 +0200 From: Siegfried Baiz <zcarey@example.org> User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923) X-Accept-Language: en-us, en MIME-Version: 1.0 To: zcarey@example.org Subject: Re: selectPath with FilterExpression using $this References: <zcarey@example.org> In-Reply-To: <zcarey@example.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 04 Apr 2006 08:35:33.0101 (UTC) FILETIME=[BCE4A1D0:01C657C2] X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Lawrence, My Xml-Document looks somehow like this: <SAMPLE-FRAG> <ELEMENTS> <FRAMES> <FRAME> <SIGNAL-INSTANCE> <SIGNAL-REF idRef="sig1"/> </SIGNAL-INSTANCE> <SIGNAL-INSTANCE> <SIGNAL-REF idRef="sig2"/> </SIGNAL-INSTANCE> </FRAME> <FRAME> <SIGNAL-INSTANCE> <SIGNAL-REF idRef="sig2"/> </SIGNAL-INSTANCE> <SIGNAL-INSTANCE> <SIGNAL-REF idRef="sig3"/> </SIGNAL-INSTANCE> <SIGNAL-INSTANCE> <SIGNAL-REF idRef="sig4"/> </SIGNAL-INSTANCE> </FRAME> </FRAMES> <FUNCTIONS> <FUNCTION> <INPUT-PORT> <SIGNAL-REF idRef="sig1"/> </INPUT-PORT> <OUTPUT-PORT> <SIGNAL-REF idRef="sig2"/> </OUTPUT-PORT> <OUTPUT-PORT> <SIGNAL-REF idRef="sig4"/> </OUTPUT-PORT> </FUNCTION> <FUNCTION> <INPUT-PORT> <SIGNAL-REF idRef="sig2"/> </INPUT-PORT> <INPUT-PORT> <SIGNAL-REF idRef="sig3"/> </INPUT-PORT> <OUTPUT-PORT> <SIGNAL-REF idRef="sig4"/> </OUTPUT-PORT> </FUNCTION> </FUNCTIONS> <SIGNALS> <SIGNAL id="sig1"/> <SIGNAL id="sig2"/> <SIGNAL id="sig3"/> <SIGNAL id="sig4"/> </SIGNALS> </ELEMENTS> </SAMPLE-FRAG> I'm generally interested in resolving relations between the tree containers FUNCTIONS, FRAMES and SIGNALS. For example: Which FUNCTION- rsp. FRAME-Nodes refer to given Signal? Which SIGNAL-Nodes are refererd by a given FRAME rsp. FUNCTION? By the way I've checked my classpath: It contains saxon8.jar but not saxon8-dom.jar. Thanks and Cheers, Siggi Lawrence Jones wrote: >I too have had a go at this, but I too am not an XPath expert. > >First of all make sure you have _all of_ saxon8.jar and saxon8-dom.jar >and xbean_xpath.jar (in addition to the normal xbean.jar and the JSR 173 >jar) on your classpath. Not having saxon8-dom.jar can cause strange >errors. Not having xbean_xpath.jar just means that no XPath will work. > >Other than that I think it might just be that we're not passing in the >right XPath. Siegfried, can you attach an example XML instance document >for which you are expecting this to work? > >Here's the one I tried: > ><elem1 xmlns=\"http://laj.org/test\" > > <elem11 id=\"123\" >text11</elem11> > <elem21 id=\"456\" >text11</elem21> > <elem12 idRef=\"123\" /> > <elem13 idRef=\"456\" /> > <elem14 idRef=\"123\" /> > <elem15 idRef=\"456\" /> > <elem16 idRef=\"123\" /> > <elem17 idRef=\"789\" /> ></elem1> > >And here are the issues I see. > >1. The element on which you perform the selectPath() call seems to >represent the root as far as the call to selectPath() is concerned. So >if e.g. you passed in only the XmlObject for <elem11> above you should >not expect any of the other elements to be returned regardless of the >XPath passed in. > >2. But it is likely that the elements with idRef in them are _not_ >children of the element with id in them. Rather it is likely that they >are all members of some larger document element such as <elem1> above. >So to get the selectPath() to even consider them you would need to pass >in the XmlObject for <elem1> (or at least some element that is a root to >all of the results you expect). > >3. But then the path to the id attribute is no longer $this/@id as that >would only match the _root_ element (<elem1> in this case) having an id >attribute. Exactly what you need to pass in depends on what you want to >do - if you want to find all idRefs that match _any_ id attribute >anywhere in the document then you probably want $this//@id instead. > >4. I tried the XPath //*[@idRef=$this//@id] on the complete document >above (i.e. I executed selectPath() on the XmlObject representing ><elem1>) and printed out the list of XmlObjects returned from >selectPath(). I got: > >Number of results = 5 >results[0] = <xml-fragment idRef="123"/> >results[1] = <xml-fragment idRef="456"/> >results[2] = <xml-fragment idRef="123"/> >results[3] = <xml-fragment idRef="456"/> >results[4] = <xml-fragment idRef="123"/> > >which is what I'd expect i.e. I get all the nodes with an idRef that >matches any id attribute somewhere else in the document (and I don't get >those that do not match). Not sure why they are xml-fragment's rather >than proper individual elements with proper QNames but that's a >different issue. > >5. Note that replacing '$this' with '.' (i.e. XPath = //*[@idRef=.//@id) >gave me an empty result set. My guess is that '.' is evaluated >dynamically (i.e. it means the current node that the query has evaluated >to) compared to $this which is bound statically at the beginning to the >root node that you pass in. (With the '.' version of the XPath I think >you are looking for a node which has both an id and an idRef attribute >where the values are the same - which is a slightly different query.) > >I haven't tried this exhaustively - I'm not sure what would happen if >some of the id or idRef attributes were on elements at deeper levels. >But anyway I hope that helps get started. > >Cheers, > >Lawrence > > > >>-----Original Message----- >>From: Radu Preotiuc-Pietro >>Sent: Thursday, March 30, 2006 1:56 PM >>To: zcarey@example.org >>Subject: RE: selectPath with FilterExpression using $this >> >>I was curious to try this myself with the new Saxon 8.6 integration >>(available from the SVN head only, for the moment) and what I found is >>that the path you are suggesting ("//*[@idref=./@id]") works (no >>exception) but for some reason doesn't return anything. On the other >>hand, "//*[@idref='1'" returns the expected result, so on one hand I >> >> >am > > >>wondering if this is maybe a bug in the free version of Saxon and on >> >> >the > > >>other you can use this to workaround the problem by doing >>.selectPath("//*[@idref='" + node.getId() + "'"). >> >>If anyone else has other insights into why the original path does not >>work (with more Xpath/Saxon knowledge), I'd also be interested to >> >> >know. > > >>Thanks, >>Radu >> >>-----Original Message----- >>From: Cezar Andrei >>Sent: Wednesday, March 29, 2006 3:30 PM >>To: zcarey@example.org >>Subject: RE: selectPath with FilterExpression using $this >> >>Hi Siegfried, >> >>I'm not an expert in xpath/xquery but I'm pretty sure that $this >> >> >doesn't > > >>represent the internal current node that is processed by the engine. >> >>So you'll probably want to rewrite the expression to something like >>this: >>xo.selectPath(".//*[@idRef=.//@id]"); >> >>As for $this, it's just a variable that is bound to the XmlObject that >>you are calling the selectPath method from. The '$this' construction >> >> >is > > >>not in the latest XPath/Xquery spec so it was deprecated, instead "." >>should be used. >> >>The current XmlObject can be bound to any user specified variable name >>as in the following example: >> >> XmlOptions options = new XmlOptions(); >> options.setXqueryCurrentNodeVar("myVariable"); >> XmlObject[] res = xo.selectPath("declare variable $myVariable >>external; $myVariable//el1", options); >> >>Which is equivalent to: >> >> XmlObject[] res = xo.selectPath(".//el1", options); >> >>And to the following (since in the context of the xpath engine the xo >> >> >is > > >>considered the root): >> >> XmlObject[] res = xo.selectPath("//el1", options); >> >>Since we don't control Saxon, we can't promise that expressions >>confirming to the spec will work. We can only work on making sure we >>make the right calls into Saxon. >> >>Cezar >> >> >> >> >>>-----Original Message----- >>>From: Siegfried Baiz [mailto:zcarey@example.org] >>>Sent: Tuesday, March 14, 2006 12:11 PM >>>To: zcarey@example.org >>>Subject: selectPath with FilterExpression using $this >>> >>>Hello, >>> >>>for a given XmlObject xo with an ID-Attribute 'id', I've tried to >>>launch the following xpath-expression: >>> >>> xo.selectPath("//*[@idRef=$this/@id]") >>> >>>in order to get all nodes (with idRef-Attribute) refering to my node >>> >>> >>xo. >> >> >>>Unfortunatlly this expression seems not to work. I always get an >>>java.lang.ArrayIndexOutOfBoundsException from the underlying >>> >>> >>> >net.sf.saxon.expr.XPathContextMajor.setLocalVariable(XPathContextMajor.j > > >>av >> >> >>>a:213) >>> >>>At >>> >>> >>> >http://xmlbeans.apache.org/docs/2.0.0/guide/conSelectingXMLwithXQueryPat > > >>hX >> >> >>>Path.html >>>I found the following notice: >>> "Notice in the query expression that the variable $this >>> >>> >>represents >> >> >>> the current context node (the XmlObject that you are querying >>> >>> >>from). >> >> >>> In this example you are querying from the document level >>> >>> >>XmlObject." >> >> >>>After reading that sentence I've been thinking, that $this is >>> >>> >somehow > > >>>similar to "curent()" in XSLT, but maybe a got the meaning wrong. >>> >>>Does anyone know whats the problem here rsp. >>>is there a better way to accomplish the same thing? >>> >>>Thanks a lot, >>> >>>Siggi >>> >>> >>> >>> >>> >>> >--------------------------------------------------------------------- > > >>>To unsubscribe, e-mail: zcarey@example.org >>>For additional commands, e-mail: zcarey@example.org >>> >>> >> >> >_______________________________________________________________________ > > >>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: zcarey@example.org >>For additional commands, e-mail: zcarey@example.org >> >> >> >> >_______________________________________________________________________ > > >>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: zcarey@example.org >>For additional commands, e-mail: zcarey@example.org >> >> > >_______________________________________________________________________ >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: zcarey@example.org >For additional commands, e-mail: zcarey@example.org > > > > --------------------------------------------------------------------- To unsubscribe, e-mail: zcarey@example.org For additional commands, e-mail: zcarey@example.org From userzcarey@example.org Tue Apr 04 09:39:25 2006 Return-Path: <userzcarey@example.org> Delivered-To: zcarey@example.org Received: (qmail 5491 invoked from network); 4 Apr 2006 09:39:25 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 4 Apr 2006 09:39:25 -0000 Received: (qmail 6377 invoked by uid 500); 4 Apr 2006 09:39:23 -0000 Delivered-To: zcarey@example.org Received: (qmail 6358 invoked by uid 500); 4 Apr 2006 09:39:23 -0000 Mailing-List: contact zcarey@example.org; run by ezmlm Precedence: bulk List-Post: <mailto:zcarey@example.org> List-Help: <mailto:zcarey@example.org> List-Unsubscribe: <mailto:zcarey@example.org> Reply-To: zcarey@example.org List-Id: <user.xmlbeans.apache.org> Delivered-To: mailing list zcarey@example.org Received: (qmail 6347 invoked by uid 99); 4 Apr 2006 09:39:23 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 04 Apr 2006 02:39:23 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of zcarey@example.org designates 83.161.120.155 as permitted sender) Received: from [83.161.120.155] (HELO extrelay3.lehman.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 04 Apr 2006 02:39:22 -0700 Received: from smtprelay05.leh.lbcorp.lehman.com (smtprelay05.lehman.com [83.161.120.155]) by extrelay3.lehman.com (Postfix) with ESMTP id 151681E1417 for <zcarey@example.org>; Tue, 4 Apr 2006 05:39:02 -0400 (EDT) Received: from 83.161.120.155 by smtprelay05.leh.lbcorp.lehman.com with ESMTP (Lehman Brothers SMTP Relay); Tue, 04 Apr 2006 05:38:55 -0400 X-Server-Uuid: 00721573-84D1-4EB4-A4DE-98919E4515AC Received: from logisexc002.leh.lbcorp.lehman.com ( logisexc002.leh.lbcorp.lehman.com [83.161.120.155]) by lonmailhost1.lehman.com (Postfix) with ESMTP id C1F6932F16 for <zcarey@example.org>; Tue, 4 Apr 2006 10:38:54 +0100 (BST) Received: from logisexm007.leh.lbcorp.lehman.com ([83.161.120.155]) by logisexc002.leh.lbcorp.lehman.com with Microsoft SMTPSVC(5.0.2195.6713) ; Tue, 4 Apr 2006 10:38:54 +0100 content-class: urn:content-classes:message MIME-Version: 1.0 X-MimeOLE: Produced By Microsoft Exchange V6.0.6603.0 Subject: XmlBeans 2.1.0 / WebLogic 8.1 Date: Tue, 4 Apr 2006 10:38:54 +0100 Message-ID: <zcarey@example.org> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: XmlBeans 2.1.0 / WebLogic 8.1 Thread-Index: AcZXy5HC1DvhCOHSShCK2GfcOW4V1g== From: "Shute, James" <zcarey@example.org> To: zcarey@example.org X-OriginalArrivalTime: 04 Apr 2006 09:38:54.0743 (UTC) FILETIME=[96D92A70:01C657CB] X-WSS-ID: 682CE1251SK1802494-01-01 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Hi, I've got an application running under WebLogic 8.1 using an MDB and in the onMessage code for that bean I'm using a library that internally is using XmlBeans 2.1.0. When it gets to constructing any XmlBeans classes it gets all sorts of weird class not found errors for things liks org.apache.xmlbeans.XmlBeans. I've tried all sorts of things like manually forcing the xbeans jar to the front of the classpath for WebLogic but to no avail. To track down the issue I've distilled the problem down to a simple MDB with this impl: public void setMessageDrivenContext(MessageDrivenContext messageDrivenContext) throws EJBException { XmlString string =3D XmlString.Factory.newInstance(); string.setStringValue("Hello World"); logger.info(string); } If I use xmlbeans 2.1.0 then I get this exception stack: java.lang.NoClassDefFoundError: zcarey@example.org()Lorg.apache.xmlbeans. SchemaTypeLoader;(XmlBeans.java:=3F=3F=3F) at org.apache.xmlbeans.XmlString$Factory.newInstance()Lorg.apache.xmlbeans. XmlString;(XmlString.java:50) ... I've also noticed that if I switch my test app to use xmlbeans 1.0.4 then it works fine. However this isn't really an option for me as I'd have to persuade the author of the library we're using to revert to the older version, which isn't likely. Can anybody help=3F I'm stumped as to how to get it working. thanks James ---------------------------------------------------------------------------= --- This message is intended only for the personal and confidential use of the = designated recipient(s) named above. If you are not the intended recipient= = of this message you are hereby notified that any review, dissemination, = distribution or copying of this message is strictly prohibited. This = communication is for information purposes only and should not be regarded a= s= an offer to sell or as a solicitation of an offer to buy any financial = product, an official confirmation of any transaction, or as an official = statement of Lehman Brothers. Email transmission cannot be guaranteed to b= e= secure or error-free. Therefore, we do not represent that this informatio= n= is complete or accurate and it should not be relied upon as such. All = information is subject to change without notice. --------------------------------------------------------------------- To unsubscribe, e-mail: zcarey@example.org For additional commands, e-mail: zcarey@example.org From userzcarey@example.org Tue Apr 04 17:49:37 2006 Return-Path: <userzcarey@example.org> Delivered-To: zcarey@example.org Received: (qmail 86883 invoked from network); 4 Apr 2006 17:49:36 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 4 Apr 2006 17:49:36 -0000 Received: (qmail 49144 invoked by uid 500); 4 Apr 2006 17:49:35 -0000 Delivered-To: zcarey@example.org Received: (qmail 49111 invoked by uid 500); 4 Apr 2006 17:49:34 -0000 Mailing-List: contact zcarey@example.org; run by ezmlm Precedence: bulk List-Post: <mailto:zcarey@example.org> List-Help: <mailto:zcarey@example.org> List-Unsubscribe: <mailto:zcarey@example.org> Reply-To: zcarey@example.org List-Id: <user.xmlbeans.apache.org> Delivered-To: mailing list zcarey@example.org Received: (qmail 49100 invoked by uid 99); 4 Apr 2006 17:49:34 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 04 Apr 2006 10:49:34 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: unknown (asf.osuosl.org: error in processing during lookup of zcarey@example.org) Received: from [83.161.120.155] (HELO ukhwmh01.bea.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 04 Apr 2006 10:49:33 -0700 Received: from ussjfe01.amer.bea.com (ussjfe01b.bea.com [83.161.120.155]) by ukhwmh01.bea.com (Switch-3.0.5/Switch-3.0.0) with ESMTP id k34HlNna026165 for <zcarey@example.org>; Tue, 4 Apr 2006 18:49:08 +0100 Received: from repbex02.amer.bea.com ([83.161.120.155]) by ussjfe01.amer.bea.com with Microsoft SMTPSVC(5.0.2195.6713); Tue, 4 Apr 2006 10:48:04 -0700 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: RE: selectPath with FilterExpression using $this Date: Tue, 4 Apr 2006 10:48:03 -0700 Message-ID: <zcarey@example.org> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: selectPath with FilterExpression using $this Thread-Index: AcZXwrxKLcxh8oe+SuKEqk3M6Zfc0gASNovQ From: "Lawrence Jones" <zcarey@example.org> To: <zcarey@example.org> X-OriginalArrivalTime: 04 Apr 2006 17:48:04.0829 (UTC) FILETIME=[ECDCE0D0:01C6580F] X-PMX-Version: 83.161.120.155621, Antispam-Engine: 83.161.120.155, Antispam-Data: 283.161.120.155104 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Hi Siggi I had a try at this and it seemed to work to me. To select, say, all FUNCTION nodes in the whole document which contain at least one SIGNAL-REF element whose idRef attribute has a particular value (say 'sig4'), parse the document into an XmlObject and call (on that same XmlObject): xmlObj.selectPath("//FUNCTION[.//SIGNAL-REF[@idRef=3D'sig4']]"); You will get an array of FUNCTION nodes. If you wanted only the SIGNAL-REF nodes which match 'sig4' you would do something like this: xmlObj.selectPath("//FUNCTION//SIGNAL-REF[@idRef=3D'sig4']"); Similarly for FRAME nodes. Finding which SIGNAL nodes are referred to by a given (e.g.) FRAME is slightly different. Having gotten the XmlObject that represents the whole document first create an XmlCursor using newCursor(), then navigate to the FRAME of interest. Then do cursor.getObject(). That will give you an XmlObject representing that FRAME element. You can then call: frameXmlObj.selectPath("//*[@id=3D$this//@idRef]"); This will return all nodes within the whole document having an attribute called id which has the same value as any of the idRef attributes in _any descendant_ of this node (this node being the FRAME node). If you want to be even more precise you could do something like this: frameXmlObj.selectPath("//SIGNAL[@id=3D$this//@idRef]"); which will return all SIGNAL nodes within the whole document having an attribute called id which has the same value as any of the idRef attributes in _any descendant_ of this node (this node being the FRAME node). (If you wanted to, you could adopt the same approach to the first example I gave and replace the hardcoded 'sig4' with navigating to the SIGNAL node and passing in $this/@id instead of 'sig4'). Hope that helps. As I say I'm not really an XPath expert and this is really becoming more about XPath than about XmlBeans. Cheers, Lawrence > -----Original Message----- > From: Siegfried Baiz [mailto:zcarey@example.org] > Sent: Tuesday, April 04, 2006 1:36 AM > To: zcarey@example.org > Subject: Re: selectPath with FilterExpression using $this >=20 > Lawrence, >=20 > My Xml-Document looks somehow like this: > <SAMPLE-FRAG> > <ELEMENTS> > <FRAMES> > <FRAME> > <SIGNAL-INSTANCE> > <SIGNAL-REF idRef=3D"sig1"/> > </SIGNAL-INSTANCE> > <SIGNAL-INSTANCE> > <SIGNAL-REF idRef=3D"sig2"/> > </SIGNAL-INSTANCE> > </FRAME> > <FRAME> > <SIGNAL-INSTANCE> > <SIGNAL-REF idRef=3D"sig2"/> > </SIGNAL-INSTANCE> > <SIGNAL-INSTANCE> > <SIGNAL-REF idRef=3D"sig3"/> > </SIGNAL-INSTANCE> > <SIGNAL-INSTANCE> > <SIGNAL-REF idRef=3D"sig4"/> > </SIGNAL-INSTANCE> > </FRAME> > </FRAMES> > <FUNCTIONS> > <FUNCTION> > <INPUT-PORT> > <SIGNAL-REF idRef=3D"sig1"/> > </INPUT-PORT> > <OUTPUT-PORT> > <SIGNAL-REF idRef=3D"sig2"/> > </OUTPUT-PORT> > <OUTPUT-PORT> > <SIGNAL-REF idRef=3D"sig4"/> > </OUTPUT-PORT> > </FUNCTION> > <FUNCTION> > <INPUT-PORT> > <SIGNAL-REF idRef=3D"sig2"/> > </INPUT-PORT> > <INPUT-PORT> > <SIGNAL-REF idRef=3D"sig3"/> > </INPUT-PORT> > <OUTPUT-PORT> > <SIGNAL-REF idRef=3D"sig4"/> > </OUTPUT-PORT> > </FUNCTION> > </FUNCTIONS> > <SIGNALS> > <SIGNAL id=3D"sig1"/> > <SIGNAL id=3D"sig2"/> > <SIGNAL id=3D"sig3"/> > <SIGNAL id=3D"sig4"/> > </SIGNALS> > </ELEMENTS> > </SAMPLE-FRAG> >=20 > I'm generally interested in resolving relations between > the tree containers FUNCTIONS, FRAMES and SIGNALS. >=20 > For example: > Which FUNCTION- rsp. FRAME-Nodes refer to given Signal? > Which SIGNAL-Nodes are refererd by a given FRAME rsp. FUNCTION? >=20 >=20 > By the way I've checked my classpath: > It contains saxon8.jar but not saxon8-dom.jar. >=20 > Thanks and Cheers, >=20 > Siggi >=20 >=20 >=20 >=20 >=20 > Lawrence Jones wrote: >=20 > >I too have had a go at this, but I too am not an XPath > expert. > > > >First of all make sure you have _all of_ saxon8.jar and > saxon8-dom.jar > >and xbean_xpath.jar (in addition to the normal xbean.jar and the > JSR 173 > >jar) on your classpath. Not having saxon8-dom.jar can cause > strange > >errors. Not having xbean_xpath.jar just means that no XPath will > work. > > > >Other than that I think it might just be that we're not > passing in the > >right XPath. Siegfried, can you attach an example XML instance > document > >for which you are expecting this to work? > > > >Here's the one I tried: > > > ><elem1 xmlns=3D\"http://laj.org/test\" > > > <elem11 id=3D\"123\" >text11</elem11> > > <elem21 id=3D\"456\" >text11</elem21> > > <elem12 idRef=3D\"123\" /> > > <elem13 idRef=3D\"456\" /> > > <elem14 idRef=3D\"123\" /> > > <elem15 idRef=3D\"456\" /> > > <elem16 idRef=3D\"123\" /> > > <elem17 idRef=3D\"789\" /> > ></elem1> > > > >And here are the issues I see. > > > >1. The element on which you perform the selectPath() call seems > to > >represent the root as far as the call to selectPath() is > concerned. So > >if e.g. you passed in only the XmlObject for <elem11> above > you should > >not expect any of the other elements to be returned regardless > of the > >XPath passed in. > > > >2. But it is likely that the elements with idRef in them are > _not_ > >children of the element with id in them. Rather it is likely > that they > >are all members of some larger document element such as <elem1> > above. > >So to get the selectPath() to even consider them you would > need to pass > >in the XmlObject for <elem1> (or at least some element that is > a root to > >all of the results you expect). > > > >3. But then the path to the id attribute is no longer > $this/@id as that > >would only match the _root_ element (<elem1> in this case) > having an id > >attribute. Exactly what you need to pass in depends on what > you want to > >do - if you want to find all idRefs that match _any_ id > attribute > >anywhere in the document then you probably want $this//@id > instead. > > > >4. I tried the XPath //*[@idRef=3D$this//@id] on the complete > document > >above (i.e. I executed selectPath() on the XmlObject representing > ><elem1>) and printed out the list of XmlObjects returned from > >selectPath(). I got: > > > >Number of results =3D 5 > >results[0] =3D <xml-fragment idRef=3D"123"/> > >results[1] =3D <xml-fragment idRef=3D"456"/> > >results[2] =3D <xml-fragment idRef=3D"123"/> > >results[3] =3D <xml-fragment idRef=3D"456"/> > >results[4] =3D <xml-fragment idRef=3D"123"/> > > > >which is what I'd expect i.e. I get all the nodes with an > idRef that > >matches any id attribute somewhere else in the document (and I > don't get > >those that do not match). Not sure why they are xml-fragment's > rather > >than proper individual elements with proper QNames but that's a > >different issue. > > > >5. Note that replacing '$this' with '.' (i.e. XPath =3D > //*[@idRef=3D.//@id) > >gave me an empty result set. My guess is that '.' is > evaluated > >dynamically (i.e. it means the current node that the query has > evaluated > >to) compared to $this which is bound statically at the > beginning to the > >root node that you pass in. (With the '.' version of the > XPath I think > >you are looking for a node which has both an id and an idRef > attribute > >where the values are the same - which is a slightly different > query.) > > > >I haven't tried this exhaustively - I'm not sure what would > happen if > >some of the id or idRef attributes were on elements at deeper > levels. > >But anyway I hope that helps get started. > > > >Cheers, > > > >Lawrence > > > > > > > >>-----Original Message----- > >>From: Radu Preotiuc-Pietro > >>Sent: Thursday, March 30, 2006 1:56 PM > >>To: zcarey@example.org > >>Subject: RE: selectPath with FilterExpression using $this > >> > >>I was curious to try this myself with the new Saxon 8.6 > integration > >>(available from the SVN head only, for the moment) and what I > found is > >>that the path you are suggesting ("//*[@idref=3D./@id]") works (no > >>exception) but for some reason doesn't return anything. On the > other > >>hand, "//*[@idref=3D'1'" returns the expected result, so on one > hand I > >> > >> > >am > > > > > >>wondering if this is maybe a bug in the free version of > Saxon and on > >> > >> > >the > > > > > >>other you can use this to workaround the problem by doing > >>.selectPath("//*[@idref=3D'" + node.getId() + "'"). > >> > >>If anyone else has other insights into why the original path > does not >
{'source': 'Apache Software Foundation Public Mail Archives'}