xmlbeans-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Asaf Lahav <asaf.la...@primagrid.com>
Subject FW: SchemaDocument parse problem
Date Sun, 03 Sep 2006 16:21:53 GMT
Hi all,

 

I am attempting to use the SchemaDocument factory parse function, an get the
following exception:

 

org.apache.xmlbeans.XmlException: error: Unexpected element: CDATA

      at
org.apache.xmlbeans.impl.store.Locale$SaxLoader.load(Locale.java:3386)

      at org.apache.xmlbeans.impl.store.Locale.parse(Locale.java:703)

      at
org.apache.xmlbeans.impl.store.Locale.parseToXmlObject(Locale.java:687)

      at
org.apache.xmlbeans.impl.store.Locale.parseToXmlObject(Locale.java:674)

      at
org.apache.xmlbeans.impl.schema.SchemaTypeLoaderBase.parse(SchemaTypeLoaderB
ase.java:208)

      at
org.apache.xmlbeans.impl.xb.xsdschema.SchemaDocument$Factory.parse(SchemaDoc
ument.java:757)

      at network.Sg.loadSchema(Sg.java:74)

      at network.Sg.generateServiceDescriptionArtifacts(Sg.java:84)

      at network.Sg.Publish(Sg.java:251)

      at network.unittests.SgTest.test (SgTest.java:69)

      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

      at java.lang.reflect.Method.invoke(Unknown Source)

      at junit.framework.TestCase.runTest(TestCase.java:154)

      at junit.framework.TestCase.runBare(TestCase.java:127)

      at junit.framework.TestResult$1.protect(TestResult.java:106)

      at junit.framework.TestResult.runProtected(TestResult.java:124)

      at junit.framework.TestResult.run(TestResult.java:109)

      at junit.framework.TestCase.run(TestCase.java:118)

      at junit.framework.TestSuite.runTest(TestSuite.java:208)

      at junit.framework.TestSuite.run(TestSuite.java:203)

      at junit.textui.TestRunner.doRun(TestRunner.java:116)

      at junit.textui.TestRunner.doRun(TestRunner.java:109)

      at junit.textui.TestRunner.run(TestRunner.java:72)

      at junit.textui.TestRunner.run(TestRunner.java:57)

      at network.unittests.Test.main(SgTest.java:29)

Caused by: org.xml.sax.SAXParseException: Unexpected element: CDATA

      at
org.apache.xmlbeans.impl.piccolo.xml.Piccolo.reportFatalError(Piccolo.java:1
038)

      at
org.apache.xmlbeans.impl.piccolo.xml.Piccolo.parse(Piccolo.java:723)

      at
org.apache.xmlbeans.impl.store.Locale$SaxLoader.load(Locale.java:3354)

      ... 26 more

 

The code I'm using is very simple:

private static SchemaDocument loadSchema() throws XmlException{

                        

return SchemaDocument.Factory.parse("C:\\test\\MetadataFileSystem\\PO.xsd");

}

 

The schema I'm using is simple also:

<?xml version="1.0" encoding="UTF-8"?>

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:ns1="http://www.pg.com/test/purchaseorder"
targetNamespace="http://www.pg.com/test/purchaseorder"
elementFormDefault="qualified" attributeFormDefault="unqualified">

            <xs:element name="PO">

                        <xs:complexType>

                                    <xs:sequence>

                                                <xs:element name="id"
type="xs:string"/>

                                                <xs:element name="name"
type="xs:QName"/>

                                    </xs:sequence>

                        </xs:complexType>

            </xs:element>

</xs:schema>

 

 

Any help would be appreciated.

 

Thanks in advance,

Asaf

 


Mime
View raw message