[jdom-interest] Re: Problem while validating
Hans Prüller
hans.prueller at igs.at
Tue Dec 18 00:03:01 PST 2001
Hi guys,
regarding to validation errors on valid files, I think this isn't a jdom
problem, but
a problem of the xml-parser behind.
I've got a similar problem on validating xml-files against schemas:
Like Pierre's situation, the files are validated as correct by XMLSpy 4.0.1
but
when parsing the files with a validating SAXBuilder in JDOM, I got
validation
errors (especially with the xsd:any element, ...)
I expect this to be a problem of Xerces 1.4.3 I'm using and hope, this
will be solved in a future release.
What do you think about this??
Hans
>Hi !
>
>I am trying to validate an XML document using :
>
> SAXBuilder builder = new SAXBuilder(true);
> document = builder.build(new StringReader(xmlDocument));
>
>I know the DTD is found because if I do not validate, I get an error
saying
>that entities are not declared. However, if I validate, I get no error
>regarding entities, but I get a JDOMException with the message :
>
>Error on line 1: Element type "document" must be declared.
>
>("document" is the name of the root element) This seems to indicate that
the
>root element is not defined. However, it is defined and the file is
>validated without any problem by IE5 or XMetal.
>
>Any idea ?
>
>Pierre-Yves
>
More information about the jdom-interest
mailing list