in reply to Using XML::Parser on a file without a !DOCTYPE line

Sounds like you need to install some new handlers for Doctype and DoctypeFin as described here. Can you fake it out with a doctype of your own devising which can handle such cases?

Cheers,
Matt

Replies are listed 'Best First'.
Re^2: Using XML::Parser on a file without a !DOCTYPE line
by moleary (Novice) on Jun 20, 2004 at 01:09 UTC
    In playing around with the XML::Parser, I have found that the Doctype handler is called when the parser finds a !DOCTYPE line and the DoctypeFin handler is called when parser is done processing the !DOCTYPE line. If you specify a dtd file in a !DOCTYPE line, this handler will be called when the parser is done parsing the dtd file. But the XML files I need to work with do not have !DOCTYPE lines, so these handlers would not be called. After reading your reply and the other replier's reply, I am wondering whether I can make two calls to the parser, one in which I pass it a string that consists of a !DOCTYPE line containing the appropriate dtd file, and the second in which I pass it the XML file. Will the parser remember the declarations in the dtd file that it reads in the first call when it is parsing the XML file's contents in the second call?