Sorry, but at this time your only option is to put Xalan's output back through an XML parser set to validate. I'd recommend using a SAX parser set to validate but to discard the content of the parsed document. I don't know of any way to invoke the Xerces parser's validator directly on a SAX stream, unfortunately, so you're going to pay some overhead for going from Xalan's SAX output to text and back from text to Xerces.
XSLT 2.0, currently a working draft, is currently planning to add some revalidation capability, along with features to help make sure that what you're generating is locally valid to begin with. However, I believe the intent is to revalidate only against XML Schemas, not DTDs. This might be a good reason to consider switching over to schemas, so you're in a better position to take advantage of that capability when it becomes available... though currently schema validation seems to be significantly slower than DTD validation, so while this is "more architected" it's unclear that it will actually be any faster.
______________________________________
Joe Kesselman / IBM Research
- How to test if transformed xml code is compliant with a D... Stefan Geelen
- Joseph Kesselman
