Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


XML help.

From: akenaton@--------.-- (-----------)
To: NULL
Date: 7/29/2004 1:39:00 AM
Hello,
	I'm trying to create a XML document from a string comming from a C++
program but I got an exception saying:

org.xml.sax.SAXParseException: Element type "DataFromWebServer" is not
declared


Here "DataFromWebServer" is the name of document root node. Here is
the code:

                char cbuf[] = new char[2000];

                //Get the data from the socket.
                m_inputStream.read(cbuf);
                String strdata = new String(cbuf);
                
                //Qt Bug fix: Clean up the strdata.
                String strFinalData = strdata.trim();
                System.out.println(strFinalData);//For debug
               
               InputSource in = new InputSource ((InputStream) new
ByteArrayInputStream (strFinalData.getBytes()));
               XmlDocument xmlDocument =
XmlDocument.createXmlDocument(in, true);


///////////Here is what I got from
System.out.println(strFinalData)///////////

<?xml version = '1.0' encoding = 'UTF-8'?>
<DataFromWebServer>
    <AddresseNode>
        <Addresse>6</Addresse>
    </AddresseNode>
    <DatatypeNode>
        <Datatype>25</Datatype>
    </DatatypeNode>
    <DataNode>
        <data>6</data>
    </DataNode>
</DataFromWebServer>


///////////Here is complete error message////////////////////////////

org.xml.sax.SAXParseException: Element type "DataFromWebServer" is not
declared.
        at org.apache.crimson.parser.Parser2.error(Parser2.java:3354)
        at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1502)
        at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:667)
        at org.apache.crimson.parser.Parser2.parse(Parser2.java:337)
        at org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:448)
        at org.apache.crimson.tree.XmlDocument.createXmlDocument(XmlDocument.java:315)
        at COrusSocketThread.run(COrusSocketThread.java:137)
        at java.lang.Thread.run(Thread.java:534)







Thanks for your help
Alain-Serge


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent