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

If the propper DOCTYPE were to be inserted, would it be the same doctype for all the documents? If so, you could append that line yourself, before you give it to XML::Parser to parse.
  • Comment on Re: Using XML::Parser on a file without a !DOCTYPE line

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 00:59 UTC
    There is a separate dtd file for each of the XML files I need to read, but I do know which dtd file goes with which XML file, so that could work. What do you mean by appending the line before giving the file to the parser? Do you mean to modify the XML file in some way, or to feed the !DOCTYPE line to the parser first and then give the xml file to the parser, or something else? Would it work to call the parser's function that takes a string with the !DOCTYPE line and then call the parser's function that takes a file handle with the XML file? Would the parser apply the dtd file declarations to the XML file if I made these two calls?