<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title>user@xmlbeans.apache.org Archives</title>
<link rel="self" href="http://mail-archives.apache.org/mod_mbox/xmlbeans-user/?format=atom"/>
<link href="http://mail-archives.apache.org/mod_mbox/xmlbeans-user/"/>
<id>http://mail-archives.apache.org/mod_mbox/xmlbeans-user/</id>
<updated>2009-12-09T20:29:21Z</updated>
<entry>
<title>[VOTE] XMLBeans v2.5.0-RC1 to become official release</title>
<author><name>Cezar Andrei &lt;cezar.andrei@oracle.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/xmlbeans-user/200912.mbox/%3c627f9409-bb25-40a3-bb1d-4497d930b032@default%3e"/>
<id>urn:uuid:%3c627f9409-bb25-40a3-bb1d-4497d930b032@default%3e</id>
<updated>2009-12-09T17:23:09Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Please cast your vote for the XMLBeans v2.5.0-RC1, as published at http://xmlbeans.apache.org/dist/,
to become XMLBeans v2.5.0 official release.

 

The vote will be open until end of day Saturday, 12th of December. Anyone is allowed to show
support or lack of it, but only XMLBeans committer votes are binding.

 

[ ]  +1  -  I am in favor of this release, and can help

[ ]  +0  -  I am in favor of this release, but cannot help

[ ]  -0  -  I am not in favor of this release

[ ]  -1  -  I am against this proposal (must include a reason) 

 

 

 

My vote is:

[X]  +1  -  I am in favor of this release, and can help

 

Cezar 


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: [Release Candidate] XMLBeans 2.5.0-RC1</title>
<author><name>Wendal Chen &lt;wendal1985@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/xmlbeans-user/200912.mbox/%3cbc5ee4c50912081622o349bef5bx83b7ace409acbc23@mail.gmail.com%3e"/>
<id>urn:uuid:%3cbc5ee4c50912081622o349bef5bx83b7ace409acbc23@mail-gmail-com%3e</id>
<updated>2009-12-09T00:22:23Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
haha ... O(âˆ©_âˆ©)O~

Congratulation!

I've been using it.

2009/12/9 Cezar Andrei &lt;cezar.andrei@oracle.com&gt;

&gt;  There seems to be no problems, except from the missing src.zip file which
&gt; Iâ€™ll copy shortly. Iâ€™ll follow up with the VOTE email.
&gt;
&gt; In the meantime, please do check it in your environment.
&gt;
&gt;
&gt;
&gt; Thank you,
&gt;
&gt; Cezar
&gt;
&gt;
&gt;   ------------------------------
&gt;
&gt; *From:* Cezar Andrei
&gt; *Sent:* Wednesday, November 25, 2009 5:25 PM
&gt; *To:* dev@xmlbeans.apache.org
&gt; *Cc:* user@xmlbeans.apache.org
&gt; *Subject:* [Release Candidate] XMLBeans 2.5.0-RC1
&gt;
&gt;
&gt;
&gt; Hello everyone,
&gt;
&gt;
&gt;
&gt; The first release candidate for XMLBeans 2.5.0 is available at:
&gt;
&gt; http://xmlbeans.apache.org/dist/
&gt;
&gt;
&gt;
&gt; Please give it a try and let us know if there are any problems with it.
&gt;
&gt;
&gt;
&gt; Thank you,
&gt;
&gt; Cezar Andrei
&gt;


</pre>
</div>
</content>
</entry>
<entry>
<title>RE: [Release Candidate] XMLBeans 2.5.0-RC1</title>
<author><name>Cezar Andrei &lt;cezar.andrei@oracle.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/xmlbeans-user/200912.mbox/%3c593bc263-d70a-47ea-87c8-86ef07a7f350@default%3e"/>
<id>urn:uuid:%3c593bc263-d70a-47ea-87c8-86ef07a7f350@default%3e</id>
<updated>2009-12-08T19:41:50Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
There seems to be no problems, except from the missing src.zip file which I'll copy shortly.
I'll follow up with the VOTE email.

In the meantime, please do check it in your environment.

 

Thank you,

Cezar

 

  _____  

From: Cezar Andrei 
Sent: Wednesday, November 25, 2009 5:25 PM
To: dev@xmlbeans.apache.org
Cc: user@xmlbeans.apache.org
Subject: [Release Candidate] XMLBeans 2.5.0-RC1

 

Hello everyone,

 

The first release candidate for XMLBeans 2.5.0 is available at:

http://xmlbeans.apache.org/dist/

 

Please give it a try and let us know if there are any problems with it.

 

Thank you,

Cezar Andrei


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Could not get a Java Date type from a Schema complex type</title>
<author><name>bottabing &lt;paul_botta@hotmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/xmlbeans-user/200912.mbox/%3c26639796.post@talk.nabble.com%3e"/>
<id>urn:uuid:%3c26639796-post@talk-nabble-com%3e</id>
<updated>2009-12-04T21:44:37Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>

I hope that the workaround that I describe is the correct solution.  I
encountered a few and from what I best recall, this was the fix for this
issue.  Feel free to contact me at paul_botta@hotmail.com.

There was an issue (either AXIS or with the XML beans generated classes)
where the namespace was not always being correctly appended with the
trailing '/'.  I used some debug output statements to output the value.  I
was not successful at uncovering the cause, but arrived at a workaround.  I
ended up getting into the auto-gen stub that extends
org.apache.axis2.receivers.AbstractInOutSyncMessageReceiver and added the
following method:


	public org.apache.axiom.soap.SOAPEnvelope
validateNamespace(org.apache.axiom.soap.SOAPEnvelope envelope) {
	  java.util.Iterator namespaceIterator = envelope.getBody().getChildren();
	  while (namespaceIterator.hasNext()) {
			org.apache.axiom.om.OMNode ns = (org.apache.axiom.om.OMNode)
namespaceIterator.next();
			org.apache.axiom.om.OMElement element = null;

			if ( ns instanceof org.apache.axiom.om.OMElement){
			   element = (org.apache.axiom.om.OMElement)ns;
				  if ( element.getDefaultNamespace().getNamespaceURI() != null
					 &amp;&amp;
element.getDefaultNamespace().getNamespaceURI().equals("http://xyz.com/mobility/network/sector/schemas")
) {
					
element.declareDefaultNamespace("http://xyz.com/mobility/network/sector/schemas/");
				  }
			  }
	  }
	  return envelope;



In the various toEnvelope() methods within the same class I added the
following checks:


        if (param != null) {
            envelope.getBody().addChild(toOM(param, optimizeContent));
            return validateNamespace(envelope);
        }
	

Hope this helps.
-- 
View this message in context: http://old.nabble.com/Could-not-get-a-Java-Date-type-from-a-Schema-complex-type-tp13028826p26639796.html
Sent from the Xml Beans - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Could not get a Java Date type from a Schema complex type</title>
<author><name>RonnieMJ &lt;ronniemjohns@hotmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/xmlbeans-user/200912.mbox/%3c26636382.post@talk.nabble.com%3e"/>
<id>urn:uuid:%3c26636382-post@talk-nabble-com%3e</id>
<updated>2009-12-04T19:41:52Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>

Hi, did you ever find an answer to this?  I'm having the exact same issue
(working with the same company).

Thanks,
Ronnie


bottabing wrote:
&gt; 
&gt; I am getting the following exception.  I am using XMLBeans and Axis.
&gt; 
&gt; org.apache.xmlbeans.impl.values.XmlValueNotSupportedException: Could not
&gt; get a Java Date type from a Schema complex type
&gt; 
&gt; The object that is being SOAPified doesnâ€™t contain a date value. Below is
&gt; the SOAP call, the completed response prior to sending across the wire
&gt; (which looks fine), the stack trace and the WSDL.  Thanks.
&gt; 
&gt; 1-       SOAP Call
&gt; &lt;soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
&gt; xmlns:xsd="http://www.w3.org/2001/XMLSchema"
&gt; xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
&gt; xmlns:end="http://endpoint.webservice.cssng.nis.cingular.com"&gt;
&gt; 
&gt;    &lt;soapenv:Header/&gt;
&gt;    &lt;soapenv:Body&gt;
&gt;       &lt;end:getLocationByKey
&gt; soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"&gt;
&gt;          &lt;locationId xsi:type="xsd:int"&gt;7&lt;/locationId&gt;
&gt;       &lt;/end:getLocationByKey&gt;
&gt;    &lt;/soapenv:Body&gt;
&gt; 
&gt; &lt;/soapenv:Envelope&gt;
&gt; 
&gt; 
&gt; 

-- 
View this message in context: http://old.nabble.com/Could-not-get-a-Java-Date-type-from-a-Schema-complex-type-tp13028826p26636382.html
Sent from the Xml Beans - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>RE: Processing schema instances</title>
<author><name>Cezar Andrei &lt;cezar.andrei@oracle.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/xmlbeans-user/200912.mbox/%3ca48f43c2-6b1d-4832-90dc-240eed393356@default%3e"/>
<id>urn:uuid:%3ca48f43c2-6b1d-4832-90dc-240eed393356@default%3e</id>
<updated>2009-12-04T19:37:39Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
David,

You're correct the classes in org.apache.xmlbeans.impl.xb.xsdschema are the classes XMLBeans
uses internally to load up xsd files. They are just compiled xbeans of schema4schemas xsd,
(because of this bootstrap is required) but you can use them directly. 

Those classes will help you deal with .xsd files in XML sense, but it seems you need to ask
schema specific questions. For this you'll have to compile (use XMLBeans.compileXsd() ) the
xsd files into a TypeSystem and than using the TypeSystem/SchemaType interfaces you can ask
schema related questions (see java doc and articles linked from XMLBeans website).

Cezar

&gt; -----Original Message-----
&gt; From: M. David Allen [mailto:dmallen@mitre.org]
&gt; Sent: Wednesday, December 02, 2009 12:14 PM
&gt; To: user@xmlbeans.apache.org
&gt; Subject: Processing schema instances
&gt; 
&gt; 
&gt; I'm trying to use XMLBeans to process schema instances (that is, actual
&gt; schema files).  I've found that XMLBeans seems to have the types baked in
&gt; to
&gt; do this, via org.apache.xmlbeans.impl.xb.xsdschema.SchemaDocument;
&gt; SchemaDocument doc = SchemaDocument.Factory.parse(relative);
&gt; 
&gt; So that works.  But I'm not finding any javadocs for these classes as they
&gt; look like internals that might not have been meant for XMLBeans users.
&gt; 
&gt; I need to ask questions of a schema instance such as, "which types are
&gt; derived from somepref:FooType"? and to get a list of all elements a schema
&gt; defines, with their corresponding types.
&gt; 
&gt; Using XMLBeans to process schemas like they were any other document (i.e.
&gt; conforming to the XML schema schema) seemed like the way to go.  Is there
&gt; a
&gt; different API I should be checking to do this?
&gt; 
&gt; Thanks
&gt; --
&gt; View this message in context: http://old.nabble.com/Processing-schema-
&gt; instances-tp26613672p26613672.html
&gt; Sent from the Xml Beans - User mailing list archive at Nabble.com.
&gt; 
&gt; 
&gt; ---------------------------------------------------------------------
&gt; To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
&gt; For additional commands, e-mail: user-help@xmlbeans.apache.org
&gt; 

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Suggestions for out of memory error on xml bean ant task?</title>
<author><name>Dave Shuck &lt;dshuck@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/xmlbeans-user/200912.mbox/%3c2d07a0350912030635m36f5ecebhc523ca50f9c0a93d@mail.gmail.com%3e"/>
<id>urn:uuid:%3c2d07a0350912030635m36f5ecebhc523ca50f9c0a93d@mail-gmail-com%3e</id>
<updated>2009-12-03T14:35:18Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Thank you for this suggestion.  Using a different JDK hadn't even crossed my
mind.  I had already bumped my memory settings up to 1024 in eclipse and it
was still failing under the Sun one.  After swapping in JRockit, it worked
perfectly!




~Dave Shuck
/**************************************
blog: www.daveshuck.com
tweets: www.twitter.com/dshuck
cf peeps: www.dfwcfug.org
**************************************/


