[jdom-interest] Schema Validation Error

Trikannad, Mahesh mahesh.trikannad at capgemini.com
Thu Mar 24 07:14:37 PST 2005


Hi All,



I get the following error, when I do a schema validation.



Error on line 1: Content is not allowed in prolog.



I want through, the jdom archives, but did not get a resolution. Some
say it is a parser problem. Iam using xerces.jar, the one distributed
via the jdom-1.0 distriution.

Some say, it is a windows file encoding problem. I tried saving it ,
with notepad in different formats, that did not work



The XML is as follows



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

<ESBMessage>

      <Header>

            <MessageId>mahesh</MessageId>

            <OrigSys>ICOM</OrigSys>

            <origSubSys>ICOMS1</origSubSys>

      </Header>

      <Body>

                  </Body>

</ESBMessage>



The code for schema validation

-------



SAXBuilder builder =

                                      new
SAXBuilder("org.apache.xerces.parsers.SAXParser", true);


builder.setFeature("http://apache.org/xml/features/validation/schema",
true);


builder.setProperty("http://apache.org/xml/properties/schema/external-no
NamespaceSchemaLocation",


schemaFileName);

           

                                   

                                    Document tmpdoc = builder.build(new
StringReader(myDocument.toString()));

                                    System.out.println("myValidate
Done");



Appreciate your experiences.



Mahesh Trikannad





This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient,  you are not authorized to read, print, retain, copy, disseminate,  distribute, or use this message or any part thereof. If you receive this  message in error, please notify the sender immediately and delete all  copies of this message.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.jdom.org/pipermail/jdom-interest/attachments/20050324/0ea1cc2d/attachment.htm


More information about the jdom-interest mailing list