[jdom-interest] Validation using XML Schema

Matthias Brauch mb at biss-net.com
Tue Aug 22 13:51:30 PDT 2000


On Tue, 22 Aug 2000 12:35:52 -0400, Christophe D. Laprun wrote:


[...]
>I haven't since an answer to this question and I ran into the same
>problem. I am using a version of JDOM build from CVS at the end of last
>week.

[...]

>Werner Guttmann wrote:
>> 

[...]

>> 
>> results into the below JDOMException being thrown ...
>> 
>> org.jdom.JDOMException: Element type "MarginRequest" must be declared
>> ...
>> 
>> If I run the same xml file through a validating sax parser from the
>> xerces-j-1.1.3 distribution, everything is fine, i.e. no problems are
>> reported.
>> 

[...]

I encountered the same problem with yesterday's version.
(I'm running JDK 1.1.7 on WinNT)

Seems as if its kind of a version problem: when I have the
xerces.jar that comes with XML4J 3.0.1 in my classpath, the
file (personal.xml which also comes with XML4J 3.0.1) parses
correctly.
When I use the (more recent) xerces.jar from the JDOM
distribution, I get the following error:
org.jdom.JDOMException: Error on line 2 of XML document: Element type "personnel
" must be declared.: Error on line 2 of XML document: Element type "personnel" m
ust be declared.
        at org.jdom.input.DOMBuilder.build(DOMBuilder.java)
        at org.jdom.input.DOMBuilder.build(DOMBuilder.java)
        at biss.jdom.JDOMTester.<init>(JDOMTester.java:30)
        at biss.jdom.JDOMTester.main(JDOMTester.java:50)
Root cause: java.io.IOException: Error on line 2 of XML document: Element type "
personnel" must be declared.
        at org.jdom.adapters.XML4JDOMAdapter.getDocument(XML4JDOMAdapter.java)
        at org.jdom.input.DOMBuilder.build(DOMBuilder.java)
        at org.jdom.input.DOMBuilder.build(DOMBuilder.java)
        at biss.jdom.JDOMTester.<init>(JDOMTester.java:30)
        at biss.jdom.JDOMTester.main(JDOMTester.java:50)

Matthias

--
=====================================================================
Matthias Brauch
BISS GmbH, Chaukenweg 12, D-26388 Wilhelmshaven, Germany
Phone: +49/4423/9289/0, Fax: +49/4423/9289/99
EMail: mb at biss-net.com
=====================================================================





More information about the jdom-interest mailing list