On Wed, Dec 2, 2009 at 5:23 PM, Wing Yew Poon &lt;wing.yew.poon@oracle.com&gt;wrote:

&gt;  Just an idea: I have sometimes found that using a different JDK helps,
&gt; e.g., use JRockit instead of Sun's JDK.
&gt;
&gt;  ------------------------------
&gt; *From:* Dave Shuck [mailto:dshuck@gmail.com]
&gt; *Sent:* Wednesday, December 02, 2009 3:16 PM
&gt; *To:* user@xmlbeans.apache.org
&gt; *Subject:* Suggestions for out of memory error on xml bean ant task?
&gt;
&gt; I am trying to to build a JAR file from a _very_ large XSD file (12K lines)
&gt; on a laptop that is (unfortunately) running Windows 7 with 2GB of memory.
&gt; Both from within eclipse and from the command line, I am getting "[xmlbean]
&gt; java.lang.OutOfMemoryError: Java heap space" errors as it attempts to
&gt; compile 7604 source files after parsing the XSD.  Within eclipse.ini I have
&gt; boosted the memory settings as high as I can without success.
&gt;
&gt; While I realize that this size XSD is pretty excessive, our company has a
&gt; Hudson server that does successfully build this XSD--&gt;JAR nightly, so I know
&gt; that it can be compiled given the right environment.
&gt;
&gt; Does anyone have any suggestions for how I might be able to better manage
&gt; the memory to allow me to build on my development laptop?
&gt;
&gt; Thanks in advance for any help.
&gt;
&gt;
&gt; ~Dave Shuck
&gt; /**************************************
&gt; blog: www.daveshuck.com
&gt; tweets: www.twitter.com/dshuck
&gt; cf peeps: www.dfwcfug.org
&gt; **************************************/
&gt;


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Suggestions for out of memory error on xml bean ant task?</title>
<author><name>Wendal Chen &lt;wendal1985@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/xmlbeans-user/200912.mbox/%3cbc5ee4c50912021555r62fea431h4c413e16b577747@mail.gmail.com%3e"/>
<id>urn:uuid:%3cbc5ee4c50912021555r62fea431h4c413e16b577747@mail-gmail-com%3e</id>
<updated>2009-12-02T23:55:06Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
In my project , the XSD file is bigger than 1000K . But XMLBeans work very
good.

I think you shall add some JVM args. like -Xmx512m

2009/12/3 Wing Yew Poon &lt;wing.yew.poon@oracle.com&gt;

&gt;  Just an idea: I have sometimes found that using a different JDK helps,
&gt; e.g., use JRockit instead of Sun's JDK.
&gt;
&gt;  ------------------------------
&gt; *From:* Dave Shuck [mailto:dshuck@gmail.com]
&gt; *Sent:* Wednesday, December 02, 2009 3:16 PM
&gt; *To:* user@xmlbeans.apache.org
&gt; *Subject:* Suggestions for out of memory error on xml bean ant task?
&gt;
&gt; I am trying to to build a JAR file from a _very_ large XSD file (12K lines)
&gt; on a laptop that is (unfortunately) running Windows 7 with 2GB of memory.
&gt; Both from within eclipse and from the command line, I am getting "[xmlbean]
&gt; java.lang.OutOfMemoryError: Java heap space" errors as it attempts to
&gt; compile 7604 source files after parsing the XSD.  Within eclipse.ini I have
&gt; boosted the memory settings as high as I can without success.
&gt;
&gt; While I realize that this size XSD is pretty excessive, our company has a
&gt; Hudson server that does successfully build this XSD--&gt;JAR nightly, so I know
&gt; that it can be compiled given the right environment.
&gt;
&gt; Does anyone have any suggestions for how I might be able to better manage
&gt; the memory to allow me to build on my development laptop?
&gt;
&gt; Thanks in advance for any help.
&gt;
&gt;
&gt; ~Dave Shuck
&gt; /**************************************
&gt; blog: www.daveshuck.com
&gt; tweets: www.twitter.com/dshuck
&gt; cf peeps: www.dfwcfug.org
&gt; **************************************/
&gt;


</pre>
</div>
</content>
</entry>
<entry>
<title>RE: Suggestions for out of memory error on xml bean ant task?</title>
<author><name>Wing Yew Poon &lt;wing.yew.poon@oracle.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/xmlbeans-user/200912.mbox/%3c6025fffe-350b-4c1e-ab26-d638b7d0df3d@default%3e"/>
<id>urn:uuid:%3c6025fffe-350b-4c1e-ab26-d638b7d0df3d@default%3e</id>
<updated>2009-12-02T23:23:04Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Just an idea: I have sometimes found that using a different JDK helps, e.g., use JRockit instead
of Sun's JDK.

  _____  

From: Dave Shuck [mailto:dshuck@gmail.com] 
Sent: Wednesday, December 02, 2009 3:16 PM
To: user@xmlbeans.apache.org
Subject: Suggestions for out of memory error on xml bean ant task?


I am trying to to build a JAR file from a _very_ large XSD file (12K lines) on a laptop that
is (unfortunately) running Windows 7 with 2GB of memory.  Both from within eclipse and from
the command line, I am getting "[xmlbean] java.lang.OutOfMemoryError: Java heap space" errors
as it attempts to compile 7604 source files after parsing the XSD.  Within eclipse.ini I have
boosted the memory settings as high as I can without success.  

While I realize that this size XSD is pretty excessive, our company has a Hudson server that
does successfully build this XSD--&gt;JAR nightly, so I know that it can be compiled given
the right environment.

Does anyone have any suggestions for how I might be able to better manage the memory to allow
me to build on my development laptop?

Thanks in advance for any help.


~Dave Shuck
/**************************************
blog: HYPERLINK "http://www.daveshuck.com"www.daveshuck.com
tweets: HYPERLINK "http://www.twitter.com/dshuck"www.twitter.com/dshuck
cf peeps: HYPERLINK "http://www.dfwcfug.org"www.dfwcfug.org
**************************************/


</pre>
</div>
</content>
</entry>
<entry>
<title>Suggestions for out of memory error on xml bean ant task?</title>
<author><name>Dave Shuck &lt;dshuck@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/xmlbeans-user/200912.mbox/%3c2d07a0350912021515n69d3f8dv2e6b6772d1c32c6a@mail.gmail.com%3e"/>
<id>urn:uuid:%3c2d07a0350912021515n69d3f8dv2e6b6772d1c32c6a@mail-gmail-com%3e</id>
<updated>2009-12-02T23:15:44Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
I am trying to to build a JAR file from a _very_ large XSD file (12K lines)
on a laptop that is (unfortunately) running Windows 7 with 2GB of memory.
Both from within eclipse and from the command line, I am getting "[xmlbean]
java.lang.OutOfMemoryError: Java heap space" errors as it attempts to
compile 7604 source files after parsing the XSD.  Within eclipse.ini I have
boosted the memory settings as high as I can without success.

While I realize that this size XSD is pretty excessive, our company has a
Hudson server that does successfully build this XSD--&gt;JAR nightly, so I know
that it can be compiled given the right environment.

Does anyone have any suggestions for how I might be able to better manage
the memory to allow me to build on my development laptop?

Thanks in advance for any help.


~Dave Shuck
/**************************************
blog: www.daveshuck.com
tweets: www.twitter.com/dshuck
cf peeps: www.dfwcfug.org
**************************************/


</pre>
</div>
</content>
</entry>
<entry>
<title>Processing schema instances</title>
<author><name>&quot;M. David Allen&quot; &lt;dmallen@mitre.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/xmlbeans-user/200912.mbox/%3c26613672.post@talk.nabble.com%3e"/>
<id>urn:uuid:%3c26613672-post@talk-nabble-com%3e</id>
<updated>2009-12-02T18:13:30Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>

I'm trying to use XMLBeans to process schema instances (that is, actual
schema files).  I've found that XMLBeans seems to have the types baked in to
do this, via org.apache.xmlbeans.impl.xb.xsdschema.SchemaDocument;
SchemaDocument doc = SchemaDocument.Factory.parse(relative);

So that works.  But I'm not finding any javadocs for these classes as they
look like internals that might not have been meant for XMLBeans users.

I need to ask questions of a schema instance such as, "which types are
derived from somepref:FooType"? and to get a list of all elements a schema
defines, with their corresponding types.

Using XMLBeans to process schemas like they were any other document (i.e.
conforming to the XML schema schema) seemed like the way to go.  Is there a
different API I should be checking to do this?

Thanks
-- 
View this message in context: http://old.nabble.com/Processing-schema-instances-tp26613672p26613672.html
Sent from the Xml Beans - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>[Release Candidate] XMLBeans 2.5.0-RC1</title>
<author><name>Cezar Andrei &lt;cezar.andrei@oracle.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/xmlbeans-user/200911.mbox/%3caac9b149-bf65-4d5b-85fe-013484f81b9a@default%3e"/>
<id>urn:uuid:%3caac9b149-bf65-4d5b-85fe-013484f81b9a@default%3e</id>
<updated>2009-11-25T23:24:38Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hello everyone,

 

The first release candidate for XMLBeans 2.5.0 is available at:

http://xmlbeans.apache.org/dist/

 

Please give it a try and let us know if there are any problems with it.

 

Thank you,

Cezar Andrei


</pre>
</div>
</content>
</entry>
<entry>
<title>Couldn't find .class files in the output jar file of SchemaCompiler</title>
<author><name>Kanzhe Jiang &lt;kjiang@cariden.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/xmlbeans-user/200911.mbox/%3c4B0B30FE.8050704@cariden.com%3e"/>
<id>urn:uuid:%3c4B0B30FE-8050704@cariden-com%3e</id>
<updated>2009-11-24T01:03:58Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hi,

I am using the following command in xmlbean 2.4.0 to compile a large 
schema into java objects:
scomp -mx "1536m" -out ~/xmlOut/output.jar -src ~/xmlOut -d ~/xmlOut 
-verbose xmlApi.xsd &gt; build.log 2&gt;&amp;1

xmlApi.xsd includes 300+ other xsd files. The output.jar was created. 
Its size is 95,377,307. The class files are listed in the src direct. 
However, the package is not listed under the jar file when it is 
expanded in eclipse. Only xsb's are listed.

No error was reported in build.log. I used the same command to build the 
easyop.xsd, java objects were listed in the jar output file.

Am I hitting some limit in the schemaCompiler?

Thanks,
kjiang

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>RE: AW: changeType to type with fewer element</title>
<author><name>Cezar Andrei &lt;cezar.andrei@oracle.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/xmlbeans-user/200911.mbox/%3cbd173066-6b3c-4165-b215-028d2fed5ebe@default%3e"/>
<id>urn:uuid:%3cbd173066-6b3c-4165-b215-028d2fed5ebe@default%3e</id>
<updated>2009-11-17T15:36:33Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Oliver,

 

That's the thing, changeType does change the schema type assigned to that node and returns
a new java object of a different class but it doesn't change the structure of the document.
What you're looking for can be done programmatically since all the info is available in the
schema types but to make it work correctly for all the type is no easy job.

 

Cezar 

 

  _____  

From: Oliver Pfau [mailto:Oliver.Pfau@scalaris.com] 
Sent: Tuesday, November 17, 2009 3:55 AM
To: user@xmlbeans.apache.org
Subject: AW: changeType to type with fewer element

 

Hi Cezar,

 

imagine the following: a complex type "Top" is existing and an inherited complex type "Sub"
from "Top" is existing. Sub does extend Top with a string value "Something".

If I do the following:

 

Top topsub = Top.Factory.newInstance();

topsub.changeType(Sub.type);

topsub.setSomething("a value only for sub");

topsub.changeType(Top.type));

boolean isValid = topsub.validate();

 

 

isValid will be false, because topsub is at the end of type Top but the xml output defines
the something element of sub. My expectation is that the changeType(Top.type) will cause that
the something element will be ignored and not unmarshalled to xml and validation.

 

Regards,

Oliver

 

 

 

  _____  

Von: Cezar Andrei [mailto:cezar.andrei@oracle.com] 
Gesendet: Montag, 16. November 2009 21:45
An: user@xmlbeans.apache.org
Betreff: RE: changeType to type with fewer element

