Validating a DOM against a DTD?

S

Stefan Ram

An XML-document model can be built in-memory using Java and be
associated with a DTD as given in the following article.

http://www.cafeconleche.org/books/xmljava/chapters/ch10s03.html

Can such a model be validated in-memory against that DTD?

I would prefer it to check after every modification if the
modification is valid. No validation at all seems to be done
by the code of the above article. It also accepts element
types not given in the DTD.

(Something that might be related to DTD-validation is found in
the package com.sun.org.apache.xerces.internal.impl.dtd
[possibly as of Java 1.5 or earlier]. But I have no idea how
to apply this to a DOM in memory.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top