17-Dec-2015 07:51

Validating xml against dtd Chat rooms on tights no registration

Alternatively if you use Stax for writing content (or a library that uses or can use stax), Woodstox also directly support validation when using XMLStream Writer.Here's a blog entry showing how that is done: Hey Stax Man, are there any XMLStream Writers that do pretty-print indenting?

It has built-in support for schema validation, and can convert Java objects to an XML document and vice-versa. In debian squeeze it is located in the package "libxerces-c-samples". As far as libraries goes, pretty much the de-facto standard is Xerces2 which has both C++ and Java versions.

Castor and JAXB are other Java libraries that serve a similar purpose to XMLBeans. The definition of the dtd and xsd has to be in the xml! Be fore warned though, it is a heavy weight solution.

But then again, validating XML against XSD files is a rather heavy weight problem.

As for a tool to do this for you, XMLFox seems to be a decent freeware solution, but not having used it personally I can't say for sure.

One more answer: since you said you need to validate files you are generating (writing), you might want to validate content while you are writing, instead of first writing, then reading back for validation.

Search for validating xml against dtd:

validating xml against dtd-10validating xml against dtd-59

You can probably do that with JDK API for Xml validation, if you use SAX-based writer: if so, just link in validator by calling 'Validator.validate(source, result)', where source comes from your writer, and result is where output needs to go.

Leave a Reply

Your email address will not be published. Required fields are marked *

One thought on “validating xml against dtd”

  1. I dreamed of a life of love and as soon as we started to date, it seemed my dreams were coming true. I finished college and went to law school and he worked to support us. Any friends we still had were mostly single or just beginning to think about marriage.