Oliver,

 

I'm not sure what is your question, but you have to keep in mind that validation is run only
when validate() method is invoked. 

Especially when it is structure related operations modifying the document don't keep the document
valid. Most of the time a document has to go through a series of invalid states to become
valid again. XMLBeans' user cooperation is required to attain document's validity after modifications.

 

Cezar

 

  _____  

From: Oliver Pfau [mailto:Oliver.Pfau@scalaris.com] 
Sent: Friday, November 13, 2009 7:03 AM
To: user@xmlbeans.apache.org
Subject: changeType to type with fewer element

 

Hi,

 

it seems that XmlBeans is generating invalid xml when I change the type to a type with fewer
elements. There is an example with abstract conrete types on the XmlBeans homepage called
"AbstractTypes". In the file AbstractTypes.java there is this section:

 

...

Circle circle = (Circle) s1.changeType(Circle.type);
circle.setRadius(10.0);

...

 

s1 is a shape (more common). If the type of circle is changed to a more common type, the radius
is nevertheless set for the Shape type. The Validation of the changed circle to a Shape will
fail, because the radius is existing in the xml event though the xsi:type is correct. The
xml and the java representation seems to be here out of sync. Isn't it ? Or is there a trick
?

 

Regards,

Oliver

 


</pre>
</div>
</content>
</entry>
<entry>
<title>RE: ClasscastException - XmlAnyTypeImpl cannot be cast to - Error</title>
<author><name>pattabi &lt;Pattabiraman.Meenakshisundaram@aig.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/xmlbeans-user/200911.mbox/%3c26390786.post@talk.nabble.com%3e"/>
<id>urn:uuid:%3c26390786-post@talk-nabble-com%3e</id>
<updated>2009-11-17T14:21:55Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>

Thank you. Yes the xml input is of different schematype. Mistake was
corrected by using the right schema.


Cezar Andrei-3 wrote:
&gt; 
&gt; I'm not familiar with Spring Marshaller, but it seems that the source is
&gt; not parsed in the schema context you expect.
&gt; 
&gt; Also you can declare your response an XmlObject and use changeType method.
&gt; 
&gt; Cezar
&gt; 
&gt;&gt; -----Original Message-----
&gt;&gt; From: pattabi [mailto:Pattabiraman.Meenakshisundaram@aig.com]
&gt;&gt; Sent: Monday, November 16, 2009 10:55 AM
&gt;&gt; To: user@xmlbeans.apache.org
&gt;&gt; Subject: ClasscastException - XmlAnyTypeImpl cannot be cast to - Error
&gt;&gt; 
&gt;&gt; 
&gt;&gt; Hi,
&gt;&gt; I searched the forum and googled but could not get a solution. hence
&gt;&gt; posting
&gt;&gt; it.
&gt;&gt; 
&gt;&gt; I am using Spring Marshaller with xmlbeans 2.4. In the bean config file,
&gt;&gt; I
&gt;&gt; am just defined the XmlbeansMarshaller with no properties set.
&gt;&gt; 
&gt;&gt; I am accessing it this way:
&gt;&gt; ResDecisionServiceType  response = (ResDecisionServiceType)
&gt;&gt; unmarshaller.unmarshal(source);
&gt;&gt; 
&gt;&gt; and am getting the following error:
&gt;&gt; org.apache.xmlbeans.impl.values.XmlAnyTypeImpl cannot be cast to
&gt;&gt; decisionserviceapp.ResDecisionServiceType.
&gt;&gt; 
&gt;&gt; Please help.
&gt;&gt; Thanks
&gt;&gt; 
&gt;&gt; 
&gt;&gt; --
&gt;&gt; View this message in context: http://old.nabble.com/ClasscastException---
&gt;&gt; XmlAnyTypeImpl-cannot-be-cast-to---Error-tp26375379p26375379.html
&gt;&gt; Sent from the Xml Beans - User mailing list archive at Nabble.com.
&gt;&gt; 
&gt;&gt; 
&gt;&gt; ---------------------------------------------------------------------
&gt;&gt; To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
&gt;&gt; For additional commands, e-mail: user-help@xmlbeans.apache.org
&gt;&gt; 
&gt; 
&gt; ---------------------------------------------------------------------
&gt; To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
&gt; For additional commands, e-mail: user-help@xmlbeans.apache.org
&gt; 
&gt; 
&gt; 

-- 
View this message in context: http://old.nabble.com/ClasscastException---XmlAnyTypeImpl-cannot-be-cast-to---Error-tp26375379p26390786.html
Sent from the Xml Beans - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>AW: changeType to type with fewer element</title>
<author><name>Oliver Pfau &lt;Oliver.Pfau@scalaris.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/xmlbeans-user/200911.mbox/%3cCB6DB87F7DEB9F44BFF0FA033C95B69208439ACFC4@scmailvs.elsag.de%3e"/>
<id>urn:uuid:%3cCB6DB87F7DEB9F44BFF0FA033C95B69208439ACFC4@scmailvs-elsag-de%3e</id>
<updated>2009-11-17T09:55:28Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hi Cezar,

imagine the following: a complex type "Top" is existing and an inherited complex type "Sub"
from "Top" is existing. Sub does extend Top with a string value "Something".
If I do the following:

Top topsub = Top.Factory.newInstance();
topsub.changeType(Sub.type);
topsub.setSomething("a value only for sub");
topsub.changeType(Top.type));
boolean isValid = topsub.validate();


isValid will be false, because topsub is at the end of type Top but the xml output defines
the something element of sub. My expectation is that the changeType(Top.type) will cause that
the something element will be ignored and not unmarshalled to xml and validation.

Regards,
Oliver



________________________________
Von: Cezar Andrei [mailto:cezar.andrei@oracle.com]
Gesendet: Montag, 16. November 2009 21:45
An: user@xmlbeans.apache.org
Betreff: RE: changeType to type with fewer element

Oliver,

I'm not sure what is your question, but you have to keep in mind that validation is run only
when validate() method is invoked.
Especially when it is structure related operations modifying the document don't keep the document
valid. Most of the time a document has to go through a series of invalid states to become
valid again. XMLBeans' user cooperation is required to attain document's validity after modifications.

Cezar

________________________________
From: Oliver Pfau [mailto:Oliver.Pfau@scalaris.com]
Sent: Friday, November 13, 2009 7:03 AM
To: user@xmlbeans.apache.org
Subject: changeType to type with fewer element

Hi,

it seems that XmlBeans is generating invalid xml when I change the type to a type with fewer
elements. There is an example with abstract conrete types on the XmlBeans homepage called
"AbstractTypes". In the file AbstractTypes.java there is this section:

...
Circle circle = (Circle) s1.changeType(Circle.type);
circle.setRadius(10.0);
...

s1 is a shape (more common). If the type of circle is changed to a more common type, the radius
is nevertheless set for the Shape type. The Validation of the changed circle to a Shape will
fail, because the radius is existing in the xml event though the xsi:type is correct. The
xml and the java representation seems to be here out of sync. Isn't it ? Or is there a trick
?

Regards,
Oliver



</pre>
</div>
</content>
</entry>
<entry>
<title>RE: changeType to type with fewer element</title>
<author><name>Cezar Andrei &lt;cezar.andrei@oracle.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/xmlbeans-user/200911.mbox/%3c32958cc8-b08a-4cef-94b3-91d28d2115dc@default%3e"/>
<id>urn:uuid:%3c32958cc8-b08a-4cef-94b3-91d28d2115dc@default%3e</id>
<updated>2009-11-16T20:45:11Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Oliver,

 

I'm not sure what is your question, but you have to keep in mind that validation is run only
when validate() method is invoked. 

Especially when it is structure related operations modifying the document don't keep the document
valid. Most of the time a document has to go through a series of invalid states to become
valid again. XMLBeans' user cooperation is required to attain document's validity after modifications.

 

Cezar

 

  _____  

From: Oliver Pfau [mailto:Oliver.Pfau@scalaris.com] 
Sent: Friday, November 13, 2009 7:03 AM
To: user@xmlbeans.apache.org
Subject: changeType to type with fewer element

 

Hi,

 

it seems that XmlBeans is generating invalid xml when I change the type to a type with fewer
elements. There is an example with abstract conrete types on the XmlBeans homepage called
"AbstractTypes". In the file AbstractTypes.java there is this section:

 

...

Circle circle = (Circle) s1.changeType(Circle.type);
circle.setRadius(10.0);

...

 

s1 is a shape (more common). If the type of circle is changed to a more common type, the radius
is nevertheless set for the Shape type. The Validation of the changed circle to a Shape will
fail, because the radius is existing in the xml event though the xsi:type is correct. The
xml and the java representation seems to be here out of sync. Isn't it ? Or is there a trick
?

 

Regards,

Oliver

 


</pre>
</div>
</content>
</entry>
<entry>
<title>RE: ClasscastException - XmlAnyTypeImpl cannot be cast to - Error</title>
<author><name>Cezar Andrei &lt;cezar.andrei@oracle.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/xmlbeans-user/200911.mbox/%3c0a007250-d463-4ca1-ba8b-148ca1949c01@default%3e"/>
<id>urn:uuid:%3c0a007250-d463-4ca1-ba8b-148ca1949c01@default%3e</id>
<updated>2009-11-16T20:31:33Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
I'm not familiar with Spring Marshaller, but it seems that the source is not parsed in the
schema context you expect.

Also you can declare your response an XmlObject and use changeType method.

Cezar

&gt; -----Original Message-----
&gt; From: pattabi [mailto:Pattabiraman.Meenakshisundaram@aig.com]
&gt; Sent: Monday, November 16, 2009 10:55 AM
&gt; To: user@xmlbeans.apache.org
&gt; Subject: ClasscastException - XmlAnyTypeImpl cannot be cast to - Error
&gt; 
&gt; 
&gt; Hi,
&gt; I searched the forum and googled but could not get a solution. hence
&gt; posting
&gt; it.
&gt; 
&gt; I am using Spring Marshaller with xmlbeans 2.4. In the bean config file, I
&gt; am just defined the XmlbeansMarshaller with no properties set.
&gt; 
&gt; I am accessing it this way:
&gt; ResDecisionServiceType  response = (ResDecisionServiceType)
&gt; unmarshaller.unmarshal(source);
&gt; 
&gt; and am getting the following error:
&gt; org.apache.xmlbeans.impl.values.XmlAnyTypeImpl cannot be cast to
&gt; decisionserviceapp.ResDecisionServiceType.
&gt; 
&gt; Please help.
&gt; Thanks
&gt; 
&gt; 
&gt; --
&gt; View this message in context: http://old.nabble.com/ClasscastException---
&gt; XmlAnyTypeImpl-cannot-be-cast-to---Error-tp26375379p26375379.html
&gt; Sent from the Xml Beans - User mailing list archive at Nabble.com.
&gt; 
&gt; 
&gt; ---------------------------------------------------------------------
&gt; To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
&gt; For additional commands, e-mail: user-help@xmlbeans.apache.org
&gt; 

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>ClasscastException - XmlAnyTypeImpl cannot be cast to - Error</title>
<author><name>pattabi &lt;Pattabiraman.Meenakshisundaram@aig.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/xmlbeans-user/200911.mbox/%3c26375379.post@talk.nabble.com%3e"/>
<id>urn:uuid:%3c26375379-post@talk-nabble-com%3e</id>
<updated>2009-11-16T16:55:08Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>

Hi,
I searched the forum and googled but could not get a solution. hence posting
it.

I am using Spring Marshaller with xmlbeans 2.4. In the bean config file, I
am just defined the XmlbeansMarshaller with no properties set.

I am accessing it this way:
ResDecisionServiceType  response = (ResDecisionServiceType)
unmarshaller.unmarshal(source);

and am getting the following error:
org.apache.xmlbeans.impl.values.XmlAnyTypeImpl cannot be cast to
decisionserviceapp.ResDecisionServiceType. 

Please help.
Thanks


