You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@xmlbeans.apache.org by PhilNad214 PhilNad214 <ph...@gmail.com> on 2010/11/22 05:44:58 UTC
Problems getting started with xmlbeans
Hi, I posted here a couple of weeks ago some basic 'getting started'
questions. I've just got back to this project and have started using some
generated code - have created a bean and tried to convert to xml, but all I
get is the namespace in the xml. I.e it is as if the document.toString() is
just showing the top node, and not traversing its way through the object to
generate all the xml.
Does this sound familiar to anyone? Any suggestions?
The next thing I thought I must be doing something wrong, so I've gone back
to the getting started tutorial at
http://xmlbeans.apache.org/documentation/tutorial_getstarted.html
However I cannot for the life of me find a tutorial folder (although I did
find the easypo.xsd and have successfully generated an easypo.jar). I can't
see the tutorial files on the apache xmlbeans website anywhere... where on
earth do you get that from??
Thanks
RE: Problems getting started with xmlbeans
Posted by Wing Yew Poon <wi...@oracle.com>.
Phil,
a couple of remarks:
1. It appears that the tutorial you were looking at -
http://xmlbeans.apache.org/documentation/tutorial_getstarted.html
- was written for XMLBeans 1.0.x. I have not used 1.0.x. I'm not sure if the files referred to in the tutorial are distibuted with 1.0.x or not, but the tutorial says, "Start out by creating a new tutorials directory just under your XMLBEANS_HOME directory. This will hold the files you create in the course of this tutorial." so perhaps you create the files yourself (based on the tutorial text).
2. In your example below, you created a new, empty document and didn't populate it yet. There is therefore nothing to output. If you look at
http://xmlbeans.apache.org/docs/2.0.0/guide/conGettingStartedwithXMLBeans.html
there is a better example:
public PurchaseOrderDocument createPO()
{
PurchaseOrderDocument newPODoc = PurchaseOrderDocument.Factory.newInstance();
PurchaseOrder newPO = newPODoc.addNewPurchaseOrder();
Customer newCustomer = newPO.addNewCustomer();
newCustomer.setName("Doris Kravitz");
newCustomer.setAddress("Bellflower, CA");
return newPODoc;
}
<ns1:purchase-order xmlns:ns1="http://openuri.org/easypo">
<ns1:customer>
<ns1:name>Doris Kravitz</ns1:name>
<ns1:address>Bellflower, CA</ns1:address>
</ns1:customer>
</ns1:purchase-order>
Hope that helps,
Wing Yew
_____
From: PhilNad214 PhilNad214 [mailto:philnad214@gmail.com]
Sent: Sunday, November 21, 2010 9:17 PM
To: user@xmlbeans.apache.org
Subject: Re: Problems getting started with xmlbeans
As a followup to this, here is an example:
import org.openuri.easypo.PurchaseOrderDocument;
public class POUpdater {
POUpdater() {
PurchaseOrderDocument pod = PurchaseOrderDocument.Factory.newInstance();
System.out.println(pod.toString());
}
public static void main(String args[]) {
POUpdater po = new POUpdater();
}
}
... which outputs:
<xml-fragment/>
Shouldn't it output at least an XML structure with at least the basic structure of the bean?
On Mon, Nov 22, 2010 at 5:44 PM, PhilNad214 PhilNad214 <HYPERLINK "mailto:philnad214@gmail.com"philnad214@gmail.com> wrote:
Hi, I posted here a couple of weeks ago some basic 'getting started' questions. I've just got back to this project and have started using some generated code - have created a bean and tried to convert to xml, but all I get is the namespace in the xml. I.e it is as if the document.toString() is just showing the top node, and not traversing its way through the object to generate all the xml.
Does this sound familiar to anyone? Any suggestions?
The next thing I thought I must be doing something wrong, so I've gone back to the getting started tutorial at http://xmlbeans.apache.org/documentation/tutorial_getstarted.html
However I cannot for the life of me find a tutorial folder (although I did find the easypo.xsd and have successfully generated an easypo.jar). I can't see the tutorial files on the apache xmlbeans website anywhere... where on earth do you get that from??
Thanks
Re: Problems getting started with xmlbeans
Posted by PhilNad214 PhilNad214 <ph...@gmail.com>.
Yes that's the one I found, thanks
On Tue, Nov 23, 2010 at 9:08 AM, Duane Zamrok <za...@cubrc.org> wrote:
> Wing replied on the mailing list right after I did. I’ll paste his response
> below.
>
>
>
> Phil,
>
> a couple of remarks:
>
> 1. It appears that the tutorial you were looking at -
>
> http://xmlbeans.apache.org/documentation/tutorial_getstarted.html
>
> - was written for XMLBeans 1.0.x. I have not used 1.0.x. I'm not sure if
> the files referred to in the tutorial are distibuted with 1.0.x or not, but
> the tutorial says, "Start out by creating a new tutorials directory just
> under your XMLBEANS_HOME directory. This will hold the files you create in
> the course of this tutorial." so perhaps you create the files yourself
> (based on the tutorial text).
>
> 2. In your example below, you created a new, empty document and didn't
> populate it yet. There is therefore nothing to output. If you look at
>
>
> http://xmlbeans.apache.org/docs/2.0.0/guide/conGettingStartedwithXMLBeans.html
>
> there is a better example:
>
>
>
> public PurchaseOrderDocument createPO()
> {
> PurchaseOrderDocument newPODoc =
> PurchaseOrderDocument.Factory.newInstance();
> PurchaseOrder newPO = newPODoc.addNewPurchaseOrder();
> Customer newCustomer = newPO.addNewCustomer();
> newCustomer.setName("Doris Kravitz");
> newCustomer.setAddress("Bellflower, CA");
> return newPODoc;
> }
>
> <ns1:purchase-order xmlns:ns1="http://openuri.org/easypo">
> <ns1:customer>
> <ns1:name>Doris Kravitz</ns1:name>
> <ns1:address>Bellflower, CA</ns1:address>
> </ns1:customer>
> </ns1:purchase-order>
>
> Hope that helps,
>
> Wing Yew
>
>
>
>
>
> *From:* PhilNad214 PhilNad214 [mailto:philnad214@gmail.com]
> *Sent:* Monday, November 22, 2010 2:58 PM
>
> *To:* user@xmlbeans.apache.org
> *Subject:* Re: Problems getting started with xmlbeans
>
>
>
> Ahhh... ok, I've just been following tutorial right off the front page.
> Surely that needs updating then.
>
> Any idea then where I find this tutorial from Wing Yew Poon? I did a
> search of the XMLBeans site and could not find his name...
>
>
> On Tue, Nov 23, 2010 at 8:44 AM, Duane Zamrok <za...@cubrc.org> wrote:
>
> Based upon the schema, your code, and my experience I would expect you to
> get something like the following.
>
>
>
> <purchase-order/>
>
>
>
> That said, Wing Yew Poon may have hit upon the problem when he mentioned
> that you’re looking at a tutorial for 1.0. I advise you to take a look at
> the tutorial he linked and look into using XMLBeans 2.0+ instead of 1.0.
>
>
>
> -Duane
>
>
>
> *From:* PhilNad214 PhilNad214 [mailto:philnad214@gmail.com]
> *Sent:* Monday, November 22, 2010 2:30 PM
>
>
> *To:* user@xmlbeans.apache.org
> *Subject:* Re: Problems getting started with xmlbeans
>
>
>
> Sure (it's simply the one that comes with the distribution)...
>
> <xs:schema
> xmlns:xs="http://www.w3.org/2001/XMLSchema"
> xmlns:po="http://openuri.org/easypo"
> targetNamespace="http://openuri.org/easypo"
> elementFormDefault="qualified">
>
> <xs:element name="purchase-order">
> <xs:complexType>
> <xs:sequence>
> <xs:element name="customer" type="po:customer"/>
> <xs:element name="date" type="xs:dateTime"/>
> <xs:element name="line-item" type="po:line-item" minOccurs="0"
> maxOccurs="unbounded"/>
> <xs:element name="shipper" type="po:shipper" minOccurs="0"
> maxOccurs="1"/>
> </xs:sequence>
> </xs:complexType>
> </xs:element>
>
> <xs:complexType name="customer">
> <xs:sequence>
> <xs:element name="name" type="xs:string"/>
> <xs:element name="address" type="xs:string"/>
> </xs:sequence>
> <xs:attribute name="age" type="xs:int"/>
> <xs:attribute name="moo" type="xs:int" default="100"/>
> <xs:attribute name="poo" type="xs:int" fixed="200"/>
> </xs:complexType>
>
> <xs:complexType name="line-item">
> <xs:sequence>
> <xs:element name="description" type="xs:string"/>
> <xs:element name="per-unit-ounces" type="xs:decimal"/>
> <xs:element name="price" type="xs:decimal"/>
> <xs:element name="quantity" type="xs:integer"/>
> </xs:sequence>
> </xs:complexType>
>
> <xs:complexType name="shipper">
> <xs:sequence>
> <xs:element name="name" type="xs:string"/>
> <xs:element name="per-ounce-rate" type="xs:decimal"/>
> </xs:sequence>
> </xs:complexType>
>
> </xs:schema>
>
> On Tue, Nov 23, 2010 at 7:59 AM, Duane Zamrok <za...@cubrc.org> wrote:
>
> Can you post the schema as well?
>
>
>
> Thanks
>
> -Duane
>
>
>
> *From:* PhilNad214 PhilNad214 [mailto:philnad214@gmail.com]
> *Sent:* Monday, November 22, 2010 12:17 AM
> *To:* user@xmlbeans.apache.org
> *Subject:* Re: Problems getting started with xmlbeans
>
>
>
> As a followup to this, here is an example:
>
> import org.openuri.easypo.PurchaseOrderDocument;
> public class POUpdater {
> POUpdater() {
> PurchaseOrderDocument pod =
> PurchaseOrderDocument.Factory.newInstance();
> System.out.println(pod.toString());
> }
> public static void main(String args[]) {
> POUpdater po = new POUpdater();
> }
> }
>
> ... which outputs:
>
> <xml-fragment/>
>
> Shouldn't it output at least an XML structure with at least the basic
> structure of the bean?
>
> On Mon, Nov 22, 2010 at 5:44 PM, PhilNad214 PhilNad214 <
> philnad214@gmail.com> wrote:
>
> Hi, I posted here a couple of weeks ago some basic 'getting started'
> questions. I've just got back to this project and have started using some
> generated code - have created a bean and tried to convert to xml, but all I
> get is the namespace in the xml. I.e it is as if the document.toString() is
> just showing the top node, and not traversing its way through the object to
> generate all the xml.
> Does this sound familiar to anyone? Any suggestions?
>
> The next thing I thought I must be doing something wrong, so I've gone back
> to the getting started tutorial at
> http://xmlbeans.apache.org/documentation/tutorial_getstarted.html
> However I cannot for the life of me find a tutorial folder (although I did
> find the easypo.xsd and have successfully generated an easypo.jar). I can't
> see the tutorial files on the apache xmlbeans website anywhere... where on
> earth do you get that from??
>
> Thanks
>
>
>
>
>
>
>
RE: Problems getting started with xmlbeans
Posted by Duane Zamrok <za...@cubrc.org>.
Wing replied on the mailing list right after I did. I'll paste his response below.
Phil,
a couple of remarks:
1. It appears that the tutorial you were looking at -
http://xmlbeans.apache.org/documentation/tutorial_getstarted.html
- was written for XMLBeans 1.0.x. I have not used 1.0.x. I'm not sure if the files referred to in the tutorial are distibuted with 1.0.x or not, but the tutorial says, "Start out by creating a new tutorials directory just under your XMLBEANS_HOME directory. This will hold the files you create in the course of this tutorial." so perhaps you create the files yourself (based on the tutorial text).
2. In your example below, you created a new, empty document and didn't populate it yet. There is therefore nothing to output. If you look at
http://xmlbeans.apache.org/docs/2.0.0/guide/conGettingStartedwithXMLBeans.html
there is a better example:
public PurchaseOrderDocument createPO()
{
PurchaseOrderDocument newPODoc = PurchaseOrderDocument.Factory.newInstance();
PurchaseOrder newPO = newPODoc.addNewPurchaseOrder();
Customer newCustomer = newPO.addNewCustomer();
newCustomer.setName("Doris Kravitz");
newCustomer.setAddress("Bellflower, CA");
return newPODoc;
}
<ns1:purchase-order xmlns:ns1="http://openuri.org/easypo">
<ns1:customer>
<ns1:name>Doris Kravitz</ns1:name>
<ns1:address>Bellflower, CA</ns1:address>
</ns1:customer>
</ns1:purchase-order>
Hope that helps,
Wing Yew
From: PhilNad214 PhilNad214 [mailto:philnad214@gmail.com]
Sent: Monday, November 22, 2010 2:58 PM
To: user@xmlbeans.apache.org
Subject: Re: Problems getting started with xmlbeans
Ahhh... ok, I've just been following tutorial right off the front page. Surely that needs updating then.
Any idea then where I find this tutorial from Wing Yew Poon? I did a search of the XMLBeans site and could not find his name...
On Tue, Nov 23, 2010 at 8:44 AM, Duane Zamrok <za...@cubrc.org>> wrote:
Based upon the schema, your code, and my experience I would expect you to get something like the following.
<purchase-order/>
That said, Wing Yew Poon may have hit upon the problem when he mentioned that you're looking at a tutorial for 1.0. I advise you to take a look at the tutorial he linked and look into using XMLBeans 2.0+ instead of 1.0.
-Duane
From: PhilNad214 PhilNad214 [mailto:philnad214@gmail.com<ma...@gmail.com>]
Sent: Monday, November 22, 2010 2:30 PM
To: user@xmlbeans.apache.org<ma...@xmlbeans.apache.org>
Subject: Re: Problems getting started with xmlbeans
Sure (it's simply the one that comes with the distribution)...
<xs:schema
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:po="http://openuri.org/easypo"
targetNamespace="http://openuri.org/easypo"
elementFormDefault="qualified">
<xs:element name="purchase-order">
<xs:complexType>
<xs:sequence>
<xs:element name="customer" type="po:customer"/>
<xs:element name="date" type="xs:dateTime"/>
<xs:element name="line-item" type="po:line-item" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="shipper" type="po:shipper" minOccurs="0" maxOccurs="1"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:complexType name="customer">
<xs:sequence>
<xs:element name="name" type="xs:string"/>
<xs:element name="address" type="xs:string"/>
</xs:sequence>
<xs:attribute name="age" type="xs:int"/>
<xs:attribute name="moo" type="xs:int" default="100"/>
<xs:attribute name="poo" type="xs:int" fixed="200"/>
</xs:complexType>
<xs:complexType name="line-item">
<xs:sequence>
<xs:element name="description" type="xs:string"/>
<xs:element name="per-unit-ounces" type="xs:decimal"/>
<xs:element name="price" type="xs:decimal"/>
<xs:element name="quantity" type="xs:integer"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="shipper">
<xs:sequence>
<xs:element name="name" type="xs:string"/>
<xs:element name="per-ounce-rate" type="xs:decimal"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
On Tue, Nov 23, 2010 at 7:59 AM, Duane Zamrok <za...@cubrc.org>> wrote:
Can you post the schema as well?
Thanks
-Duane
From: PhilNad214 PhilNad214 [mailto:philnad214@gmail.com<ma...@gmail.com>]
Sent: Monday, November 22, 2010 12:17 AM
To: user@xmlbeans.apache.org<ma...@xmlbeans.apache.org>
Subject: Re: Problems getting started with xmlbeans
As a followup to this, here is an example:
import org.openuri.easypo.PurchaseOrderDocument;
public class POUpdater {
POUpdater() {
PurchaseOrderDocument pod = PurchaseOrderDocument.Factory.newInstance();
System.out.println(pod.toString());
}
public static void main(String args[]) {
POUpdater po = new POUpdater();
}
}
... which outputs:
<xml-fragment/>
Shouldn't it output at least an XML structure with at least the basic structure of the bean?
On Mon, Nov 22, 2010 at 5:44 PM, PhilNad214 PhilNad214 <ph...@gmail.com>> wrote:
Hi, I posted here a couple of weeks ago some basic 'getting started' questions. I've just got back to this project and have started using some generated code - have created a bean and tried to convert to xml, but all I get is the namespace in the xml. I.e it is as if the document.toString() is just showing the top node, and not traversing its way through the object to generate all the xml.
Does this sound familiar to anyone? Any suggestions?
The next thing I thought I must be doing something wrong, so I've gone back to the getting started tutorial at http://xmlbeans.apache.org/documentation/tutorial_getstarted.html
However I cannot for the life of me find a tutorial folder (although I did find the easypo.xsd and have successfully generated an easypo.jar). I can't see the tutorial files on the apache xmlbeans website anywhere... where on earth do you get that from??
Thanks
Re: Problems getting started with xmlbeans
Posted by PhilNad214 PhilNad214 <ph...@gmail.com>.
Thanks Duane, found it under docs/2.0.0/guide/
cheers
On Tue, Nov 23, 2010 at 8:57 AM, PhilNad214 PhilNad214 <philnad214@gmail.com
> wrote:
> Ahhh... ok, I've just been following tutorial right off the front page.
> Surely that needs updating then.
>
> Any idea then where I find this tutorial from Wing Yew Poon? I did a
> search of the XMLBeans site and could not find his name...
>
>
>
>
> On Tue, Nov 23, 2010 at 8:44 AM, Duane Zamrok <za...@cubrc.org> wrote:
>
>> Based upon the schema, your code, and my experience I would expect you to
>> get something like the following.
>>
>>
>>
>> <purchase-order/>
>>
>>
>>
>> That said, Wing Yew Poon may have hit upon the problem when he mentioned
>> that you’re looking at a tutorial for 1.0. I advise you to take a look at
>> the tutorial he linked and look into using XMLBeans 2.0+ instead of 1.0.
>>
>>
>>
>> -Duane
>>
>>
>>
>> *From:* PhilNad214 PhilNad214 [mailto:philnad214@gmail.com]
>> *Sent:* Monday, November 22, 2010 2:30 PM
>>
>> *To:* user@xmlbeans.apache.org
>> *Subject:* Re: Problems getting started with xmlbeans
>>
>>
>>
>> Sure (it's simply the one that comes with the distribution)...
>>
>> <xs:schema
>> xmlns:xs="http://www.w3.org/2001/XMLSchema"
>> xmlns:po="http://openuri.org/easypo"
>> targetNamespace="http://openuri.org/easypo"
>> elementFormDefault="qualified">
>>
>> <xs:element name="purchase-order">
>> <xs:complexType>
>> <xs:sequence>
>> <xs:element name="customer" type="po:customer"/>
>> <xs:element name="date" type="xs:dateTime"/>
>> <xs:element name="line-item" type="po:line-item" minOccurs="0"
>> maxOccurs="unbounded"/>
>> <xs:element name="shipper" type="po:shipper" minOccurs="0"
>> maxOccurs="1"/>
>> </xs:sequence>
>> </xs:complexType>
>> </xs:element>
>>
>> <xs:complexType name="customer">
>> <xs:sequence>
>> <xs:element name="name" type="xs:string"/>
>> <xs:element name="address" type="xs:string"/>
>> </xs:sequence>
>> <xs:attribute name="age" type="xs:int"/>
>> <xs:attribute name="moo" type="xs:int" default="100"/>
>> <xs:attribute name="poo" type="xs:int" fixed="200"/>
>> </xs:complexType>
>>
>> <xs:complexType name="line-item">
>> <xs:sequence>
>> <xs:element name="description" type="xs:string"/>
>> <xs:element name="per-unit-ounces" type="xs:decimal"/>
>> <xs:element name="price" type="xs:decimal"/>
>> <xs:element name="quantity" type="xs:integer"/>
>> </xs:sequence>
>> </xs:complexType>
>>
>> <xs:complexType name="shipper">
>> <xs:sequence>
>> <xs:element name="name" type="xs:string"/>
>> <xs:element name="per-ounce-rate" type="xs:decimal"/>
>> </xs:sequence>
>> </xs:complexType>
>>
>> </xs:schema>
>>
>>
>> On Tue, Nov 23, 2010 at 7:59 AM, Duane Zamrok <za...@cubrc.org> wrote:
>>
>> Can you post the schema as well?
>>
>>
>>
>> Thanks
>>
>> -Duane
>>
>>
>>
>> *From:* PhilNad214 PhilNad214 [mailto:philnad214@gmail.com]
>> *Sent:* Monday, November 22, 2010 12:17 AM
>> *To:* user@xmlbeans.apache.org
>> *Subject:* Re: Problems getting started with xmlbeans
>>
>>
>>
>> As a followup to this, here is an example:
>>
>> import org.openuri.easypo.PurchaseOrderDocument;
>> public class POUpdater {
>> POUpdater() {
>> PurchaseOrderDocument pod =
>> PurchaseOrderDocument.Factory.newInstance();
>> System.out.println(pod.toString());
>> }
>> public static void main(String args[]) {
>> POUpdater po = new POUpdater();
>> }
>> }
>>
>> ... which outputs:
>>
>> <xml-fragment/>
>>
>> Shouldn't it output at least an XML structure with at least the basic
>> structure of the bean?
>>
>> On Mon, Nov 22, 2010 at 5:44 PM, PhilNad214 PhilNad214 <
>> philnad214@gmail.com> wrote:
>>
>> Hi, I posted here a couple of weeks ago some basic 'getting started'
>> questions. I've just got back to this project and have started using some
>> generated code - have created a bean and tried to convert to xml, but all I
>> get is the namespace in the xml. I.e it is as if the document.toString() is
>> just showing the top node, and not traversing its way through the object to
>> generate all the xml.
>> Does this sound familiar to anyone? Any suggestions?
>>
>> The next thing I thought I must be doing something wrong, so I've gone
>> back to the getting started tutorial at
>> http://xmlbeans.apache.org/documentation/tutorial_getstarted.html
>> However I cannot for the life of me find a tutorial folder (although I did
>> find the easypo.xsd and have successfully generated an easypo.jar). I can't
>> see the tutorial files on the apache xmlbeans website anywhere... where on
>> earth do you get that from??
>>
>> Thanks
>>
>>
>>
>>
>>
>
>
Re: Problems getting started with xmlbeans
Posted by PhilNad214 PhilNad214 <ph...@gmail.com>.
Ahhh... ok, I've just been following tutorial right off the front page.
Surely that needs updating then.
Any idea then where I find this tutorial from Wing Yew Poon? I did a search
of the XMLBeans site and could not find his name...
On Tue, Nov 23, 2010 at 8:44 AM, Duane Zamrok <za...@cubrc.org> wrote:
> Based upon the schema, your code, and my experience I would expect you to
> get something like the following.
>
>
>
> <purchase-order/>
>
>
>
> That said, Wing Yew Poon may have hit upon the problem when he mentioned
> that you’re looking at a tutorial for 1.0. I advise you to take a look at
> the tutorial he linked and look into using XMLBeans 2.0+ instead of 1.0.
>
>
>
> -Duane
>
>
>
> *From:* PhilNad214 PhilNad214 [mailto:philnad214@gmail.com]
> *Sent:* Monday, November 22, 2010 2:30 PM
>
> *To:* user@xmlbeans.apache.org
> *Subject:* Re: Problems getting started with xmlbeans
>
>
>
> Sure (it's simply the one that comes with the distribution)...
>
> <xs:schema
> xmlns:xs="http://www.w3.org/2001/XMLSchema"
> xmlns:po="http://openuri.org/easypo"
> targetNamespace="http://openuri.org/easypo"
> elementFormDefault="qualified">
>
> <xs:element name="purchase-order">
> <xs:complexType>
> <xs:sequence>
> <xs:element name="customer" type="po:customer"/>
> <xs:element name="date" type="xs:dateTime"/>
> <xs:element name="line-item" type="po:line-item" minOccurs="0"
> maxOccurs="unbounded"/>
> <xs:element name="shipper" type="po:shipper" minOccurs="0"
> maxOccurs="1"/>
> </xs:sequence>
> </xs:complexType>
> </xs:element>
>
> <xs:complexType name="customer">
> <xs:sequence>
> <xs:element name="name" type="xs:string"/>
> <xs:element name="address" type="xs:string"/>
> </xs:sequence>
> <xs:attribute name="age" type="xs:int"/>
> <xs:attribute name="moo" type="xs:int" default="100"/>
> <xs:attribute name="poo" type="xs:int" fixed="200"/>
> </xs:complexType>
>
> <xs:complexType name="line-item">
> <xs:sequence>
> <xs:element name="description" type="xs:string"/>
> <xs:element name="per-unit-ounces" type="xs:decimal"/>
> <xs:element name="price" type="xs:decimal"/>
> <xs:element name="quantity" type="xs:integer"/>
> </xs:sequence>
> </xs:complexType>
>
> <xs:complexType name="shipper">
> <xs:sequence>
> <xs:element name="name" type="xs:string"/>
> <xs:element name="per-ounce-rate" type="xs:decimal"/>
> </xs:sequence>
> </xs:complexType>
>
> </xs:schema>
>
>
> On Tue, Nov 23, 2010 at 7:59 AM, Duane Zamrok <za...@cubrc.org> wrote:
>
> Can you post the schema as well?
>
>
>
> Thanks
>
> -Duane
>
>
>
> *From:* PhilNad214 PhilNad214 [mailto:philnad214@gmail.com]
> *Sent:* Monday, November 22, 2010 12:17 AM
> *To:* user@xmlbeans.apache.org
> *Subject:* Re: Problems getting started with xmlbeans
>
>
>
> As a followup to this, here is an example:
>
> import org.openuri.easypo.PurchaseOrderDocument;
> public class POUpdater {
> POUpdater() {
> PurchaseOrderDocument pod =
> PurchaseOrderDocument.Factory.newInstance();
> System.out.println(pod.toString());
> }
> public static void main(String args[]) {
> POUpdater po = new POUpdater();
> }
> }
>
> ... which outputs:
>
> <xml-fragment/>
>
> Shouldn't it output at least an XML structure with at least the basic
> structure of the bean?
>
> On Mon, Nov 22, 2010 at 5:44 PM, PhilNad214 PhilNad214 <
> philnad214@gmail.com> wrote:
>
> Hi, I posted here a couple of weeks ago some basic 'getting started'
> questions. I've just got back to this project and have started using some
> generated code - have created a bean and tried to convert to xml, but all I
> get is the namespace in the xml. I.e it is as if the document.toString() is
> just showing the top node, and not traversing its way through the object to
> generate all the xml.
> Does this sound familiar to anyone? Any suggestions?
>
> The next thing I thought I must be doing something wrong, so I've gone back
> to the getting started tutorial at
> http://xmlbeans.apache.org/documentation/tutorial_getstarted.html
> However I cannot for the life of me find a tutorial folder (although I did
> find the easypo.xsd and have successfully generated an easypo.jar). I can't
> see the tutorial files on the apache xmlbeans website anywhere... where on
> earth do you get that from??
>
> Thanks
>
>
>
>
>
Re: Problems getting started with xmlbeans
Posted by PhilNad214 PhilNad214 <ph...@gmail.com>.
Thanks for the tips guys, got the demo going, so now will try to get back to
my main project :-)
Phil
On Tue, Nov 23, 2010 at 9:55 AM, Duane Zamrok <za...@cubrc.org> wrote:
> Wing,
>
> I totally missed that he forgot to addNewPurchaseOrder(), despite the fact
> you even mentioned it! I apologize for the error/mistake on my part.
>
>
>
>
>
> Phil,
>
> please refer to Wing’s correction of my mistake, as it is an important
> distinction in the way XMLBeans is used.
>
>
>
> -Duane
>
>
>
>
>
>
>
> *From:* Wing Yew Poon [mailto:wing.yew.poon@oracle.com]
> *Sent:* Monday, November 22, 2010 3:25 PM
>
> *To:* user@xmlbeans.apache.org
> *Subject:* RE: Problems getting started with xmlbeans
>
>
>
> Duane,
>
> if you did
>
>
>
> PurchaseOrderDocument newPODoc =
> PurchaseOrderDocument.Factory.newInstance();
> PurchaseOrder newPO = newPODoc.addNewPurchaseOrder();
>
> then you have a purchase-order element.
>
> If you just did
>
>
>
> PurchaseOrderDocument newPODoc =
> PurchaseOrderDocument.Factory.newInstance();
>
> then you have nothing yet, just an empty document. If you try to output
> that, you get an empty xml fragment.
>
> Hope that clarifies things.
>
> - Wing Yew
> ------------------------------
>
> *From:* Duane Zamrok [mailto:zamrok@cubrc.org]
> *Sent:* Monday, November 22, 2010 11:44 AM
> *To:* user@xmlbeans.apache.org
> *Subject:* RE: Problems getting started with xmlbeans
>
> Based upon the schema, your code, and my experience I would expect you to
> get something like the following.
>
>
>
> <purchase-order/>
>
>
>
> That said, Wing Yew Poon may have hit upon the problem when he mentioned
> that you’re looking at a tutorial for 1.0. I advise you to take a look at
> the tutorial he linked and look into using XMLBeans 2.0+ instead of 1.0.
>
>
>
> -Duane
>
>
>
> *From:* PhilNad214 PhilNad214 [mailto:philnad214@gmail.com]
> *Sent:* Monday, November 22, 2010 2:30 PM
> *To:* user@xmlbeans.apache.org
> *Subject:* Re: Problems getting started with xmlbeans
>
>
>
> Sure (it's simply the one that comes with the distribution)...
>
> <xs:schema
> xmlns:xs="http://www.w3.org/2001/XMLSchema"
> xmlns:po="http://openuri.org/easypo"
> targetNamespace="http://openuri.org/easypo"
> elementFormDefault="qualified">
>
> <xs:element name="purchase-order">
> <xs:complexType>
> <xs:sequence>
> <xs:element name="customer" type="po:customer"/>
> <xs:element name="date" type="xs:dateTime"/>
> <xs:element name="line-item" type="po:line-item" minOccurs="0"
> maxOccurs="unbounded"/>
> <xs:element name="shipper" type="po:shipper" minOccurs="0"
> maxOccurs="1"/>
> </xs:sequence>
> </xs:complexType>
> </xs:element>
>
> <xs:complexType name="customer">
> <xs:sequence>
> <xs:element name="name" type="xs:string"/>
> <xs:element name="address" type="xs:string"/>
> </xs:sequence>
> <xs:attribute name="age" type="xs:int"/>
> <xs:attribute name="moo" type="xs:int" default="100"/>
> <xs:attribute name="poo" type="xs:int" fixed="200"/>
> </xs:complexType>
>
> <xs:complexType name="line-item">
> <xs:sequence>
> <xs:element name="description" type="xs:string"/>
> <xs:element name="per-unit-ounces" type="xs:decimal"/>
> <xs:element name="price" type="xs:decimal"/>
> <xs:element name="quantity" type="xs:integer"/>
> </xs:sequence>
> </xs:complexType>
>
> <xs:complexType name="shipper">
> <xs:sequence>
> <xs:element name="name" type="xs:string"/>
> <xs:element name="per-ounce-rate" type="xs:decimal"/>
> </xs:sequence>
> </xs:complexType>
>
> </xs:schema>
>
> On Tue, Nov 23, 2010 at 7:59 AM, Duane Zamrok <za...@cubrc.org> wrote:
>
> Can you post the schema as well?
>
>
>
> Thanks
>
> -Duane
>
>
>
> *From:* PhilNad214 PhilNad214 [mailto:philnad214@gmail.com]
> *Sent:* Monday, November 22, 2010 12:17 AM
> *To:* user@xmlbeans.apache.org
> *Subject:* Re: Problems getting started with xmlbeans
>
>
>
> As a followup to this, here is an example:
>
> import org.openuri.easypo.PurchaseOrderDocument;
> public class POUpdater {
> POUpdater() {
> PurchaseOrderDocument pod =
> PurchaseOrderDocument.Factory.newInstance();
> System.out.println(pod.toString());
> }
> public static void main(String args[]) {
> POUpdater po = new POUpdater();
> }
> }
>
> ... which outputs:
>
> <xml-fragment/>
>
> Shouldn't it output at least an XML structure with at least the basic
> structure of the bean?
>
> On Mon, Nov 22, 2010 at 5:44 PM, PhilNad214 PhilNad214 <
> philnad214@gmail.com> wrote:
>
> Hi, I posted here a couple of weeks ago some basic 'getting started'
> questions. I've just got back to this project and have started using some
> generated code - have created a bean and tried to convert to xml, but all I
> get is the namespace in the xml. I.e it is as if the document.toString() is
> just showing the top node, and not traversing its way through the object to
> generate all the xml.
> Does this sound familiar to anyone? Any suggestions?
>
> The next thing I thought I must be doing something wrong, so I've gone back
> to the getting started tutorial at
> http://xmlbeans.apache.org/documentation/tutorial_getstarted.html
> However I cannot for the life of me find a tutorial folder (although I did
> find the easypo.xsd and have successfully generated an easypo.jar). I can't
> see the tutorial files on the apache xmlbeans website anywhere... where on
> earth do you get that from??
>
> Thanks
>
>
>
>
>
RE: Problems getting started with xmlbeans
Posted by Duane Zamrok <za...@cubrc.org>.
Wing,
I totally missed that he forgot to addNewPurchaseOrder(), despite the fact you even mentioned it! I apologize for the error/mistake on my part.
Phil,
please refer to Wing's correction of my mistake, as it is an important distinction in the way XMLBeans is used.
-Duane
From: Wing Yew Poon [mailto:wing.yew.poon@oracle.com]
Sent: Monday, November 22, 2010 3:25 PM
To: user@xmlbeans.apache.org
Subject: RE: Problems getting started with xmlbeans
Duane,
if you did
PurchaseOrderDocument newPODoc = PurchaseOrderDocument.Factory.newInstance();
PurchaseOrder newPO = newPODoc.addNewPurchaseOrder();
then you have a purchase-order element.
If you just did
PurchaseOrderDocument newPODoc = PurchaseOrderDocument.Factory.newInstance();
then you have nothing yet, just an empty document. If you try to output that, you get an empty xml fragment.
Hope that clarifies things.
- Wing Yew
________________________________
From: Duane Zamrok [mailto:zamrok@cubrc.org]
Sent: Monday, November 22, 2010 11:44 AM
To: user@xmlbeans.apache.org
Subject: RE: Problems getting started with xmlbeans
Based upon the schema, your code, and my experience I would expect you to get something like the following.
<purchase-order/>
That said, Wing Yew Poon may have hit upon the problem when he mentioned that you're looking at a tutorial for 1.0. I advise you to take a look at the tutorial he linked and look into using XMLBeans 2.0+ instead of 1.0.
-Duane
From: PhilNad214 PhilNad214 [mailto:philnad214@gmail.com]
Sent: Monday, November 22, 2010 2:30 PM
To: user@xmlbeans.apache.org
Subject: Re: Problems getting started with xmlbeans
Sure (it's simply the one that comes with the distribution)...
<xs:schema
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:po="http://openuri.org/easypo"
targetNamespace="http://openuri.org/easypo"
elementFormDefault="qualified">
<xs:element name="purchase-order">
<xs:complexType>
<xs:sequence>
<xs:element name="customer" type="po:customer"/>
<xs:element name="date" type="xs:dateTime"/>
<xs:element name="line-item" type="po:line-item" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="shipper" type="po:shipper" minOccurs="0" maxOccurs="1"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:complexType name="customer">
<xs:sequence>
<xs:element name="name" type="xs:string"/>
<xs:element name="address" type="xs:string"/>
</xs:sequence>
<xs:attribute name="age" type="xs:int"/>
<xs:attribute name="moo" type="xs:int" default="100"/>
<xs:attribute name="poo" type="xs:int" fixed="200"/>
</xs:complexType>
<xs:complexType name="line-item">
<xs:sequence>
<xs:element name="description" type="xs:string"/>
<xs:element name="per-unit-ounces" type="xs:decimal"/>
<xs:element name="price" type="xs:decimal"/>
<xs:element name="quantity" type="xs:integer"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="shipper">
<xs:sequence>
<xs:element name="name" type="xs:string"/>
<xs:element name="per-ounce-rate" type="xs:decimal"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
On Tue, Nov 23, 2010 at 7:59 AM, Duane Zamrok <za...@cubrc.org>> wrote:
Can you post the schema as well?
Thanks
-Duane
From: PhilNad214 PhilNad214 [mailto:philnad214@gmail.com<ma...@gmail.com>]
Sent: Monday, November 22, 2010 12:17 AM
To: user@xmlbeans.apache.org<ma...@xmlbeans.apache.org>
Subject: Re: Problems getting started with xmlbeans
As a followup to this, here is an example:
import org.openuri.easypo.PurchaseOrderDocument;
public class POUpdater {
POUpdater() {
PurchaseOrderDocument pod = PurchaseOrderDocument.Factory.newInstance();
System.out.println(pod.toString());
}
public static void main(String args[]) {
POUpdater po = new POUpdater();
}
}
... which outputs:
<xml-fragment/>
Shouldn't it output at least an XML structure with at least the basic structure of the bean?
On Mon, Nov 22, 2010 at 5:44 PM, PhilNad214 PhilNad214 <ph...@gmail.com>> wrote:
Hi, I posted here a couple of weeks ago some basic 'getting started' questions. I've just got back to this project and have started using some generated code - have created a bean and tried to convert to xml, but all I get is the namespace in the xml. I.e it is as if the document.toString() is just showing the top node, and not traversing its way through the object to generate all the xml.
Does this sound familiar to anyone? Any suggestions?
The next thing I thought I must be doing something wrong, so I've gone back to the getting started tutorial at http://xmlbeans.apache.org/documentation/tutorial_getstarted.html
However I cannot for the life of me find a tutorial folder (although I did find the easypo.xsd and have successfully generated an easypo.jar). I can't see the tutorial files on the apache xmlbeans website anywhere... where on earth do you get that from??
Thanks
RE: Problems getting started with xmlbeans
Posted by Wing Yew Poon <wi...@oracle.com>.
Duane,
if you did
PurchaseOrderDocument newPODoc = PurchaseOrderDocument.Factory.newInstance();
PurchaseOrder newPO = newPODoc.addNewPurchaseOrder();
then you have a purchase-order element.
If you just did
PurchaseOrderDocument newPODoc = PurchaseOrderDocument.Factory.newInstance();
then you have nothing yet, just an empty document. If you try to output that, you get an empty xml fragment.
Hope that clarifies things.
- Wing Yew
_____
From: Duane Zamrok [mailto:zamrok@cubrc.org]
Sent: Monday, November 22, 2010 11:44 AM
To: user@xmlbeans.apache.org
Subject: RE: Problems getting started with xmlbeans
Based upon the schema, your code, and my experience I would expect you to get something like the following.
<purchase-order/>
That said, Wing Yew Poon may have hit upon the problem when he mentioned that you're looking at a tutorial for 1.0. I advise you to take a look at the tutorial he linked and look into using XMLBeans 2.0+ instead of 1.0.
-Duane
From: PhilNad214 PhilNad214 [mailto:philnad214@gmail.com]
Sent: Monday, November 22, 2010 2:30 PM
To: user@xmlbeans.apache.org
Subject: Re: Problems getting started with xmlbeans
Sure (it's simply the one that comes with the distribution)...
<xs:schema
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:po="http://openuri.org/easypo"
targetNamespace="http://openuri.org/easypo"
elementFormDefault="qualified">
<xs:element name="purchase-order">
<xs:complexType>
<xs:sequence>
<xs:element name="customer" type="po:customer"/>
<xs:element name="date" type="xs:dateTime"/>
<xs:element name="line-item" type="po:line-item" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="shipper" type="po:shipper" minOccurs="0" maxOccurs="1"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:complexType name="customer">
<xs:sequence>
<xs:element name="name" type="xs:string"/>
<xs:element name="address" type="xs:string"/>
</xs:sequence>
<xs:attribute name="age" type="xs:int"/>
<xs:attribute name="moo" type="xs:int" default="100"/>
<xs:attribute name="poo" type="xs:int" fixed="200"/>
</xs:complexType>
<xs:complexType name="line-item">
<xs:sequence>
<xs:element name="description" type="xs:string"/>
<xs:element name="per-unit-ounces" type="xs:decimal"/>
<xs:element name="price" type="xs:decimal"/>
<xs:element name="quantity" type="xs:integer"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="shipper">
<xs:sequence>
<xs:element name="name" type="xs:string"/>
<xs:element name="per-ounce-rate" type="xs:decimal"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
On Tue, Nov 23, 2010 at 7:59 AM, Duane Zamrok <HYPERLINK "mailto:zamrok@cubrc.org"zamrok@cubrc.org> wrote:
Can you post the schema as well?
Thanks
-Duane
From: PhilNad214 PhilNad214 [mailto:HYPERLINK "mailto:philnad214@gmail.com" \nphilnad214@gmail.com]
Sent: Monday, November 22, 2010 12:17 AM
To: HYPERLINK "mailto:user@xmlbeans.apache.org" \nuser@xmlbeans.apache.org
Subject: Re: Problems getting started with xmlbeans
As a followup to this, here is an example:
import org.openuri.easypo.PurchaseOrderDocument;
public class POUpdater {
POUpdater() {
PurchaseOrderDocument pod = PurchaseOrderDocument.Factory.newInstance();
System.out.println(pod.toString());
}
public static void main(String args[]) {
POUpdater po = new POUpdater();
}
}
... which outputs:
<xml-fragment/>
Shouldn't it output at least an XML structure with at least the basic structure of the bean?
On Mon, Nov 22, 2010 at 5:44 PM, PhilNad214 PhilNad214 <HYPERLINK "mailto:philnad214@gmail.com" \nphilnad214@gmail.com> wrote:
Hi, I posted here a couple of weeks ago some basic 'getting started' questions. I've just got back to this project and have started using some generated code - have created a bean and tried to convert to xml, but all I get is the namespace in the xml. I.e it is as if the document.toString() is just showing the top node, and not traversing its way through the object to generate all the xml.
Does this sound familiar to anyone? Any suggestions?
The next thing I thought I must be doing something wrong, so I've gone back to the getting started tutorial at http://xmlbeans.apache.org/documentation/tutorial_getstarted.html
However I cannot for the life of me find a tutorial folder (although I did find the easypo.xsd and have successfully generated an easypo.jar). I can't see the tutorial files on the apache xmlbeans website anywhere... where on earth do you get that from??
Thanks
RE: Problems getting started with xmlbeans
Posted by Duane Zamrok <za...@cubrc.org>.
Based upon the schema, your code, and my experience I would expect you to get something like the following.
<purchase-order/>
That said, Wing Yew Poon may have hit upon the problem when he mentioned that you're looking at a tutorial for 1.0. I advise you to take a look at the tutorial he linked and look into using XMLBeans 2.0+ instead of 1.0.
-Duane
From: PhilNad214 PhilNad214 [mailto:philnad214@gmail.com]
Sent: Monday, November 22, 2010 2:30 PM
To: user@xmlbeans.apache.org
Subject: Re: Problems getting started with xmlbeans
Sure (it's simply the one that comes with the distribution)...
<xs:schema
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:po="http://openuri.org/easypo"
targetNamespace="http://openuri.org/easypo"
elementFormDefault="qualified">
<xs:element name="purchase-order">
<xs:complexType>
<xs:sequence>
<xs:element name="customer" type="po:customer"/>
<xs:element name="date" type="xs:dateTime"/>
<xs:element name="line-item" type="po:line-item" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="shipper" type="po:shipper" minOccurs="0" maxOccurs="1"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:complexType name="customer">
<xs:sequence>
<xs:element name="name" type="xs:string"/>
<xs:element name="address" type="xs:string"/>
</xs:sequence>
<xs:attribute name="age" type="xs:int"/>
<xs:attribute name="moo" type="xs:int" default="100"/>
<xs:attribute name="poo" type="xs:int" fixed="200"/>
</xs:complexType>
<xs:complexType name="line-item">
<xs:sequence>
<xs:element name="description" type="xs:string"/>
<xs:element name="per-unit-ounces" type="xs:decimal"/>
<xs:element name="price" type="xs:decimal"/>
<xs:element name="quantity" type="xs:integer"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="shipper">
<xs:sequence>
<xs:element name="name" type="xs:string"/>
<xs:element name="per-ounce-rate" type="xs:decimal"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
On Tue, Nov 23, 2010 at 7:59 AM, Duane Zamrok <za...@cubrc.org>> wrote:
Can you post the schema as well?
Thanks
-Duane
From: PhilNad214 PhilNad214 [mailto:philnad214@gmail.com<ma...@gmail.com>]
Sent: Monday, November 22, 2010 12:17 AM
To: user@xmlbeans.apache.org<ma...@xmlbeans.apache.org>
Subject: Re: Problems getting started with xmlbeans
As a followup to this, here is an example:
import org.openuri.easypo.PurchaseOrderDocument;
public class POUpdater {
POUpdater() {
PurchaseOrderDocument pod = PurchaseOrderDocument.Factory.newInstance();
System.out.println(pod.toString());
}
public static void main(String args[]) {
POUpdater po = new POUpdater();
}
}
... which outputs:
<xml-fragment/>
Shouldn't it output at least an XML structure with at least the basic structure of the bean?
On Mon, Nov 22, 2010 at 5:44 PM, PhilNad214 PhilNad214 <ph...@gmail.com>> wrote:
Hi, I posted here a couple of weeks ago some basic 'getting started' questions. I've just got back to this project and have started using some generated code - have created a bean and tried to convert to xml, but all I get is the namespace in the xml. I.e it is as if the document.toString() is just showing the top node, and not traversing its way through the object to generate all the xml.
Does this sound familiar to anyone? Any suggestions?
The next thing I thought I must be doing something wrong, so I've gone back to the getting started tutorial at http://xmlbeans.apache.org/documentation/tutorial_getstarted.html
However I cannot for the life of me find a tutorial folder (although I did find the easypo.xsd and have successfully generated an easypo.jar). I can't see the tutorial files on the apache xmlbeans website anywhere... where on earth do you get that from??
Thanks
Re: Problems getting started with xmlbeans
Posted by PhilNad214 PhilNad214 <ph...@gmail.com>.
Sure (it's simply the one that comes with the distribution)...
<xs:schema
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:po="http://openuri.org/easypo"
targetNamespace="http://openuri.org/easypo"
elementFormDefault="qualified">
<xs:element name="purchase-order">
<xs:complexType>
<xs:sequence>
<xs:element name="customer" type="po:customer"/>
<xs:element name="date" type="xs:dateTime"/>
<xs:element name="line-item" type="po:line-item" minOccurs="0"
maxOccurs="unbounded"/>
<xs:element name="shipper" type="po:shipper" minOccurs="0"
maxOccurs="1"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:complexType name="customer">
<xs:sequence>
<xs:element name="name" type="xs:string"/>
<xs:element name="address" type="xs:string"/>
</xs:sequence>
<xs:attribute name="age" type="xs:int"/>
<xs:attribute name="moo" type="xs:int" default="100"/>
<xs:attribute name="poo" type="xs:int" fixed="200"/>
</xs:complexType>
<xs:complexType name="line-item">
<xs:sequence>
<xs:element name="description" type="xs:string"/>
<xs:element name="per-unit-ounces" type="xs:decimal"/>
<xs:element name="price" type="xs:decimal"/>
<xs:element name="quantity" type="xs:integer"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="shipper">
<xs:sequence>
<xs:element name="name" type="xs:string"/>
<xs:element name="per-ounce-rate" type="xs:decimal"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
On Tue, Nov 23, 2010 at 7:59 AM, Duane Zamrok <za...@cubrc.org> wrote:
> Can you post the schema as well?
>
>
>
> Thanks
>
> -Duane
>
>
>
> *From:* PhilNad214 PhilNad214 [mailto:philnad214@gmail.com]
> *Sent:* Monday, November 22, 2010 12:17 AM
> *To:* user@xmlbeans.apache.org
> *Subject:* Re: Problems getting started with xmlbeans
>
>
>
> As a followup to this, here is an example:
>
> import org.openuri.easypo.PurchaseOrderDocument;
> public class POUpdater {
> POUpdater() {
> PurchaseOrderDocument pod =
> PurchaseOrderDocument.Factory.newInstance();
> System.out.println(pod.toString());
> }
> public static void main(String args[]) {
> POUpdater po = new POUpdater();
> }
> }
>
> ... which outputs:
>
> <xml-fragment/>
>
> Shouldn't it output at least an XML structure with at least the basic
> structure of the bean?
>
> On Mon, Nov 22, 2010 at 5:44 PM, PhilNad214 PhilNad214 <
> philnad214@gmail.com> wrote:
>
> Hi, I posted here a couple of weeks ago some basic 'getting started'
> questions. I've just got back to this project and have started using some
> generated code - have created a bean and tried to convert to xml, but all I
> get is the namespace in the xml. I.e it is as if the document.toString() is
> just showing the top node, and not traversing its way through the object to
> generate all the xml.
> Does this sound familiar to anyone? Any suggestions?
>
> The next thing I thought I must be doing something wrong, so I've gone back
> to the getting started tutorial at
> http://xmlbeans.apache.org/documentation/tutorial_getstarted.html
> However I cannot for the life of me find a tutorial folder (although I did
> find the easypo.xsd and have successfully generated an easypo.jar). I can't
> see the tutorial files on the apache xmlbeans website anywhere... where on
> earth do you get that from??
>
> Thanks
>
>
>
RE: Problems getting started with xmlbeans
Posted by Duane Zamrok <za...@cubrc.org>.
Can you post the schema as well?
Thanks
-Duane
From: PhilNad214 PhilNad214 [mailto:philnad214@gmail.com]
Sent: Monday, November 22, 2010 12:17 AM
To: user@xmlbeans.apache.org
Subject: Re: Problems getting started with xmlbeans
As a followup to this, here is an example:
import org.openuri.easypo.PurchaseOrderDocument;
public class POUpdater {
POUpdater() {
PurchaseOrderDocument pod = PurchaseOrderDocument.Factory.newInstance();
System.out.println(pod.toString());
}
public static void main(String args[]) {
POUpdater po = new POUpdater();
}
}
... which outputs:
<xml-fragment/>
Shouldn't it output at least an XML structure with at least the basic structure of the bean?
On Mon, Nov 22, 2010 at 5:44 PM, PhilNad214 PhilNad214 <ph...@gmail.com>> wrote:
Hi, I posted here a couple of weeks ago some basic 'getting started' questions. I've just got back to this project and have started using some generated code - have created a bean and tried to convert to xml, but all I get is the namespace in the xml. I.e it is as if the document.toString() is just showing the top node, and not traversing its way through the object to generate all the xml.
Does this sound familiar to anyone? Any suggestions?
The next thing I thought I must be doing something wrong, so I've gone back to the getting started tutorial at http://xmlbeans.apache.org/documentation/tutorial_getstarted.html
However I cannot for the life of me find a tutorial folder (although I did find the easypo.xsd and have successfully generated an easypo.jar). I can't see the tutorial files on the apache xmlbeans website anywhere... where on earth do you get that from??
Thanks
Re: Problems getting started with xmlbeans
Posted by PhilNad214 PhilNad214 <ph...@gmail.com>.
As a followup to this, here is an example:
import org.openuri.easypo.PurchaseOrderDocument;
public class POUpdater {
POUpdater() {
PurchaseOrderDocument pod =
PurchaseOrderDocument.Factory.newInstance();
System.out.println(pod.toString());
}
public static void main(String args[]) {
POUpdater po = new POUpdater();
}
}
... which outputs:
<xml-fragment/>
Shouldn't it output at least an XML structure with at least the basic
structure of the bean?
On Mon, Nov 22, 2010 at 5:44 PM, PhilNad214 PhilNad214 <philnad214@gmail.com
> wrote:
> Hi, I posted here a couple of weeks ago some basic 'getting started'
> questions. I've just got back to this project and have started using some
> generated code - have created a bean and tried to convert to xml, but all I
> get is the namespace in the xml. I.e it is as if the document.toString() is
> just showing the top node, and not traversing its way through the object to
> generate all the xml.
> Does this sound familiar to anyone? Any suggestions?
>
> The next thing I thought I must be doing something wrong, so I've gone back
> to the getting started tutorial at
> http://xmlbeans.apache.org/documentation/tutorial_getstarted.html
> However I cannot for the life of me find a tutorial folder (although I did
> find the easypo.xsd and have successfully generated an easypo.jar). I can't
> see the tutorial files on the apache xmlbeans website anywhere... where on
> earth do you get that from??
>
> Thanks
>