[jdom-interest] Help:How to make JDOM work with validation on?

Nagulapalli, Srinivas Srinivas_Nagulapalli at CINFIN.com
Thu Jul 19 07:42:39 PDT 2001

 Here are the sample files I took from www.w3c.org site's XML primer. It has
 a schema file: ipo.xsd and the sample xml file called ipo.xml.
 And when I used the JDOM API using SAX Parser to simply read and output the
 file _without_ validation, it works fine! But when I turn on validation
 ( by uncommenting the line that has new SAXBuilder(true) in the code), then
 I get the following error:

org.xml.sax.SAXParseException: Element type "ipo:purchaseOrder" is not
declared. 	at
org.apache.crimson.parser.Parser2.error(Parser2.java:3013) 	at
org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1308) 	at
org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:499) 	at
org.apache.crimson.parser.Parser2.parse(Parser2.java:304) 	at
org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:433) 	at
org.jdom.input.SAXBuilder.build(SAXBuilder.java:287) 	at
org.jdom.input.SAXBuilder.build(SAXBuilder.java:682) 	at

 I am surprised because the sample files are from w3c.org site and the java
code I have
 is pretty much the cut down version of sample file from JDOM install. I
 any help, pointers, insights or suggestions.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: ipo.xsd
Type: application/octet-stream
Size: 1704 bytes
Desc: not available
Url : http://jdom.org/pipermail/jdom-interest/attachments/20010719/eaae3bf6/ipo.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ipo.xml
Type: application/octet-stream
Size: 910 bytes
Desc: not available
Url : http://jdom.org/pipermail/jdom-interest/attachments/20010719/eaae3bf6/ipo-0001.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Conduct.java
Type: application/octet-stream
Size: 2373 bytes
Desc: not available
Url : http://jdom.org/pipermail/jdom-interest/attachments/20010719/eaae3bf6/Conduct.obj

More information about the jdom-interest mailing list