-- 
View this message in context: http://old.nabble.com/ClasscastException---XmlAnyTypeImpl-cannot-be-cast-to---Error-tp26375379p26375379.html
Sent from the Xml Beans - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>changeType to type with fewer element</title>
<author><name>Oliver Pfau &lt;Oliver.Pfau@scalaris.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/xmlbeans-user/200911.mbox/%3cCB6DB87F7DEB9F44BFF0FA033C95B69208439ACEB5@scmailvs.elsag.de%3e"/>
<id>urn:uuid:%3cCB6DB87F7DEB9F44BFF0FA033C95B69208439ACEB5@scmailvs-elsag-de%3e</id>
<updated>2009-11-13T13:03:25Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hi,

it seems that XmlBeans is generating invalid xml when I change the type to a type with fewer
elements. There is an example with abstract conrete types on the XmlBeans homepage called
"AbstractTypes". In the file AbstractTypes.java there is this section:

...
Circle circle = (Circle) s1.changeType(Circle.type);
circle.setRadius(10.0);
...

s1 is a shape (more common). If the type of circle is changed to a more common type, the radius
is nevertheless set for the Shape type. The Validation of the changed circle to a Shape will
fail, because the radius is existing in the xml event though the xsi:type is correct. The
xml and the java representation seems to be here out of sync. Isn't it ? Or is there a trick
?

Regards,
Oliver



</pre>
</div>
</content>
</entry>
<entry>
<title>How to get missing namespace-declaration into derived elements?</title>
<author><name>=?iso-8859-1?Q?Christoph_N=F6lke?= &lt;Christoph.Noelke@scalaris.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/xmlbeans-user/200911.mbox/%3cCB6DB87F7DEB9F44BFF0FA033C95B69208439AC8C3@scmailvs.elsag.de%3e"/>
<id>urn:uuid:%3cCB6DB87F7DEB9F44BFF0FA033C95B69208439AC8C3@scmailvs-elsag-de%3e</id>
<updated>2009-11-03T17:23:52Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hi folks,

I'm using XMLBeans 2.4 and encountered a validation issue because of a missing namespace definition
on element level.

I defined an abstract base type "operator" in "schema.common". In that schema there is another
complex type "master" which contains some elements of type "operator".
In schema "schema.coolops" I defined derivations of that abstract "operator" type using extension.
"schema.coolops" of course imports "schema.common".
(Don't worry about the structure - it's just an excerpt of a complex system ;-))

For adding concrete "operator"s to "master" I coded
  Master.addNewOperator().changeType(schema.coolops.AddOperator.type)
which returns me a concrete "operator" instance.

Upto here all works fine. I can save/load the XML BUT several XML validators (except XMLBeans)
claim
cvc-elt.4.2: Cannot resolve 'cops:AddOperator' to a type definition for element 'Operator'.

The XML looks like this:
&lt;application xsi:schemaLocation="application http://example.org/application.xsd" xmlns="application"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:com="schema.common"&gt;
  &lt;com:master&gt;
    &lt;com:operator xsi:type="cops:AddOperator" xmlns:cops="schema.coolops"&gt;
      ...
    &lt;/com:operator&gt;
  &lt;/com:master&gt;
&lt;/application&gt;

If I add
  xsi:schemaLocation="schema.coolops http://example.org/schema.coolops.xsd"
to the element "com:operator" it is declared to be valid.

Any ideas/hints/... how to get this "schemaLocation" set?

Thanks a lot.
Christoph
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Cannot load SchemaTypeSystem</title>
<author><name>tray2100 &lt;troy_patterson@sdesigns.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/xmlbeans-user/200910.mbox/%3c26079975.post@talk.nabble.com%3e"/>
<id>urn:uuid:%3c26079975-post@talk-nabble-com%3e</id>
<updated>2009-10-27T15:43:43Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>

