Someone asked a similar question last month [1]. It was regarding XML Schema validation but I assume you cannot do it with DTDs either.
FYI ... The Java version of Xerces provides support for in-memory DOM validation against DTDs and XML Schemas. [1] http://marc.info/?l=xerces-c-users&m=121438422020361&w=2 Michael Glavassevich XML Parser Development IBM Toronto Lab E-mail: [EMAIL PROTECTED] E-mail: [EMAIL PROTECTED] "Daniel Burrell" <[EMAIL PROTECTED]> wrote on 07/20/2008 10:49:05 PM: > As I understand it, when xerces validates an xml against a dtd, the dtd it > validates against is specified in the xml file. > Is it possible to validate an xml file in it's dom form in memory against a > dtd also loaded in memory? > > i.e., I would parse the xml file with validation off into a DOM format. > somehow load the dtd into memory (how would this be done?) > and then validate the dom tree against the dtd? > > Or can you only validate the contents of an xml file as it's being parsed?
