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?

In reply to Re^2: Using XML::Parser on a file without a !DOCTYPE line by moleary
in thread Using XML::Parser on a file without a !DOCTYPE line by moleary

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.