Hey I was just wondering if you ever resolved this problem .... I have the
same issue. The one thing i've noticed though is that it has something to do
with NetBeans and not ant. I modified the build file initially not
specifying a namespace but later edited the file and added specified a
namespace. when I build the project, the build/classes directory looks fine.
If i run the app from the command line, everything works fine. If I use the
run feature in netbeans, the TypeTypeSystemHolder file disappears from the
schemaorg_apache_xmlbeans folder and a folder called noNamespace is
generated (which was correct when I initially didn't specify a namespace).

Any ideas on how to resolve this problem? 


Wynand Vermeulen wrote:
&gt; 
&gt; Hello,
&gt; 
&gt; I'm trying to get XMLBeans 2.4.0 to work in a standard Netbeans project. I
&gt; have a built.xml file in my project directory, which contains ANT script
&gt; to
&gt; build the XMLBeans source. I get no errors while performing the build,
&gt; but do get a runtime exeception "java.lang.RuntimeException: Cannot load
&gt; SchemaTypeSystem. Unable to load class with name
&gt; schemaorg_apache_xmlbeans.system.sBA558E54E426CCFF39A8E684578DC966.TypeSystemHolder.
&gt; Make sure the generated binary files are on the classpath.".
&gt; 
&gt; I have been finecombing the documentation, and searching the web (and this
&gt; list's archives) for days now and have found several of these types of
&gt; messages reported, and usually the advice is to make sure the
&gt; TypeSystemHolder.class is on the classpath. My ANT script stores the
&gt; generated files in the project's build\classes folder, and directly after
&gt; the build I can see that the class file and xsd files have been generated
&gt; in
&gt; the proper location, however for some strange reason once I run the
&gt; application the TypeSystemHolder.class file disappears and the exception
&gt; occurs!
&gt; 
&gt; I assume that everything in the build\classes folder is part of the
&gt; classpath. If not, how do I add the
&gt; schemaorg_apache_xmlbeans.system.sBA558E54E426CCFF39A8E684578DC966.TypeSystemHolder
&gt; to the classpath in Netbeans? I've tried right clicking on the project,
&gt; and
&gt; adding the folder to the compile and runtime classpaths, and I've tried
&gt; adding it to the classpath in the ANT script together with xbean.jar, but
&gt; as
&gt; then the compiler complains that the directory does not exist (since it
&gt; has
&gt; not yet been built).
&gt; 
&gt; The ANT Script I use (based on tutorial at
&gt; http://lajavaloca.wordpress.com/2008/05/26/xmlbeans-with-netbeans-thats-a-lot-of-beans/
&gt; ):
&gt; 
&gt;      &lt;taskdef name="xmlbean"
&gt;         classname="org.apache.xmlbeans.impl.tool.XMLBean"
&gt;         classpath="../3rd Party/xmlbeans-2.4.0/lib/jsr173.jar: ../3rd
&gt; Party/xmlbeans-2.4.0/lib/xbean.jar" /&gt;
&gt;     &lt;target name="-pre-compile"&gt;
&gt;         &lt;antcall target="gen-schema2"/&gt;
&gt;     &lt;/target&gt;
&gt;     &lt;target name="gen-schema"&gt;
&gt;         &lt;xmlbean srconly="true"
&gt;             verbose="true"
&gt;             srcgendir="src"
&gt;             classgendir="build/classes"
&gt;             download="true"
&gt;             destfile="DeviceListXmlTypes.jar"
&gt;             schema="./src/CardWizard/resources/config/DeviceList.xsd"/&gt;
&gt;     &lt;/target&gt;
&gt; 
&gt; Please help, I really need to get XMLBeans working asap.
&gt; 
&gt; Kind Regards
&gt; Wynand
&gt; 
&gt; 

-- 
View this message in context: http://www.nabble.com/Cannot-load-SchemaTypeSystem-tp25423415p26079975.html
Sent from the Xml Beans - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Output dateTime in canonical form</title>
<author><name>Anirban Mukherjee &lt;amukherj@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/xmlbeans-user/200910.mbox/%3c22c9d3e80910260338t5dd6c427vbe5496a553f8d57a@mail.gmail.com%3e"/>
<id>urn:uuid:%3c22c9d3e80910260338t5dd6c427vbe5496a553f8d57a@mail-gmail-com%3e</id>
<updated>2009-10-26T10:38:29Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Thanks Cezar. I was able to generate the necessary output using GDateBuilder.

Anirban

On Sat, Oct 10, 2009 at 2:32 AM, Cezar Andrei &lt;cezar.andrei@oracle.com&gt; wrote:
&gt; Anirban,
&gt;
&gt;
&gt;
&gt; Did you look at GDateBuilder, specifically at using normalizeToTimeZone
&gt; methods?
&gt;
&gt;
&gt;
&gt; Cezar
&gt;
&gt;
&gt;
&gt; ________________________________
&gt;
&gt; From: Anirban Mukherjee [mailto:amukherj@gmail.com]
&gt; Sent: Saturday, September 12, 2009 3:12 PM
&gt; To: user@xmlbeans.apache.org
&gt; Subject: Output dateTime in canonical form
&gt;
&gt;
&gt;
&gt; I wish to generate xml output where xs:dateTime values will be generated in
&gt; the canonical form rather than the natural form
&gt;
&gt; e.g. instead of 2009-10-13T01:11:17+05:30, I need 2009-10-12T19:41:17Z
&gt; (converted to UTC with Z indicating that it is UTC)
&gt;
&gt; Is there a straightforward way to achieve this ?
&gt;
&gt; The GDate class has a canonicalString() method that produces the form I
&gt; need, but the toString() produces the natural form.
&gt;
&gt; Note: If input xml contains dateTime values in the canonical form, they are
&gt; processed properly.
&gt;
&gt; As an experiment, I tried to inherit a subclass from GDate with the intent
&gt; of overriding toString() to invoke super.canonicalString() but the GDate
&gt; class is final and hence cannot be extended.
&gt; But even that would probably not have worked as the XmlDateTime would
&gt; probably not care about the canonical form. Refer below...
&gt; [
&gt; GDate gdt = new GDate(cal);
&gt; XmlDateTime dt = XmlDateTime.Factory.newInstance();
&gt; dt.setGDateValue(gdt);
&gt; sig.xsetExpirationDateTime(dt);
&gt; ...
&gt; ...
&gt; doc.save...
&gt; ]
&gt;
&gt; Any help would be appreciated.
&gt;
&gt;
&gt; Thanks,
&gt; Anirban

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>RE: XML-BEANS compiled schema: Incompatible minor version - expecting up to 23, got 24</title>
<author><name>Wing Yew Poon &lt;wing.yew.poon@oracle.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/xmlbeans-user/200910.mbox/%3cc9de60ec-4bb3-45c1-9fbf-a7d89c95c602@default%3e"/>
<id>urn:uuid:%3cc9de60ec-4bb3-45c1-9fbf-a7d89c95c602@default%3e</id>
<updated>2009-10-23T18:25:24Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Well, the error message is pretty clear.
The xmlbeans your runtime is using has an earlier version than
the version of xmlbeans used to compile your schema.
You can use schema jars compiled with older versions of xmlbeans 
than your runtime, but not with newer. The situation is analogous
to that of java classes and the jdk.
Clearly, weblogic 9x shipped with a version of xmlbeans that is
earlier than 2.4. Consult your weblogic documentation or experts
on how to use a different version of apache xmlbeans than is shipped
with the product. (Weblogic also uses a com.bea-repackaged version
of xmlbeans internally; you should not replace this xmlbeans.)
- Wing Yew

-----Original Message-----
From: jh10a957 [mailto:rakeshkumar.singh@gmail.com] 
Sent: Friday, October 23, 2009 11:02 AM
To: user@xmlbeans.apache.org
Subject: XML-BEANS compiled schema: Incompatible minor version - expecting up to 23, got 24


I was using xmlbean2.2 and upgraded to xmlbean2.4. Compilation of schema jars
are fine but while deploying in Weblogic 9.2 I am getting the exception as
below.
Anyone else facing the same issue?

Caused by: java.lang.RuntimeException: Could not instantiate
SchemaTypeSystemImpl (java.lang.reflect.InvocationTargetException): is the
version of xbean.jar correct?
at
schemaorg_apache_xmlbeans.system.sD10023A5BF0E00636EB8A1FCB541F982.TypeSystemHolder.loadTypeSystem(Unknown
Source)
at
schemaorg_apache_xmlbeans.system.sD10023A5BF0E00636EB8A1FCB541F982.TypeSystemHolder.&lt;clinit&gt;(Unknown
Source)
... 43 more
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
... 45 more
Caused by: org.apache.xmlbeans.SchemaTypeLoaderException: XML-BEANS compiled
schema: Incompatible minor version - expecting up to 23, got 24
(schemaorg_apache_xmlbeans.system.sD10023A5BF0E00636EB8A1FCB541F982.index) -
code 3
at
org.apache.xmlbeans.impl.schema.SchemaTypeSystemImpl$XsbReader.&lt;init&gt;(SchemaTypeSystemImpl.java:1522)
at
org.apache.xmlbeans.impl.schema.SchemaTypeSystemImpl.initFromHeader(SchemaTypeSystemImpl.java:260)
at
org.apache.xmlbeans.impl.schema.SchemaTypeSystemImpl.&lt;init&gt;(SchemaTypeSystemImpl.java:183)
... 49 more^^ 
 
 


-- 
View this message in context: http://www.nabble.com/XML-BEANS-compiled-schema%3A-Incompatible-minor-version---expecting-up-to-23%2C-got-24-tp26030820p26030820.html
Sent from the Xml Beans - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>XML-BEANS compiled schema: Incompatible minor version - expecting up to 23, got 24</title>
<author><name>jh10a957 &lt;rakeshkumar.singh@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/xmlbeans-user/200910.mbox/%3c26030820.post@talk.nabble.com%3e"/>
<id>urn:uuid:%3c26030820-post@talk-nabble-com%3e</id>
<updated>2009-10-23T18:02:03Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>

I was using xmlbean2.2 and upgraded to xmlbean2.4. Compilation of schema jars
are fine but while deploying in Weblogic 9.2 I am getting the exception as
below.
Anyone else facing the same issue?

Caused by: java.lang.RuntimeException: Could not instantiate
SchemaTypeSystemImpl (java.lang.reflect.InvocationTargetException): is the
version of xbean.jar correct?
at
schemaorg_apache_xmlbeans.system.sD10023A5BF0E00636EB8A1FCB541F982.TypeSystemHolder.loadTypeSystem(Unknown
Source)
at
schemaorg_apache_xmlbeans.system.sD10023A5BF0E00636EB8A1FCB541F982.TypeSystemHolder.&lt;clinit&gt;(Unknown
Source)
... 43 more
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
... 45 more
Caused by: org.apache.xmlbeans.SchemaTypeLoaderException: XML-BEANS compiled
schema: Incompatible minor version - expecting up to 23, got 24
(schemaorg_apache_xmlbeans.system.sD10023A5BF0E00636EB8A1FCB541F982.index) -
code 3
at
org.apache.xmlbeans.impl.schema.SchemaTypeSystemImpl$XsbReader.&lt;init&gt;(SchemaTypeSystemImpl.java:1522)
at
org.apache.xmlbeans.impl.schema.SchemaTypeSystemImpl.initFromHeader(SchemaTypeSystemImpl.java:260)
at
org.apache.xmlbeans.impl.schema.SchemaTypeSystemImpl.&lt;init&gt;(SchemaTypeSystemImpl.java:183)
... 49 more^^ 
 
 


-- 
View this message in context: http://www.nabble.com/XML-BEANS-compiled-schema%3A-Incompatible-minor-version---expecting-up-to-23%2C-got-24-tp26030820p26030820.html
Sent from the Xml Beans - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>SchemaTypeLoader.getSourceAsStream(source);  runs into java.lang.NullPointerException</title>
<author><name>Murali Pottlapelli &lt;Murali.Pottlapelli@Sun.COM&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/xmlbeans-user/200910.mbox/%3c4ADD6A44.6000702@sun.com%3e"/>
<id>urn:uuid:%3c4ADD6A44-6000702@sun-com%3e</id>
<updated>2009-10-20T07:44:04Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Content-type: multipart/alternative;
 boundary="Boundary_(ID_Ls0mY350v37mNlWrIMRkZg)"


--Boundary_(ID_Ls0mY350v37mNlWrIMRkZg)
Content-type: text/plain; CHARSET=US-ASCII; format=flowed
Content-transfer-encoding: 7BIT

Hi,
I am running into java.lang.NullPointerException in the following 
snippet at getSourceAsStream(source);

        //get SchemaType for element 
        SchemaGlobalElement element = 
typeLoader.findElement(QName.valueOf("{http://xml.netbeans.org/schema/Synchronous}typeA"));
        //confirm element
        System.out.println( 
"{http://xml.netbeans.org/schema/Synchronous}typeA is:" + 
element.getName() );
        System.out.println("\t \t" + "  -- details  ns: " + 
element.getName().getNamespaceURI()
                + "  prefix: " + element.getName().getPrefix() + "  
local name: " + element.getName().getLocalPart());
        SchemaType st = element.getType();

        // get the name of the schema source file
        // Not sure, is it working right?
        //schema source doc queried: 
URI_SHA_1_E8BB73591F25D088F33651C66E86AE1809406E4B/Synchronous.xsd
        //vs original: 
file:/C:/tmp/mvnprojects/schemaParser/target/classes/resources/Synchronous.xsd
        String source = st.getSourceName();
        System.out.println("schema source doc queried: " + source + " vs 
original: " + url);

        SchemaTypeLoader stl = st.getTypeSystem();
        java.io.InputStream is =  stl.getSourceAsStream(source);

I am attaching the Java program and maven project to reproduce the 
issue. Is this an user error? or an issue?

To build and run the test case

   1. unzip attached zip file
   2. move to the root folder
   3. mvn clean assembly:assembly
   4. java -cp
      target\schemaParser-1.0-SNAPSHOT-jar-with-dependencies.jar myTest.App

Regards
Murali

--Boundary_(ID_Ls0mY350v37mNlWrIMRkZg)
Content-type: text/html; CHARSET=US-ASCII
Content-transfer-encoding: 7BIT

&lt;!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"&gt;
&lt;html&gt;
&lt;head&gt;
&lt;/head&gt;
&lt;body bgcolor="#ffffff" text="#000000"&gt;
Hi,&lt;br&gt;
I am running into java.lang.NullPointerException in the following
snippet at getSourceAsStream(source); &lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //get SchemaType for
element&amp;nbsp; &lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SchemaGlobalElement
element =
typeLoader.findElement(QName.valueOf("{&lt;a class="moz-txt-link-freetext" href="http://xml.netbeans.org/schema/Synchronous"&gt;http://xml.netbeans.org/schema/Synchronous&lt;/a&gt;}typeA"));&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //confirm element&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.out.println(
"{&lt;a class="moz-txt-link-freetext" href="http://xml.netbeans.org/schema/Synchronous"&gt;http://xml.netbeans.org/schema/Synchronous&lt;/a&gt;}typeA
is:" +
element.getName() );&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; System.out.println("\t \t" +
"&amp;nbsp; -- details&amp;nbsp; ns: " +
element.getName().getNamespaceURI() &lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp; + "&amp;nbsp; prefix: " + element.getName().getPrefix() + "&amp;nbsp;
local name: " + element.getName().getLocalPart());&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SchemaType st = element.getType();&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // get the name of
the schema source file &lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Not sure, is it
working right? &lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //schema source doc
queried:
URI_SHA_1_E8BB73591F25D088F33651C66E86AE1809406E4B/Synchronous.xsd &lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //vs original:
&lt;a class="moz-txt-link-freetext" href="file:/C:/tmp/mvnprojects/schemaParser/target/classes/resources/Synchronous.xsd"&gt;file:/C:/tmp/mvnprojects/schemaParser/target/classes/resources/Synchronous.xsd&lt;/a&gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; String source = st.getSourceName();
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.out.println("schema
source doc queried: " + source + "
vs original: " + url);&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SchemaTypeLoader stl
= st.getTypeSystem();&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; java.io.InputStream
is =&amp;nbsp; stl.getSourceAsStream(source); &lt;br&gt;
&lt;br&gt;
I am attaching the Java program and maven project to reproduce the
issue. Is this an user error? or an issue?&lt;br&gt;
&lt;br&gt;
To build and run the test case &lt;br&gt;
&lt;ol&gt;
  &lt;li&gt;unzip attached zip file&lt;/li&gt;
  &lt;li&gt;move to the root folder&lt;br&gt;
  &lt;/li&gt;
  &lt;li&gt;mvn clean assembly:assembly&lt;br&gt;
  &lt;/li&gt;
  &lt;li&gt;java -cp
target\schemaParser-1.0-SNAPSHOT-jar-with-dependencies.jar myTest.App&lt;br&gt;
  &lt;/li&gt;
&lt;/ol&gt;
Regards&lt;br&gt;
Murali&lt;br&gt;
&lt;/body&gt;
&lt;/html&gt;

--Boundary_(ID_Ls0mY350v37mNlWrIMRkZg)--


</pre>
</div>
</content>
</entry>
<entry>
<title>regarding xmlbeans threadsafety</title>
<author><name>Jorg Heymans &lt;jorg.heymans@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/xmlbeans-user/200910.mbox/%3c132770720910160214o30d0796p1e09deeb5135e4c0@mail.gmail.com%3e"/>
<id>urn:uuid:%3c132770720910160214o30d0796p1e09deeb5135e4c0@mail-gmail-com%3e</id>
<updated>2009-10-16T09:14:45Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hi,

I am having some threadsafety issues with testng tests run in parallel
mode. The tests involve connecting to a webservice using spring-ws
configured with xmlbeans marshalling. After reading [1], i was
wondering if the thread safety issue could apply to my case. I will
try to explain with a small block of code that does the webservice
call

    Object o1 = null;
    GetPaymentDocumentDocument1 requestDocument = null;
    try {
        requestDocument = GetPaymentDocumentDocument1.Factory.newInstance();
        requestDocument.addNewGetPaymentDocument();
        GetPaymentDocumentRequest request =
GetPaymentDocumentRequest.Factory.newInstance();
        requestDocument.getGetPaymentDocument().setRequest(request);
        o1 = PaymentWebService.marshalSendAndReceive(requestDocument);
        // POTENTIAL CCE BELOW
        GetPaymentDocumentResponseDocument responseDocument =
(GetPaymentDocumentResponseDocument) o1;
        return responseDocument.getGetPaymentDocumentResponse().getDocument();
    } catch (ClassCastException cce) {
        throw new RuntimeException(
                 (o == null ? "NULL" : o.getClass() + "___" +
o.getClass().getClassLoader()) + "&gt;&gt;&gt;&gt;"
                +
GetPaymentDocumentResponseDocument.class.getClassLoader() + "&gt;&gt;&gt;&gt;&gt;&gt;\n"
+ o, cce);
    }

In normal non-parallel testing, this code never fails. Recently
however i switched the tests to be run in parallel through TestNG's
parallel=methods feature, meaning that a thread pool is assigned to
execute methods from the test class concurrently.

Since then, the above block of code randomly throws CCE's when i try
to cast the object returned from the webservice to the
"GetPaymentDocumentResponseDocument". After doing some research i
found that o1 as returned from the webservice in these cases is
actually an instance of GetPaymentDocumentDocument1 (ie the request
document) !

Could this problem be related to XmlBeans ? Following [1] I built
xmlbeans myself from source a few weeks ago but that didn't change
anything. Any thoughts would be greatly appreciated. I tried to narrow
things down to a small testcase but i could never consistently
reproduce it.

Thanks !
Jorg

[1] http://www.mail-archive.com/user@xmlbeans.apache.org/msg03818.html

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>Force the default namespace of an XML fragment</title>
<author><name>Pascal Maugeri &lt;pascal.maugeri@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/xmlbeans-user/200910.mbox/%3c990aed650910150731n107a8b63ta136bc54829e4fd4@mail.gmail.com%3e"/>
<id>urn:uuid:%3c990aed650910150731n107a8b63ta136bc54829e4fd4@mail-gmail-com%3e</id>
<updated>2009-10-15T14:31:57Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hi

I'm writing a method to set the default namespace of a given XML fragment:

    public static XmlObject setDefaultNamespace(XmlObject xmlFragment,
String namespace) {

        XmlCursor eltCursor = xmlFragment.newCursor();
        if (eltCursor.currentTokenType().isStartdoc())
            eltCursor.toNextToken();

        String defaultNs = eltCursor.namespaceForPrefix("");
        if (defaultNs == null || defaultNs.length() == 0) {
            System.out.println("No default namespace detected!");
            eltCursor.insertNamespace("", namespace);
        }

        eltCursor.dispose();
        return xmlFragment;
    }

The call to "eltCursor.insertNamespace("", namespace);" does not work, it
doesn't set the default namespace in the result returned. I observed that it
works only when the prefix is set (eg. eltCursor.insertNamespace("pre",
namespace);).

What am I doing wrong ?

Thanks in advance for any help
Pascal


</pre>
</div>
</content>
</entry>
<entry>
<title>RE: Output dateTime in canonical form</title>
<author><name>Cezar Andrei &lt;cezar.andrei@oracle.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/xmlbeans-user/200910.mbox/%3c07fca9e3-687e-4716-9971-30061dbbe8cb@default%3e"/>
<id>urn:uuid:%3c07fca9e3-687e-4716-9971-30061dbbe8cb@default%3e</id>
<updated>2009-10-09T21:02:32Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Anirban,

 

Did you look at GDateBuilder, specifically at using normalizeToTimeZone methods?

 

Cezar

 

  _____  

From: Anirban Mukherjee [mailto:amukherj@gmail.com] 
Sent: Saturday, September 12, 2009 3:12 PM
To: user@xmlbeans.apache.org
Subject: Output dateTime in canonical form

 

I wish to generate xml output where xs:dateTime values will be generated in the canonical
form rather than the natural form 

e.g. instead of 2009-10-13T01:11:17+05:30, I need 2009-10-12T19:41:17Z (converted to UTC with
Z indicating that it is UTC)

Is there a straightforward way to achieve this ?

The GDate class has a canonicalString() method that produces the form I need, but the toString()
produces the natural form. 

Note: If input xml contains dateTime values in the canonical form, they are processed properly.

As an experiment, I tried to inherit a subclass from GDate with the intent of overriding toString()
to invoke super.canonicalString() but the GDate class is final and hence cannot be extended.

But even that would probably not have worked as the XmlDateTime would probably not care about
the canonical form. Refer below...
[
GDate gdt = new GDate(cal);
XmlDateTime dt = XmlDateTime.Factory.newInstance();
dt.setGDateValue(gdt);
sig.xsetExpirationDateTime(dt);
...
...
doc.save...
]

Any help would be appreciated.


Thanks,
Anirban


</pre>
</div>
</content>
</entry>
<entry>
<title>AW: SchemaTypeLoader problems in Equinox (OSGi): A solution</title>
<author><name>Oliver Pfau &lt;Oliver.Pfau@scalaris.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/xmlbeans-user/200910.mbox/%3cCB6DB87F7DEB9F44BFF0FA033C95B69208437CE028@scmailvs.elsag.de%3e"/>
<id>urn:uuid:%3cCB6DB87F7DEB9F44BFF0FA033C95B69208437CE028@scmailvs-elsag-de%3e</id>
<updated>2009-10-07T07:00:40Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hi Mike,

yesterday tried to solve exactly this problem. With your description it works. Thanks a lot.

Regards,
Oliver

 

-----Ursprüngliche Nachricht-----
Von: Michael Furtak [mailto:mfurtak@cra.com] 
Gesendet: Dienstag, 6. Oktober 2009 21:33
An: user@xmlbeans.apache.org
Betreff: SchemaTypeLoader problems in Equinox (OSGi): A solution

Hi, all. This is my first message to the mailing list, so I apologize if I am stating some
very old news.


Recently I have been encountering some classloading problems when using XMLBeans in an OSGi
environment (Equinox), and I have seen some other users with similar issues [1, 2]. The common
symptom was that xsi:type information could neither be generated, nor interpreted while running
in an OSGi environment.

To my understanding, the use of the Thread Context ClassLoader, within the SchemaTypeLoader
[3] needs some extra help to work properly within an OSGi environment. Equinox provides this
help in the form of "Buddy Class Loading" (unfortunately, this is *not* part of the OSGi spec,
making it an Equinox specific fix) [4].

By marking the XMLBeans bundle with an Eclipse-BuddyPolicy header in its manifest, and the
compiled schema bundle with an Eclipse-RegisterBuddy header in its manifest, Equinox is able
to bridge the classloading gap between the core XMLBeans jar and your compiled schema classes.


Assuming that my XMLBeans bundle has:

Bundle-SymbolicName: org.apache.xmlbeans


I would include in that XMLBeans bundle manifest the line:

Eclipse-BuddyPolicy: registered


I would then alter my scomp'd schema classes bundle manifest to include:

Eclipse-RegisterBuddy: org.apache.xmlbeans


After doing this, my problems are resolved. I hope this can help someone else, and was not
incredibly old news.


Regards,
-Mike Furtak


1)
http://markmail.org/message/vx2vdg7yhb4l3ej6#query:+page:1+mid:vx2vdg7yh
b4l3ej6+state:results

2)
http://mail-archives.apache.org/mod_mbox/ws-axis-user/200701.mbox/%3C8d2
a81130701171341p55f95b70o7f144ea7d941639a@mail.gmail.com%3E

3)
http://grepcode.com/file/repo1.maven.org$maven2@org.apache.xmlbeans$xmlb
eans@2.4.0@org$apache$xmlbeans$impl$schema$SchemaTypeLoaderImpl.java#Sch
emaTypeLoaderImpl.getContextTypeLoader%28%29

4)
http://wiki.eclipse.org/index.php/Context_Class_Loader_Enhancements#Ecli
pse-BuddyPolicy_Header
 
 
 
 
THIS MESSAGE IS INTENDED FOR THE USE OF THE PERSON TO WHOM IT IS ADDRESSED. IT MAY CONTAIN
INFORMATION THAT IS PRIVILEGED, CONFIDENTIAL AND EXEMPT FROM DISCLOSURE UNDER APPLICABLE LAW.
If you are not the intended recipient, your use of this message for any purpose is strictly
prohibited. If you have received this communication in error, please delete the message and
notify the sender so that we may correct our records.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: SchemaTypeLoader problems in Equinox (OSGi): A solution</title>
<author><name>Jacob Danner &lt;jacob.danner@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/xmlbeans-user/200910.mbox/%3cbb04eb0a0910061559j732b51c7h473fa634a73f6d1@mail.gmail.com%3e"/>
<id>urn:uuid:%3cbb04eb0a0910061559j732b51c7h473fa634a73f6d1@mail-gmail-com%3e</id>
<updated>2009-10-06T22:59:19Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Thanks Mike!
I'll add this to the FAQs when I get a chance.
-jacobd

On Tue, Oct 6, 2009 at 12:33 PM, Michael Furtak &lt;mfurtak@cra.com&gt; wrote:

&gt; Hi, all. This is my first message to the mailing list, so I apologize if
&gt; I am stating some very old news.
&gt;
&gt;
&gt; Recently I have been encountering some classloading problems when using
&gt; XMLBeans in an OSGi environment (Equinox), and I have seen some other
&gt; users with similar issues [1, 2]. The common symptom was that xsi:type
&gt; information could neither be generated, nor interpreted while running in
&gt; an OSGi environment.
&gt;
&gt; To my understanding, the use of the Thread Context ClassLoader, within
&gt; the SchemaTypeLoader [3] needs some extra help to work properly within
&gt; an OSGi environment. Equinox provides this help in the form of "Buddy
&gt; Class Loading" (unfortunately, this is *not* part of the OSGi spec,
&gt; making it an Equinox specific fix) [4].
&gt;
&gt; By marking the XMLBeans bundle with an Eclipse-BuddyPolicy header in its
&gt; manifest, and the compiled schema bundle with an Eclipse-RegisterBuddy
&gt; header in its manifest, Equinox is able to bridge the classloading gap
&gt; between the core XMLBeans jar and your compiled schema classes.
&gt;
&gt;
&gt; Assuming that my XMLBeans bundle has:
&gt;
&gt; Bundle-SymbolicName: org.apache.xmlbeans
&gt;
&gt;
&gt; I would include in that XMLBeans bundle manifest the line:
&gt;
&gt; Eclipse-BuddyPolicy: registered
&gt;
&gt;
&gt; I would then alter my scomp'd schema classes bundle manifest to include:
&gt;
&gt; Eclipse-RegisterBuddy: org.apache.xmlbeans
&gt;
&gt;
&gt; After doing this, my problems are resolved. I hope this can help someone
&gt; else, and was not incredibly old news.
&gt;
&gt;
&gt; Regards,
&gt; -Mike Furtak
&gt;
&gt;
&gt; 1)
&gt; http://markmail.org/message/vx2vdg7yhb4l3ej6#query:+page:1+mid:vx2vdg7yh
&gt; b4l3ej6+state:results&lt;http://markmail.org/message/vx2vdg7yhb4l3ej6#query:+page:1+mid:vx2vdg7yh%0Ab4l3ej6+state:results&gt;
&gt;
&gt; 2)
&gt; http://mail-archives.apache.org/mod_mbox/ws-axis-user/200701.mbox/%3C8d2
&gt; a81130701171341p55f95b70o7f144ea7d941639a@mail.gmail.com%3E
&gt;
&gt; 3)
&gt; http://grepcode.com/file/repo1.maven.org$maven2@org.apache.xmlbeans$xmlb
&gt; eans@2.4.0@org$apache$xmlbeans$impl$schema$SchemaTypeLoaderImpl.java#Sch
&gt; emaTypeLoaderImpl.getContextTypeLoader%28%29
&gt;
&gt; 4)
&gt; http://wiki.eclipse.org/index.php/Context_Class_Loader_Enhancements#Ecli
&gt; pse-BuddyPolicy_Header&lt;http://wiki.eclipse.org/index.php/Context_Class_Loader_Enhancements#Ecli%0Apse-BuddyPolicy_Header&gt;
&gt;
&gt;
&gt;
&gt;
&gt; THIS MESSAGE IS INTENDED FOR THE USE OF THE PERSON TO WHOM IT IS ADDRESSED.
&gt; IT MAY CONTAIN INFORMATION THAT IS PRIVILEGED, CONFIDENTIAL AND EXEMPT FROM
&gt; DISCLOSURE UNDER APPLICABLE LAW. If you are not the intended recipient, your
&gt; use of this message for any purpose is strictly prohibited. If you have
&gt; received this communication in error, please delete the message and notify
&gt; the sender so that we may correct our records.
&gt;
&gt; ---------------------------------------------------------------------
&gt; To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
&gt; For additional commands, e-mail: user-help@xmlbeans.apache.org
&gt;
&gt;


