Thank you very much for bothering!

I had some problems with XML::Parser:

If it sees unresolvable entities (which I admit is formally an error in the XML document), it calls the default handler regardless of what handlers you have installed. This makes things more difficult, but I could live with it (I already had changed my code accordingly).

The disqualifier is: In a handler, you get the original (unparsed) string by invoking the underlying expat instance via

$_[0] -> original_string

or

$_[0] -> recognized_string

That would be nice and easy in the first place, but in some cases, there is only rubbish in the respective string; this is true for nearly all of the declaration blocks (for example doctype declarations and attribute declarations). The expat documentation is explicitly confirming this observation; unfortunately, it's a thing I can't live with.

As far as I know, XML::Parser always is based on expat, but perhaps, I have misunderstood something. If the latter is the case, I would be grateful if somebody could show me how to use XML::Parser with another underlying parser.

Thank you very much,

Nocturnus


In reply to Re^2: Seeking for advice: XML parsing with special requirements by Nocturnus
in thread Seeking for advice: XML parsing with special requirements [Solved] by Nocturnus

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.