Hello,

 

i have a strange problem using Typed Nodes set method.

I used the easypo.xsd schema from the samples directory to create the
java.classes.

Now I tried to import a Shipper-Node to the PurchaseOrderDocument using the
following code:

 

String podocpath = "<path to easypo.xml> ";

podoc = PurchaseOrderDocument.Factory.parse(podocpath);

String shipperpath = "<path to shipper.xml> ";

Shipper shipper = Shipper.Factory.parse(new File(shipperpath));

podoc.getPurchaseOrder().setShipper(shipper);

String test = podoc.toString();

 

easypo.xml 

 

<?xml version='1.0' encoding='iso8859-1'?>

<purchase-order xmlns="http://openuri.org/easypo";>

    <customer>

        <name>Gladys Kravitz</name>

        <address>Anytown, PA</address>

    </customer>

    <date>2003-01-07T14:16:00-05:00</date>

    <line-item>

        <description>Burnham's Celestial Handbook, Vol 1</description>

        <per-unit-ounces>5</per-unit-ounces>

        <price>21.79</price>

        <quantity>2</quantity>

    </line-item>

    <line-item>

        <description>Burnham's Celestial Handbook, Vol 2</description>

        <per-unit-ounces>5</per-unit-ounces>

        <price>19.89</price>

        <quantity>2</quantity>

    </line-item>

    <shipper>

        <name>ZipShip</name>

        <per-ounce-rate>0.74</per-ounce-rate>

    </shipper>

</purchase-order>

 

 

shipper.xml

<?xml version='1.0' encoding='iso8859-1'?>

<shipper xmlns="http://openuri.org/easypo";>

  <name>ZipShip</name>

  <per-ounce-rate>0.74</per-ounce-rate>

</shipper>

 

the toString() function produced the following output:

 

<purchase-order xmlns="http://openuri.org/easypo";>

  <customer>

    <name>Gladys Kravitz</name>

    <address>Anytown, PA</address>

  </customer>

  <date>2003-01-07T14:16:00-05:00</date>

  <line-item>

    <description>Burnham's Celestial Handbook, Vol 1</description>

    <per-unit-ounces>5</per-unit-ounces>

    <price>21.79</price>

    <quantity>2</quantity>

  </line-item>

  <line-item>

    <description>Burnham's Celestial Handbook, Vol 2</description>

    <per-unit-ounces>5</per-unit-ounces>

    <price>19.89</price>

    <quantity>2</quantity>

  </line-item>

  <shipper>

    <shipper>

      <name>ZipShip</name>

      <per-ounce-rate>0.74</per-ounce-rate>

    </shipper>

  </shipper>

</purchase-order>

Any Suggestions why the shipper-Node is not replaced.

 

Thanks Frank

 

 

Frank Rossol
Dipl. Inform. (FH) 


otten|software GmbH
Röntgenring 7
D-40878 Ratingen

Amtsgericht Düsseldorf HRB 55584
Geschäftsführer: Dr.Marcus Otten

Tel +49 2102 30964-0
Fax +49 2102 30964-29
 <mailto:[EMAIL PROTECTED]> [EMAIL PROTECTED]
 <http://www.otten-software.de/> www.otten-software.de

 

Reply via email to