</pre>
</div>
</content>
</entry>
<entry>
<title>SchemaTypeLoader problems in Equinox (OSGi): A solution</title>
<author><name>&quot;Michael Furtak&quot; &lt;mfurtak@cra.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/xmlbeans-user/200910.mbox/%3c2F740099AD5F8E4BA876BC6580B16D48019686D8@server2.cra.lan%3e"/>
<id>urn:uuid:%3c2F740099AD5F8E4BA876BC6580B16D48019686D8@server2-cra-lan%3e</id>
<updated>2009-10-06T19:33:20Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hi, all. This is my first message to the mailing list, so I apologize if
I am stating some very old news.


Recently I have been encountering some classloading problems when using
XMLBeans in an OSGi environment (Equinox), and I have seen some other
users with similar issues [1, 2]. The common symptom was that xsi:type
information could neither be generated, nor interpreted while running in
an OSGi environment.

To my understanding, the use of the Thread Context ClassLoader, within
the SchemaTypeLoader [3] needs some extra help to work properly within
an OSGi environment. Equinox provides this help in the form of "Buddy
Class Loading" (unfortunately, this is *not* part of the OSGi spec,
making it an Equinox specific fix) [4].

By marking the XMLBeans bundle with an Eclipse-BuddyPolicy header in its
manifest, and the compiled schema bundle with an Eclipse-RegisterBuddy
header in its manifest, Equinox is able to bridge the classloading gap
between the core XMLBeans jar and your compiled schema classes.


Assuming that my XMLBeans bundle has:

Bundle-SymbolicName: org.apache.xmlbeans


I would include in that XMLBeans bundle manifest the line:

Eclipse-BuddyPolicy: registered


I would then alter my scomp'd schema classes bundle manifest to include:

Eclipse-RegisterBuddy: org.apache.xmlbeans


After doing this, my problems are resolved. I hope this can help someone
else, and was not incredibly old news.


Regards,
-Mike Furtak


1)
http://markmail.org/message/vx2vdg7yhb4l3ej6#query:+page:1+mid:vx2vdg7yh
b4l3ej6+state:results

2)
http://mail-archives.apache.org/mod_mbox/ws-axis-user/200701.mbox/%3C8d2
a81130701171341p55f95b70o7f144ea7d941639a@mail.gmail.com%3E

3)
http://grepcode.com/file/repo1.maven.org$maven2@org.apache.xmlbeans$xmlb
eans@2.4.0@org$apache$xmlbeans$impl$schema$SchemaTypeLoaderImpl.java#Sch
emaTypeLoaderImpl.getContextTypeLoader%28%29

4)
http://wiki.eclipse.org/index.php/Context_Class_Loader_Enhancements#Ecli
pse-BuddyPolicy_Header
 
 
 
 
THIS MESSAGE IS INTENDED FOR THE USE OF THE PERSON TO WHOM IT IS ADDRESSED. IT MAY CONTAIN
INFORMATION THAT IS PRIVILEGED, CONFIDENTIAL AND EXEMPT FROM DISCLOSURE UNDER APPLICABLE LAW.
If you are not the intended recipient, your use of this message for any purpose is strictly
prohibited. If you have received this communication in error, please delete the message and
notify the sender so that we may correct our records.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>AW: Inheritance problem, instance gets always super type</title>
<author><name>Oliver Pfau &lt;Oliver.Pfau@scalaris.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/xmlbeans-user/200910.mbox/%3cCB6DB87F7DEB9F44BFF0FA033C95B69208437CDFF7@scmailvs.elsag.de%3e"/>
<id>urn:uuid:%3cCB6DB87F7DEB9F44BFF0FA033C95B69208437CDFF7@scmailvs-elsag-de%3e</id>
<updated>2009-10-06T15:00:01Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hi,

I figured out that the problem is not in the xsd definitions. In the main method of a test
class all works. In my application no more. I assume it is because it is an osgi application.
Someone an idea what I can do ?

Regards
Oliver



-----Ursprüngliche Nachricht-----
Von: Oliver Pfau 
Gesendet: Dienstag, 6. Oktober 2009 10:31
An: 'user@xmlbeans.apache.org'
Betreff: Inheritance problem, instance gets always super type

 Hi , instance gets always super type


Hi,
 
I have a problem using xmlbeans with inherited types with java. In my commons.xsd there is
a complex type Operation and some other types which are extending Operation. In a MoreSpecifix.xsd
is commons.xsd imported and a complex type Config is declared. This type Config does declare
a sequence of Operation. So it should be possible to add all types which extend Operation
to the sequence in Config.
 
After the generation of the java classes I run into the following problems:
 
First try:
final ConfigDocument configDocument = ConfigDocument.Factory.newInstance();
final Config newConfig = configDocument.addNewConfig();

final Operation[] ops = new OperationType[1];

ops[0] = createConcreteOperationDummy();

newConfig.setOperationArray(ops);

With the last line my concrete operation instance gets the type from the super class Operation
and I can no more access the extended fields.

Second try:

final ConfigDocument configDocument = ConfigDocument.Factory.newInstance();

final Config newConfig = configDocument.addNewConfig();

final Operation newOperation = newConfig.addNewOperation();

final ConcreteOperation concreteOp = (ConcreteOperation) newOperation.changeType(ConcreteOperation.type);

On the last line I get a ClassCastException. 

Has someone an idea what is wrong ? Probably the xsd definitions (made with XMLSpy) ?

Regards,

Oliver


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>Inheritance problem, instance gets always super type</title>
<author><name>Oliver Pfau &lt;Oliver.Pfau@scalaris.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/xmlbeans-user/200910.mbox/%3cCB6DB87F7DEB9F44BFF0FA033C95B69208437CDF7A@scmailvs.elsag.de%3e"/>
<id>urn:uuid:%3cCB6DB87F7DEB9F44BFF0FA033C95B69208437CDF7A@scmailvs-elsag-de%3e</id>
<updated>2009-10-06T08:31:14Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
 Hi , instance gets always super type


Hi,
 
I have a problem using xmlbeans with inherited types with java. In my commons.xsd there is
a complex type Operation and some other types which are extending Operation. In a MoreSpecifix.xsd
is commons.xsd imported and a complex type Config is declared. This type Config does declare
a sequence of Operation. So it should be possible to add all types which extend Operation
to the sequence in Config.
 
After the generation of the java classes I run into the following problems:
 
First try:
final ConfigDocument configDocument = ConfigDocument.Factory.newInstance();
final Config newConfig = configDocument.addNewConfig();

final Operation[] ops = new OperationType[1];

ops[0] = createConcreteOperationDummy();

newConfig.setOperationArray(ops);

With the last line my concrete operation instance gets the type from the super class Operation
and I can no more access the extended fields.

Second try:

final ConfigDocument configDocument = ConfigDocument.Factory.newInstance();

final Config newConfig = configDocument.addNewConfig();

final Operation newOperation = newConfig.addNewOperation();

final ConcreteOperation concreteOp = (ConcreteOperation) newOperation.changeType(ConcreteOperation.type);

On the last line I get a ClassCastException. 

Has someone an idea what is wrong ? Probably the xsd definitions (made with XMLSpy) ?

Regards,

Oliver


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>Inserting an XML element into an XML doc, issue with default	namespace</title>
<author><name>Pascal Maugeri &lt;pascal.maugeri@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/xmlbeans-user/200910.mbox/%3c990aed650910050536w3ada9293icd73a91b3a8abcbd@mail.gmail.com%3e"/>
<id>urn:uuid:%3c990aed650910050536w3ada9293icd73a91b3a8abcbd@mail-gmail-com%3e</id>
<updated>2009-10-05T12:36:32Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hi

I've wrote the following helper method to create or replace an XML element
into an XML document (this may help others).

I notice that I must specify the default namespace into my XML element (elt
parameter below), otherwise when the element is inserted xmlbeans add a
default one with no value ?! If I add an XML element &lt;rule&gt; into a &lt;ruleset&gt;
document, I get:

&lt;ruleset xmlns="urn:ietf:params:xml:ns:common-policy"&gt;
    &lt;rule id="rule_1253695448_0" *xmlns=""*&gt;
    [...]
    &lt;/rule&gt;
&lt;/ruleset&gt;

... and of course it does not validate against the schema.

What should I do in order to remove this value ? Or what should I do to
automatically set a default namespace to elt if it has none ?

Here's the code of my method, making use of XmlCursor.copyXml():

    public static void createReplaceElement(XmlObject doc, String namespace,
XmlObject elt, String xpathQuery) {

        int index;
        // Create a cursor and move it to the position defined by XPath
query
        XmlCursor docCursor = doc.newCursor();
        String query = "declare default element namespace '" + namespace +
"';" + xpathQuery;
        docCursor.selectPath(query);

        // If element already exists, delete it first (Replace case)
        if (docCursor.toNextSelection()) {
            docCursor.removeXml();
            // keep the cursor to insert the new element in the same place.
        }

        // Create case (element does not already exist)
        else {
            System.out.println("XmlBeansHelper: Element doesn't exist yet");
             index = xpathQuery.lastIndexOf("/");
            if (index != -1) {
                String q = xpathQuery.substring(0, index);
                query ="declare default element namespace '" + namespace +
"';" + q;
                docCursor.selectPath(query);
                if (docCursor.toNextSelection()) {
                    if (!docCursor.toFirstChild())
                        docCursor.toEndToken();
                }
                else
                    return;
            }
        }

        // Element cursor
        XmlCursor eltCursor = elt.newCursor();
        if (eltCursor.currentTokenType().isStartdoc())
            eltCursor.toNextToken();

        eltCursor.copyXml(docCursor);

        docCursor.dispose();
        eltCursor.dispose();
    }


Best Regards,
Pascal


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: How to convert from org.apache.xmlbeans.xmlobject to	org.w3c.dom.Document?</title>
<author><name>first last &lt;gugle.rulez@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/xmlbeans-user/200910.mbox/%3c8b783ff30910050330t4d5d9fd4n29eb02b3b89863c9@mail.gmail.com%3e"/>
<id>urn:uuid:%3c8b783ff30910050330t4d5d9fd4n29eb02b3b89863c9@mail-gmail-com%3e</id>
<updated>2009-10-05T10:30:05Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Thanks a lot Jeff. My xmlobj is indeed at the document level. I'll try the
approach you've suggested. Thanks again.
Gugle.

On Mon, Oct 5, 2009 at 3:33 PM, Jeff Lusted &lt;jl99@star.le.ac.uk&gt; wrote:

&gt; Hi Gugle!
&gt;
&gt; Yes indeed, that is what I am suggesting, provided the xmlobj you create
&gt; is at the document level, I believe. (So the token source would be the
&gt; equivalent of XmlCursor.TokenType  of STARTDOC ... the singleton
&gt; start-document token type). I don't think the cast will be correct
&gt; otherwise.
&gt;
&gt; Regards
&gt; Jeff
&gt;
&gt; On Mon, 2009-10-05 at 15:09 +0530, first last wrote:
&gt; &gt; Hi Jeff,
&gt; &gt; Thanks for the quick respons. Are you suggesting that I do the
&gt; &gt; following?
&gt; &gt;
&gt; &gt;
&gt; &gt; org.apache.xmlbeans.xmlobject xmlObj = null;
&gt; &gt; ...
&gt; &gt; create/populate the xmlObj
&gt; &gt; ....
&gt; &gt; //directly typecast the xmlobj to Document
&gt; &gt; org.w3c.dom.Document nd = (Document) xmlObj.getDomNode();
&gt; &gt;
&gt; &gt;
&gt; &gt; Is this correct?
&gt; &gt;
&gt; &gt;
&gt; &gt; Regards,
&gt; &gt; Gugle
&gt; &gt;
&gt; &gt;
&gt; &gt;
&gt; &gt;
&gt; &gt; On Mon, Oct 5, 2009 at 2:50 PM, Jeff Lusted &lt;jl99@star.le.ac.uk&gt;
&gt; &gt; wrote:
&gt; &gt;         Hi Gugle!
&gt; &gt;
&gt; &gt;
&gt; &gt;         On Mon, 2009-10-05 at 14:03 +0530, first last wrote:
&gt; &gt;         &gt; Hi all,
&gt; &gt;         &gt; I'm using XMLBeans to create an XML object which is of
&gt; &gt;         &gt; type org.apache.xmlbeans.xmlobject. But I need to pass this
&gt; &gt;         XML
&gt; &gt;         &gt; content to an API which expects an XML of type -
&gt; &gt;         org.w3c.dom.Document.
&gt; &gt;         &gt; Does XMLBeans provide a direct way of converting from
&gt; &gt;         xmlobject to
&gt; &gt;         &gt; dom.Document? I noticed that we can go from XmlObject to
&gt; &gt;         org.w3c.dom
&gt; &gt;         &gt; Node Object using XmlObject.newDomNode(), but not sure how
&gt; &gt;         to get a
&gt; &gt;         &gt; dom.Document object from XMLobject. Can someone let me know
&gt; &gt;         if this is
&gt; &gt;         &gt; possible?
&gt; &gt;
&gt; &gt;
&gt; &gt;         My understanding is that if you use the XmlObject that is the
&gt; &gt;         equivalent
&gt; &gt;         of the document interface, then yourXmlObject.getDomNode()
&gt; &gt;         should return
&gt; &gt;         the correct Dom Node and this used tocast to a
&gt; &gt;         org.w3c.dom.Document...
&gt; &gt;
&gt; &gt;         &gt;From the api...
&gt; &gt;
&gt; &gt;         &gt; public Node getDomNode()
&gt; &gt;         &gt;
&gt; &gt;         &gt;
&gt; &gt;         &gt; Returns a W3C DOM Node containing the XML represented by
&gt; &gt;         this source.
&gt; &gt;         &gt; This is a live DOM node, not a copy. Any changes made
&gt; &gt;         through this
&gt; &gt;         &gt; node are immediately reflected in the document associated
&gt; &gt;         with this
&gt; &gt;         &gt; token source. Depending on the kind of token this
&gt; &gt;         XmlTokenSource
&gt; &gt;         &gt; represents, an appropriate node will be returned.
&gt; &gt;
&gt; &gt;         Haven't tried this any time recently. Hope my understanding is
&gt; &gt;         good.
&gt; &gt;         Regards
&gt; &gt;         Jeff
&gt; &gt;         --
&gt; &gt;         Jeff Lusted               tel: +44 (0)116 252 3581
&gt; &gt;         Astrogrid Project         mob: +44 (0)7941 599062
&gt; &gt;         Dept Physics &amp; Astronomy  email: jl99@star.le.ac.uk
&gt; &gt;         University of Leicester   web: http://www.astrogrid.org
&gt; &gt;
&gt; &gt;
&gt; &gt;
&gt; ---------------------------------------------------------------------
&gt; &gt;         To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
&gt; &gt;         For additional commands, e-mail: user-help@xmlbeans.apache.org
&gt; &gt;
&gt; &gt;
&gt; &gt;
&gt; --
&gt; Jeff Lusted               tel: +44 (0)116 252 3581
&gt; Astrogrid Project         mob: +44 (0)7941 599062
&gt; Dept Physics &amp; Astronomy  email: jl99@star.le.ac.uk
&gt; University of Leicester   web: http://www.astrogrid.org
&gt;
&gt;
&gt; ---------------------------------------------------------------------
&gt; To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
&gt; For additional commands, e-mail: user-help@xmlbeans.apache.org
&gt;
&gt;


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: How to convert from org.apache.xmlbeans.xmlobject to	org.w3c.dom.Document?</title>
<author><name>Jeff Lusted &lt;jl99@star.le.ac.uk&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/xmlbeans-user/200910.mbox/%3c1254737005.2459.6.camel@localhost.localdomain%3e"/>
<id>urn:uuid:%3c1254737005-2459-6-camel@localhost-localdomain%3e</id>
<updated>2009-10-05T10:03:24Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hi Gugle!

