[jdom-interest] xml validation against DTD

Madrona, Robert robert.madrona at cgey.com
Tue Dec 10 01:32:31 PST 2002


Hi,
 
I went through the FAQ and I found a post explaining how to proceed to validate the xml instance.
I ran this code using b8 release and I cannot find a way to find if the doc is valid once it is built.
It seems the document is built even if it doesn't comply with the dtd.

Thanks.

Robert

 

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-schemaLocation",
  "http://www.w3.org/2001/12/soap-envelope soap-envelope.xsd" + " " +
  "http://kevinj.develop.com/weblog/weblog.xsd weblog.xsd");
Document doc = builder.build(xml);

assert (doc. ???)

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://jdom.org/pipermail/jdom-interest/attachments/20021210/39444981/attachment.htm


More information about the jdom-interest mailing list