[jira] Created: (XMLBEANS-241) Nested XML - CData inconsistencies

View: New views
5 Messages — Rating Filter:   Alert me  

[jira] Created: (XMLBEANS-241) Nested XML - CData inconsistencies

by JIRA xmlbeans-dev@xml.apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Nested XML - CData inconsistencies
----------------------------------

         Key: XMLBEANS-241
         URL: http://issues.apache.org/jira/browse/XMLBEANS-241
     Project: XMLBeans
        Type: Bug
  Components: XmlObject  
 Environment: XP Professional
    Reporter: Keith Daurs
    Priority: Critical


Trying to insert XML data into an existing XML document. Success of this operation appears to be dependant on the size of data held in the nested XML child elements. Operation works fine up to a certain size with nested XML correctly wrapped within CDATA. However, if child elements are over a certain size then nested XML is not recognised as CDATA and the <> chars are escaped, causing parsing problems further down the line.

For an example I have used the EasyPO xsd as provided on the XMLBeans website, and adding the folowing data as my nested XML:

SUCCESSFUL RUN

<nestedXML>
        <testData>
        <textDataOne>hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world </textDataOne>
        <sizeTextDataOne>324 bytes</sizeTextDataOne>
        <textDataTwo>hello</textDataTwo>
        <sizeTextDataTwo>5 bytes</sizeTextDataTwo>
        </testData>
</nestedXML>

Output as follows:

<?xml version="1.0" encoding="UTF-8"?>
<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>
    <line-item><description><![CDATA[<nestedXML>
        <testData>
        <textDataOne>hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world </textDataOne>
        <sizeTextDataOne>324 bytes</sizeTextDataOne>
        <textDataTwo>hello</textDataTwo>
        <sizeTextDataTwo>5 bytes</sizeTextDataTwo>
        </testData>
</nestedXML>]]></description></line-item><shipper>
        <name>ZipShip</name>
        <per-ounce-rate>0.74</per-ounce-rate>
    </shipper>
</purchase-order>

UNSUCCESSFUL RUN

<nestedXML>
        <testData>
        <textDataOne>hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world </textDataOne>
        <sizeTextDataOne>324 bytes</sizeTextDataOne>
        <textDataTwo>hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world </textDataTwo>
        <sizeTextDataTwo>324 bytes</sizeTextDataTwo>
        </testData>
</nestedXML>

Output as follows:

<?xml version="1.0" encoding="UTF-8"?>
<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>
    <line-item><description><nestedXML>
        <testData>
        <textDataOne>hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world </textDataOne>
        <sizeTextDataOne>324 bytes</sizeTextDataOne>
        <textDataTwo>hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world </textDataTwo>
        <sizeTextDataTwo>324 bytes</sizeTextDataTwo>
        </testData>
</nestedXML></description></line-item><shipper>
        <name>ZipShip</name>
        <per-ounce-rate>0.74</per-ounce-rate>
    </shipper>
</purchase-order>

Example code used:

import java.io.File;
import java.io.IOException;

import org.apache.xmlbeans.XmlException;
import org.apache.xmlbeans.XmlObject;
import org.openuri.easypo.LineItem;
import org.openuri.easypo.PurchaseOrderDocument;

/**
 * @author
 *
 */
public class XMLBeanTester
{

        /**
         * @param args
         */
        public static void main(String[] args)
        {
                new XMLBeanTester().testXMLBeans();
        }
       
        public void testXMLBeans()
        {
                File xmlFile = new File("myPO.xml");
                String test_XML_data = "nested_xml.xml";

                try
                {
                        PurchaseOrderDocument PODoc = PurchaseOrderDocument.Factory.parse(xmlFile);
                        XmlObject xml = XmlObject.Factory.parse(new File(test_XML_data));
                        LineItem item = PODoc.getPurchaseOrder().addNewLineItem();
                        item.setDescription(xml.xmlText());
                        PODoc.save(new File("myNewPO.xml"));
                }
                catch (XmlException e)
                {
                        System.out.println("XML Problem:- ");
                        e.printStackTrace();
                }
                catch (IOException e)
                {
                        System.out.println("IO Problem:- ");
                        e.printStackTrace();
                }
        }
}

Is this a known bug or I am I missing something fundamental (quite possible!)? Any input will be appreciated as this is now having a serious impact on our project.

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@...
For additional commands, e-mail: dev-help@...


Parent Message unknown Out of Office AutoReply: [jira] Created: (XMLBEANS-241) Nested XML - CData inconsistencies

by Lawrence Jones :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I am out of the office until Tuesday 3rd Jan, 2006. Hope you have a very Happy Holidays!

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@...
For additional commands, e-mail: dev-help@...


[jira] Commented: (XMLBEANS-241) Nested XML - CData inconsistencies