Yes indeed, that is what I am suggesting, provided the xmlobj you create
is at the document level, I believe. (So the token source would be the
equivalent of XmlCursor.TokenType  of STARTDOC ... the singleton
start-document token type). I don't think the cast will be correct
otherwise.

Regards
Jeff

On Mon, 2009-10-05 at 15:09 +0530, first last wrote:
&gt; Hi Jeff,
&gt; Thanks for the quick respons. Are you suggesting that I do the
&gt; following?
&gt; 
&gt; 
&gt; org.apache.xmlbeans.xmlobject xmlObj = null;
&gt; ...
&gt; create/populate the xmlObj
&gt; ....
&gt; //directly typecast the xmlobj to Document
&gt; org.w3c.dom.Document nd = (Document) xmlObj.getDomNode();
&gt; 
&gt; 
&gt; Is this correct?
&gt; 
&gt; 
&gt; Regards,
&gt; Gugle
&gt; 
&gt; 
&gt; 
&gt; 
&gt; On Mon, Oct 5, 2009 at 2:50 PM, Jeff Lusted &lt;jl99@star.le.ac.uk&gt;
&gt; wrote:
&gt;         Hi Gugle!
&gt;         
&gt;         
&gt;         On Mon, 2009-10-05 at 14:03 +0530, first last wrote:
&gt;         &gt; Hi all,
&gt;         &gt; I'm using XMLBeans to create an XML object which is of
&gt;         &gt; type org.apache.xmlbeans.xmlobject. But I need to pass this
&gt;         XML
&gt;         &gt; content to an API which expects an XML of type -
&gt;         org.w3c.dom.Document.
&gt;         &gt; Does XMLBeans provide a direct way of converting from
&gt;         xmlobject to
&gt;         &gt; dom.Document? I noticed that we can go from XmlObject to
&gt;         org.w3c.dom
&gt;         &gt; Node Object using XmlObject.newDomNode(), but not sure how
&gt;         to get a
&gt;         &gt; dom.Document object from XMLobject. Can someone let me know
&gt;         if this is
&gt;         &gt; possible?
&gt;         
&gt;         
&gt;         My understanding is that if you use the XmlObject that is the
&gt;         equivalent
&gt;         of the document interface, then yourXmlObject.getDomNode()
&gt;         should return
&gt;         the correct Dom Node and this used tocast to a
&gt;         org.w3c.dom.Document...
&gt;         
&gt;         &gt;From the api...
&gt;         
&gt;         &gt; public Node getDomNode()
&gt;         &gt;
&gt;         &gt;
&gt;         &gt; Returns a W3C DOM Node containing the XML represented by
&gt;         this source.
&gt;         &gt; This is a live DOM node, not a copy. Any changes made
&gt;         through this
&gt;         &gt; node are immediately reflected in the document associated
&gt;         with this
&gt;         &gt; token source. Depending on the kind of token this
&gt;         XmlTokenSource
&gt;         &gt; represents, an appropriate node will be returned.
&gt;         
&gt;         Haven't tried this any time recently. Hope my understanding is
&gt;         good.
&gt;         Regards
&gt;         Jeff
&gt;         --
&gt;         Jeff Lusted               tel: +44 (0)116 252 3581
&gt;         Astrogrid Project         mob: +44 (0)7941 599062
&gt;         Dept Physics &amp; Astronomy  email: jl99@star.le.ac.uk
&gt;         University of Leicester   web: http://www.astrogrid.org
&gt;         
&gt;         
&gt;         ---------------------------------------------------------------------
&gt;         To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
&gt;         For additional commands, e-mail: user-help@xmlbeans.apache.org
&gt;         
&gt; 
&gt; 
-- 
Jeff Lusted               tel: +44 (0)116 252 3581
Astrogrid Project         mob: +44 (0)7941 599062
Dept Physics &amp; Astronomy  email: jl99@star.le.ac.uk
University of Leicester   web: http://www.astrogrid.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: How to convert from org.apache.xmlbeans.xmlobject to	org.w3c.dom.Document?</title>
<author><name>first last &lt;gugle.rulez@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/xmlbeans-user/200910.mbox/%3c8b783ff30910050239t2f35ef0cpaf0be3b0d734a20@mail.gmail.com%3e"/>
<id>urn:uuid:%3c8b783ff30910050239t2f35ef0cpaf0be3b0d734a20@mail-gmail-com%3e</id>
<updated>2009-10-05T09:39:22Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hi Jeff,Thanks for the quick respons. Are you suggesting that I do the
following?

org.apache.xmlbeans.xmlobject xmlObj = null;
...
create/populate the xmlObj
....
//directly typecast the xmlobj to Document
org.w3c.dom.Document nd = (Document) xmlObj.getDomNode();

Is this correct?

Regards,
Gugle



On Mon, Oct 5, 2009 at 2:50 PM, Jeff Lusted &lt;jl99@star.le.ac.uk&gt; wrote:

&gt; Hi Gugle!
&gt;
&gt; On Mon, 2009-10-05 at 14:03 +0530, first last wrote:
&gt; &gt; Hi all,
&gt; &gt; I'm using XMLBeans to create an XML object which is of
&gt; &gt; type org.apache.xmlbeans.xmlobject. But I need to pass this XML
&gt; &gt; content to an API which expects an XML of type - org.w3c.dom.Document.
&gt; &gt; Does XMLBeans provide a direct way of converting from xmlobject to
&gt; &gt; dom.Document? I noticed that we can go from XmlObject to org.w3c.dom
&gt; &gt; Node Object using XmlObject.newDomNode(), but not sure how to get a
&gt; &gt; dom.Document object from XMLobject. Can someone let me know if this is
&gt; &gt; possible?
&gt;
&gt; My understanding is that if you use the XmlObject that is the equivalent
&gt; of the document interface, then yourXmlObject.getDomNode() should return
&gt; the correct Dom Node and this used tocast to a org.w3c.dom.Document...
&gt;
&gt; &gt;From the api...
&gt;
&gt; &gt; public Node getDomNode()
&gt; &gt;
&gt; &gt;
&gt; &gt; Returns a W3C DOM Node containing the XML represented by this source.
&gt; &gt; This is a live DOM node, not a copy. Any changes made through this
&gt; &gt; node are immediately reflected in the document associated with this
&gt; &gt; token source. Depending on the kind of token this XmlTokenSource
&gt; &gt; represents, an appropriate node will be returned.
&gt;
&gt; Haven't tried this any time recently. Hope my understanding is good.
&gt; Regards
&gt; Jeff
&gt; --
&gt; Jeff Lusted               tel: +44 (0)116 252 3581
&gt; Astrogrid Project         mob: +44 (0)7941 599062
&gt; Dept Physics &amp; Astronomy  email: jl99@star.le.ac.uk
&gt; University of Leicester   web: http://www.astrogrid.org
&gt;
&gt;
&gt; ---------------------------------------------------------------------
&gt; To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
&gt; For additional commands, e-mail: user-help@xmlbeans.apache.org
&gt;
&gt;


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: How to convert from org.apache.xmlbeans.xmlobject to	org.w3c.dom.Document?</title>
<author><name>Jeff Lusted &lt;jl99@star.le.ac.uk&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/xmlbeans-user/200910.mbox/%3c1254734444.25041.2.camel@localhost.localdomain%3e"/>
<id>urn:uuid:%3c1254734444-25041-2-camel@localhost-localdomain%3e</id>
<updated>2009-10-05T09:20:44Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hi Gugle!

On Mon, 2009-10-05 at 14:03 +0530, first last wrote:
&gt; Hi all,
&gt; I'm using XMLBeans to create an XML object which is of
&gt; type org.apache.xmlbeans.xmlobject. But I need to pass this XML
&gt; content to an API which expects an XML of type - org.w3c.dom.Document.
&gt; Does XMLBeans provide a direct way of converting from xmlobject to
&gt; dom.Document? I noticed that we can go from XmlObject to org.w3c.dom
&gt; Node Object using XmlObject.newDomNode(), but not sure how to get a
&gt; dom.Document object from XMLobject. Can someone let me know if this is
&gt; possible?

My understanding is that if you use the XmlObject that is the equivalent
of the document interface, then yourXmlObject.getDomNode() should return
the correct Dom Node and this used tocast to a org.w3c.dom.Document...

&gt;&gt;From the api...

&gt; public Node getDomNode()
&gt; 
&gt; 
&gt; Returns a W3C DOM Node containing the XML represented by this source.
&gt; This is a live DOM node, not a copy. Any changes made through this
&gt; node are immediately reflected in the document associated with this
&gt; token source. Depending on the kind of token this XmlTokenSource
&gt; represents, an appropriate node will be returned. 

Haven't tried this any time recently. Hope my understanding is good.
Regards
Jeff
-- 
Jeff Lusted               tel: +44 (0)116 252 3581
Astrogrid Project         mob: +44 (0)7941 599062
Dept Physics &amp; Astronomy  email: jl99@star.le.ac.uk
University of Leicester   web: http://www.astrogrid.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>How to convert from org.apache.xmlbeans.xmlobject to	org.w3c.dom.Document?</title>
<author><name>first last &lt;gugle.rulez@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/xmlbeans-user/200910.mbox/%3c8b783ff30910050133p5bf42c0aned782cce45fe46e0@mail.gmail.com%3e"/>
<id>urn:uuid:%3c8b783ff30910050133p5bf42c0aned782cce45fe46e0@mail-gmail-com%3e</id>
<updated>2009-10-05T08:33:26Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hi all,I'm using XMLBeans to create an XML object which is of type
org.apache.xmlbeans.xmlobject.
But I need to pass this XML content to an API which expects an XML of type -
org.w3c.dom.Document. Does XMLBeans provide a direct way of converting from
xmlobject to dom.Document? I noticed that we can go from XmlObject to
org.w3c.dom Node Object using XmlObject.newDomNode(), but not sure how to
get a dom.Document object from XMLobject. Can someone let me know if this is
possible?

Thanks in advance for your help.

Regards,
Gugle


</pre>
</div>
</content>
</entry>
</feed>
