You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@xmlbeans.apache.org by Stéphane Rault <ks...@yahoo.fr> on 2005/01/25 16:06:08 UTC
[XmlBeans V2] [BUG ?] Unexpected element: CDATA
Hello developers !
My first bug have forced me to switch to xmlbeans V2 but I'm afraid I've
a problem again.
When i parse my file with xmlbeans (10/01/2005) I catch this exception :
org.apache.xmlbeans.XmlException: error: Unexpected element: CDATA
at
org.apache.xmlbeans.impl.newstore2.Locale$SaxLoader.load(Locale.java:2783)
at org.apache.xmlbeans.impl.newstore2.Locale.parse(Locale.java:626)
at
org.apache.xmlbeans.impl.newstore2.Locale.parseToXmlObject(Locale.java:611)
at
org.apache.xmlbeans.impl.newstore2.Locale.parseToXmlObject(Locale.java:605)
at
org.apache.xmlbeans.impl.schema.SchemaTypeLoaderBase.parse(SchemaTypeLoaderBase.java:201)
at
fr.cedi.eai.configuration.beans.counter.CountersDocument$Factory.parse(Unknown
Source)
at
fr.cedi.eai.configuration.ApplicationParameters.getNextCounterValue(ApplicationParameters.java:204)
at test.CounterTest.main(CounterTest.java:26)
Caused by: org.xml.sax.SAXParseException: Unexpected element: CDATA
at
org.apache.xmlbeans.impl.piccolo.xml.Piccolo.reportFatalError(Piccolo.java:1000)
at
org.apache.xmlbeans.impl.piccolo.xml.Piccolo.reportFatalError(Piccolo.java:987)
at
org.apache.xmlbeans.impl.piccolo.xml.Piccolo.yyerror(Piccolo.java:1301)
at
org.apache.xmlbeans.impl.piccolo.xml.Piccolo.yyparse(Piccolo.java:1400)
at org.apache.xmlbeans.impl.piccolo.xml.Piccolo.parse(Piccolo.java:699)
to my mind, my file is OK with its schema.
Here is my schema :
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsd:schema
targetNamespace="http://dufourrault/counter"
xmlns="http://dufourrault/counter"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified"
attributeFormDefault="unqualified">
<xsd:element name="counters">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="counter" type="descCounter"
maxOccurs="unbounded" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:complexType name="descCounter">
<xsd:sequence>
<xsd:element name="mnemonic" type="xsd:string" />
<xsd:element name="increment" type="xsd:integer" />
<xsd:element name="lastValueUsed" type="xsd:long" />
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
and here is my test File
<?xml version="1.0" encoding="ISO-8859-1"?>
<counters xmlns="http://dufourrault/counter"
xmlns:xsi="http://www.w3.org/2000/10/XMLSchema-instance"
xsi:schemaLocation="http://dufourrault/counter c:\temp\schemaCounter.xsd">
<counter>
<mnemonic>stefMnemo</mnemonic>
<increment>1</increment>
<lastValueUsed>12</lastValueUsed>
</counter>
</counters>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org
Re: [XmlBeans V2] [BUG ?] Unexpected element: CDATA
Posted by Stéphane Rault <ks...@yahoo.fr>.
Dave Harrison wrote:
> Stéphane,
>
> I'm not sure if this is your problem but I get the same exception if I
> add bare text after the closing element of a document. For example:
>
<snip>
> Are you sure there's nothing appended to your file?
Yes, I've verified that too :-)
>
> Also, the developers can be found and dev@xmlbeans.apache.org (but I
> hope they read this list too!).
I'm sure they read this list, they've already helped me !
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org
Re: [XmlBeans V2] [BUG ?] Unexpected element: CDATA
Posted by Dave Harrison <da...@stacker.me.uk>.
Stéphane,
I'm not sure if this is your problem but I get the same exception if I
add bare text after the closing element of a document. For example:
<?xml version="1.0" encoding="ISO-8859-1"?>
<counters xmlns="http://dufourrault/counter"
xmlns:xsi="http://www.w3.org/2000/10/XMLSchema-instance"
xsi:schemaLocation="http://dufourrault/counter c:\temp\schemaCounter.xsd">
<counter>
<mnemonic>stefMnemo</mnemonic>
<increment>1</increment>
<lastValueUsed>12</lastValueUsed>
</counter>
</counters>This_shouldnt_be_here
Are you sure there's nothing appended to your file?
Also, the developers can be found and dev@xmlbeans.apache.org (but I
hope they read this list too!).
Hope that helps.
Dave H.
Stéphane Rault wrote:
> Hello developers !
>
> My first bug have forced me to switch to xmlbeans V2 but I'm afraid
> I've a problem again.
>
> When i parse my file with xmlbeans (10/01/2005) I catch this exception :
>
> org.apache.xmlbeans.XmlException: error: Unexpected element: CDATA
> at
> org.apache.xmlbeans.impl.newstore2.Locale$SaxLoader.load(Locale.java:2783)
>
> at org.apache.xmlbeans.impl.newstore2.Locale.parse(Locale.java:626)
> at
> org.apache.xmlbeans.impl.newstore2.Locale.parseToXmlObject(Locale.java:611)
>
> at
> org.apache.xmlbeans.impl.newstore2.Locale.parseToXmlObject(Locale.java:605)
>
> at
> org.apache.xmlbeans.impl.schema.SchemaTypeLoaderBase.parse(SchemaTypeLoaderBase.java:201)
>
> at
> fr.cedi.eai.configuration.beans.counter.CountersDocument$Factory.parse(Unknown
> Source)
> at
> fr.cedi.eai.configuration.ApplicationParameters.getNextCounterValue(ApplicationParameters.java:204)
>
> at test.CounterTest.main(CounterTest.java:26)
> Caused by: org.xml.sax.SAXParseException: Unexpected element: CDATA
> at
> org.apache.xmlbeans.impl.piccolo.xml.Piccolo.reportFatalError(Piccolo.java:1000)
>
> at
> org.apache.xmlbeans.impl.piccolo.xml.Piccolo.reportFatalError(Piccolo.java:987)
>
> at
> org.apache.xmlbeans.impl.piccolo.xml.Piccolo.yyerror(Piccolo.java:1301)
> at
> org.apache.xmlbeans.impl.piccolo.xml.Piccolo.yyparse(Piccolo.java:1400)
> at
> org.apache.xmlbeans.impl.piccolo.xml.Piccolo.parse(Piccolo.java:699)
>
> to my mind, my file is OK with its schema.
>
>
> Here is my schema :
> <?xml version="1.0" encoding="ISO-8859-1"?>
> <xsd:schema
> targetNamespace="http://dufourrault/counter"
> xmlns="http://dufourrault/counter"
> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> elementFormDefault="qualified"
> attributeFormDefault="unqualified">
>
> <xsd:element name="counters">
> <xsd:complexType>
> <xsd:sequence>
> <xsd:element name="counter" type="descCounter"
> maxOccurs="unbounded" />
> </xsd:sequence>
> </xsd:complexType>
> </xsd:element>
>
> <xsd:complexType name="descCounter">
> <xsd:sequence>
> <xsd:element name="mnemonic" type="xsd:string" />
> <xsd:element name="increment" type="xsd:integer" />
> <xsd:element name="lastValueUsed" type="xsd:long" />
> </xsd:sequence>
> </xsd:complexType>
>
> </xsd:schema>
>
> and here is my test File
>
> <?xml version="1.0" encoding="ISO-8859-1"?>
> <counters xmlns="http://dufourrault/counter"
> xmlns:xsi="http://www.w3.org/2000/10/XMLSchema-instance"
> xsi:schemaLocation="http://dufourrault/counter
> c:\temp\schemaCounter.xsd">
> <counter>
> <mnemonic>stefMnemo</mnemonic>
> <increment>1</increment>
> <lastValueUsed>12</lastValueUsed>
> </counter>
> </counters>
>
>
>
> ---------------------------------------------------------------------
> 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