by JIRA xmlbeans-dev@xml.apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

    [ http://issues.apache.org/jira/browse/XMLBEANS-241?page=comments#action_12378672 ]

Keith Daurs commented on XMLBEANS-241:
--------------------------------------

Thanks for looking at this one - not!!! Got over the problem by encoding the nested XML but still consider it an issue for other XML Beans users in the future.

So how does this reporting of bugs work? Why is ths one still unassigned? Did no one fancy tackling it? What is the point of reporting it and declaring a priority if no one bothers to even look at it?

Even an update on screen to say you hadn't got time would have been useful.

Ho-hum!




> Nested XML - CData inconsistencies
> ----------------------------------
>
>          Key: XMLBEANS-241
>          URL: http://issues.apache.org/jira/browse/XMLBEANS-241
>      Project: XMLBeans
>         Type: Bug

>   Components: XmlObject
>  Environment: XP Professional
>     Reporter: Keith Daurs
>     Priority: Critical

>
> Trying to insert XML data into an existing XML document. Success of this operation appears to be dependant on the size of data held in the nested XML child elements. Operation works fine up to a certain size with nested XML correctly wrapped within CDATA. However, if child elements are over a certain size then nested XML is not recognised as CDATA and the <> chars are escaped, causing parsing problems further down the line.
> For an example I have used the EasyPO xsd as provided on the XMLBeans website, and adding the folowing data as my nested XML:
> SUCCESSFUL RUN
> <nestedXML>
> <testData>
> <textDataOne>hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world </textDataOne>
> <sizeTextDataOne>324 bytes</sizeTextDataOne>
> <textDataTwo>hello</textDataTwo>
> <sizeTextDataTwo>5 bytes</sizeTextDataTwo>
> </testData>
> </nestedXML>
> Output as follows:
> <?xml version="1.0" encoding="UTF-8"?>
> <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>
>     <line-item><description><![CDATA[<nestedXML>
> <testData>
> <textDataOne>hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world </textDataOne>
> <sizeTextDataOne>324 bytes</sizeTextDataOne>
> <textDataTwo>hello</textDataTwo>
> <sizeTextDataTwo>5 bytes</sizeTextDataTwo>
> </testData>
> </nestedXML>]]></description></line-item><shipper>
>         <name>ZipShip</name>
>         <per-ounce-rate>0.74</per-ounce-rate>
>     </shipper>
> </purchase-order>
> UNSUCCESSFUL RUN
> <nestedXML>
> <testData>
> <textDataOne>hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world </textDataOne>
> <sizeTextDataOne>324 bytes</sizeTextDataOne>
> <textDataTwo>hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world </textDataTwo>
> <sizeTextDataTwo>324 bytes</sizeTextDataTwo>
> </testData>
> </nestedXML>
> Output as follows:
> <?xml version="1.0" encoding="UTF-8"?>
> <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>
>     <line-item><description><nestedXML>
> <testData>
> <textDataOne>hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world </textDataOne>
> <sizeTextDataOne>324 bytes</sizeTextDataOne>
> <textDataTwo>hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world </textDataTwo>
> <sizeTextDataTwo>324 bytes</sizeTextDataTwo>
> </testData>
> </nestedXML></description></line-item><shipper>
>         <name>ZipShip</name>
>         <per-ounce-rate>0.74</per-ounce-rate>
>     </shipper>
> </purchase-order>
> Example code used:
> import java.io.File;
> import java.io.IOException;
> import org.apache.xmlbeans.XmlException;
> import org.apache.xmlbeans.XmlObject;
> import org.openuri.easypo.LineItem;
> import org.openuri.easypo.PurchaseOrderDocument;
> /**
>  * @author
>  *
>  */
> public class XMLBeanTester
> {
> /**
> * @param args
> */
> public static void main(String[] args)
> {
> new XMLBeanTester().testXMLBeans();
> }
>
> public void testXMLBeans()
> {
> File xmlFile = new File("myPO.xml");
> String test_XML_data = "nested_xml.xml";
> try
> {
> PurchaseOrderDocument PODoc = PurchaseOrderDocument.Factory.parse(xmlFile);
> XmlObject xml = XmlObject.Factory.parse(new File(test_XML_data));
> LineItem item = PODoc.getPurchaseOrder().addNewLineItem();
> item.setDescription(xml.xmlText());
> PODoc.save(new File("myNewPO.xml"));
> }
> catch (XmlException e)
> {
> System.out.println("XML Problem:- ");
> e.printStackTrace();
> }
> catch (IOException e)
> {
> System.out.println("IO Problem:- ");
> e.printStackTrace();
> }
> }
> }
> Is this a known bug or I am I missing something fundamental (quite possible!)? Any input will be appreciated as this is now having a serious impact on our project.

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@...
For additional commands, e-mail: dev-help@...


[jira] Updated: (XMLBEANS-241) Nested XML - CData inconsistencies

by JIRA xmlbeans-dev@xml.apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

     [ http://issues.apache.org/jira/browse/XMLBEANS-241?page=all ]

Cezar Andrei updated XMLBEANS-241:
----------------------------------


Keith,

Please don't forget that this project is based only on voluntary work, so contributors chose what are they working on and what questions will answer.

Please check the archives of dev and user mailing lists since this was discused quite a few times.

The bugs are filled to track issues, to disscuse problems, come up with ideas for solving and to submit patches for fixing them.

Cezar

> Nested XML - CData inconsistencies
> ----------------------------------
>
>          Key: XMLBEANS-241
>          URL: http://issues.apache.org/jira/browse/XMLBEANS-241
>      Project: XMLBeans
>         Type: Bug

>   Components: XmlObject
>  Environment: XP Professional
>     Reporter: Keith Daurs
>     Priority: Critical

>
> Trying to insert XML data into an existing XML document. Success of this operation appears to be dependant on the size of data held in the nested XML child elements. Operation works fine up to a certain size with nested XML correctly wrapped within CDATA. However, if child elements are over a certain size then nested XML is not recognised as CDATA and the <> chars are escaped, causing parsing problems further down the line.
> For an example I have used the EasyPO xsd as provided on the XMLBeans website, and adding the folowing data as my nested XML:
> SUCCESSFUL RUN
> <nestedXML>
> <testData>
> <textDataOne>hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world </textDataOne>
> <sizeTextDataOne>324 bytes</sizeTextDataOne>
> <textDataTwo>hello</textDataTwo>
> <sizeTextDataTwo>5 bytes</sizeTextDataTwo>
> </testData>
> </nestedXML>
> Output as follows:
> <?xml version="1.0" encoding="UTF-8"?>
> <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>
>     <line-item><description><![CDATA[<nestedXML>
> <testData>
> <textDataOne>hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world </textDataOne>
> <sizeTextDataOne>324 bytes</sizeTextDataOne>
> <textDataTwo>hello</textDataTwo>
> <sizeTextDataTwo>5 bytes</sizeTextDataTwo>
> </testData>
> </nestedXML>]]></description></line-item><shipper>
>         <name>ZipShip</name>
>         <per-ounce-rate>0.74</per-ounce-rate>
>     </shipper>
> </purchase-order>
> UNSUCCESSFUL RUN
> <nestedXML>
> <testData>
> <textDataOne>hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world </textDataOne>
> <sizeTextDataOne>324 bytes</sizeTextDataOne>
> <textDataTwo>hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world </textDataTwo>
> <sizeTextDataTwo>324 bytes</sizeTextDataTwo>
> </testData>
> </nestedXML>
> Output as follows:
> <?xml version="1.0" encoding="UTF-8"?>
> <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>
>     <line-item><description><nestedXML>
> <testData>
> <textDataOne>hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world </textDataOne>
> <sizeTextDataOne>324 bytes</sizeTextDataOne>
> <textDataTwo>hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world </textDataTwo>
> <sizeTextDataTwo>324 bytes</sizeTextDataTwo>
> </testData>
> </nestedXML></description></line-item><shipper>
>         <name>ZipShip</name>
>         <per-ounce-rate>0.74</per-ounce-rate>
>     </shipper>
> </purchase-order>
> Example code used:
> import java.io.File;
> import java.io.IOException;
> import org.apache.xmlbeans.XmlException;
> import org.apache.xmlbeans.XmlObject;
> import org.openuri.easypo.LineItem;
> import org.openuri.easypo.PurchaseOrderDocument;
> /**
>  * @author
>  *
>  */
> public class XMLBeanTester
> {
> /**
> * @param args
> */
> public static void main(String[] args)
> {
> new XMLBeanTester().testXMLBeans();
> }
>
> public void testXMLBeans()
> {
> File xmlFile = new File("myPO.xml");
> String test_XML_data = "nested_xml.xml";
> try
> {
> PurchaseOrderDocument PODoc = PurchaseOrderDocument.Factory.parse(xmlFile);
> XmlObject xml = XmlObject.Factory.parse(new File(test_XML_data));
> LineItem item = PODoc.getPurchaseOrder().addNewLineItem();
> item.setDescription(xml.xmlText());
> PODoc.save(new File("myNewPO.xml"));
> }
> catch (XmlException e)
> {
> System.out.println("XML Problem:- ");
> e.printStackTrace();
> }
> catch (IOException e)
> {
> System.out.println("IO Problem:- ");
> e.printStackTrace();
> }
> }
> }
> Is this a known bug or I am I missing something fundamental (quite possible!)? Any input will be appreciated as this is now having a serious impact on our project.

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@...
For additional commands, e-mail: dev-help@...


[jira] Assigned: (XMLBEANS-241) Nested XML - CData inconsistencies

by JIRA xmlbeans-dev@xml.apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


     [ https://issues.apache.org/jira/browse/XMLBEANS-241?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Wing Yew Poon reassigned XMLBEANS-241:
--------------------------------------

    Assignee: Cezar Andrei

> Nested XML - CData inconsistencies
> ----------------------------------
>
>                 Key: XMLBEANS-241
>                 URL: https://issues.apache.org/jira/browse/XMLBEANS-241
>             Project: XMLBeans
>          Issue Type: Bug
>          Components: XmlObject
>         Environment: XP Professional
>            Reporter: Keith Daurs
>            Assignee: Cezar Andrei
>            Priority: Critical
>
> Trying to insert XML data into an existing XML document. Success of this operation appears to be dependant on the size of data held in the nested XML child elements. Operation works fine up to a certain size with nested XML correctly wrapped within CDATA. However, if child elements are over a certain size then nested XML is not recognised as CDATA and the <> chars are escaped, causing parsing problems further down the line.
> For an example I have used the EasyPO xsd as provided on the XMLBeans website, and adding the folowing data as my nested XML:
> SUCCESSFUL RUN
> <nestedXML>
> <testData>
> <textDataOne>hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world </textDataOne>
> <sizeTextDataOne>324 bytes</sizeTextDataOne>
> <textDataTwo>hello</textDataTwo>
> <sizeTextDataTwo>5 bytes</sizeTextDataTwo>
> </testData>
> </nestedXML>
> Output as follows:
> <?xml version="1.0" encoding="UTF-8"?>
> <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>
>     <line-item><description><![CDATA[<nestedXML>
> <testData>
> <textDataOne>hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world </textDataOne>
> <sizeTextDataOne>324 bytes</sizeTextDataOne>
> <textDataTwo>hello</textDataTwo>
> <sizeTextDataTwo>5 bytes</sizeTextDataTwo>
> </testData>
> </nestedXML>]]></description></line-item><shipper>
>         <name>ZipShip</name>
>         <per-ounce-rate>0.74</per-ounce-rate>
>     </shipper>
> </purchase-order>
> UNSUCCESSFUL RUN
> <nestedXML>
> <testData>
> <textDataOne>hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world </textDataOne>
> <sizeTextDataOne>324 bytes</sizeTextDataOne>
> <textDataTwo>hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world </textDataTwo>
> <sizeTextDataTwo>324 bytes</sizeTextDataTwo>
> </testData>
> </nestedXML>
> Output as follows:
> <?xml version="1.0" encoding="UTF-8"?>
> <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>
>     <line-item><description><nestedXML>
> <testData>
> <textDataOne>hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world </textDataOne>
> <sizeTextDataOne>324 bytes</sizeTextDataOne>
> <textDataTwo>hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world </textDataTwo>
> <sizeTextDataTwo>324 bytes</sizeTextDataTwo>
> </testData>
> </nestedXML></description></line-item><shipper>
>         <name>ZipShip</name>
>         <per-ounce-rate>0.74</per-ounce-rate>
>     </shipper>
> </purchase-order>
> Example code used:
> import java.io.File;
> import java.io.IOException;
> import org.apache.xmlbeans.XmlException;
> import org.apache.xmlbeans.XmlObject;
> import org.openuri.easypo.LineItem;
> import org.openuri.easypo.PurchaseOrderDocument;
> /**
>  * @author
>  *
>  */
> public class XMLBeanTester
> {
> /**
> * @param args
> */
> public static void main(String[] args)
> {
> new XMLBeanTester().testXMLBeans();
> }
>
> public void testXMLBeans()
> {
> File xmlFile = new File("myPO.xml");
> String test_XML_data = "nested_xml.xml";
> try
> {
> PurchaseOrderDocument PODoc = PurchaseOrderDocument.Factory.parse(xmlFile);
> XmlObject xml = XmlObject.Factory.parse(new File(test_XML_data));
> LineItem item = PODoc.getPurchaseOrder().addNewLineItem();
> item.setDescription(xml.xmlText());
> PODoc.save(new File("myNewPO.xml"));
> }
> catch (XmlException e)
> {
> System.out.println("XML Problem:- ");
> e.printStackTrace();
> }
> catch (IOException e)
> {
> System.out.println("IO Problem:- ");
> e.printStackTrace();
> }
> }
> }
> Is this a known bug or I am I missing something fundamental (quite possible!)? Any input will be appreciated as this is now having a serious impact on our project.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@...
For additional commands, e-mail: dev-help@...