Hello all,

I'm still getting a MarshalException being thrown while attempting
To unmarshal an XML document. The error is:

The markup in the document preceding the root element must be
well-formed.
Line : 1
Column : 1

I have tried many many times to correct the XML document's prolog.
I still get the error EVEN with an empty XML document! 

Ie. My project.xml for my test case is:

<?xml version="1.0"?>
<project/>

and it's still giving me the same error!!


The attached file (CastorTest.zip) contains my very simple test case
that includes the Schema, Document, a Simple test case, and a build
file. All
You have to do it drop the xerces.jar, jakarta-regexp-1.2.jar and
castor-0.9.3.9-xml.jar into the same directory and you should be able to
run the batch file 'runCastor.bat' and you'll see what I mean.

Any help would be much appreciated; I'm stumped.

Glenn



Here are my results after running the batch file: 

D:\dev\work\CastorTest>rem Step 1.  locate the XML Schema file

D:\dev\work\CastorTest>set XSD_FILE=project.xsd

D:\dev\work\CastorTest>set DESTINATION_DIR=.

D:\dev\work\CastorTest>set OLD_CLASSPATH=

D:\dev\work\CastorTest>rem Step 2. Invoke the Castor schema compiler to
generate Java classes

D:\dev\work\CastorTest>set
CLASSPATH=castor-0.9.3.9xml.jar;xerces.jar;jakarta-regexp-1.2.jar;.

D:\dev\work\CastorTest>java org.exolab.castor.builder.SourceGenerator -i
project.xsd -dest .

D:\dev\work\CastorTest>rem Step 3. Asuming all went well so far, compile
our newly generated classes

D:\dev\work\CastorTest>pause Press any key to continue...
Press any key to continue . . .

D:\dev\work\CastorTest>rem Step 4. Compile everything

D:\dev\work\CastorTest>set
CLASSPATH=castor-0.9.3.9-xml.jar;xerces.jar;jakarta-regexp-1.2.jar;.;.

D:\dev\work\CastorTest>javac .\*.java
Note: Some input files use or override a deprecated API.
Note: Recompile with -deprecation for details.

D:\dev\work\CastorTest>rem Step 5. Run the program

D:\dev\work\CastorTest>pause Press any key to continue...
Press any key to continue . . .

D:\dev\work\CastorTest>set
CLASSPATH=castor-0.9.3.9-xml.jar;xerces.jar;jakarta-r
egexp-1.2.jar;.;.;.

D:\dev\work\CastorTest>java CastorTest
Marshal Exception:org.xml.sax.SAXException: Parsing Error : 
The markup in the document preceding the root element must be
well-formed.
Line : 1
Column : 1
{file: ; line: 1; column: 1}
Press enter to finish.

Attachment: CastorTest.zip
Description: Zip compressed data

Reply via email to