I've got perl v5.6.1 built for i686-linux, it's on slackware. I'm trying to install XML::DOM, which depends on XML::Parser::PerlSAX, which is in lib-xml.

I'm getting an error with test 11 of stream.h (in PerlSAX).

I'm thinking this may be an encoding thing i just don't understand, but here's what i think it is choking on, and my question would be why it's written this way, or why does my setup not do it properly.

The test:

print (($string eq $expected) ? "ok 11\n" : "not ok 11\n");

The $string

$string = $parser->parse(Source => { Encoding => 'ISO-8859-1', String => <<"EOF;" } ); <!DOCTYPE foo [ <!NOTATION bar PUBLIC "qrs"> <!ENTITY zinger PUBLIC "xyz" "abc" NDATA bar> <!ENTITY fran "fran-def"> <!ENTITY zoe "zoe.ent"> ]> <foo> First line in foo <boom>Fran is &fran; and Zoe is &zoe;</boom> <bar id="jack" stomp="jill"> <?line-noise *&*&^&<< ?> 1st line in bar <blah> 2nd line in bar </blah> 3rd line in bar <!-- Isn't this a doozy --> </bar> <zap ref="zing" /> This, '\240', would be a bad character in UTF-8. </foo> EOF;

produces:

<?xml version="1.0" encoding="UTF-8"?> <foo> First line in foo <boom>Fran is fran-def and Zoe is zoe.ent</boom> <bar id="jack" stomp="jill"> <?line-noise *&*&^&<< ?> 1st line in bar <blah> 2nd line in bar </blah> 3rd line in bar <!-- Isn't this a doozy --> </bar> <zap fubar="1" ref="zing"></zap> This, 'Â ', would be a bad character in UTF-8. </foo>

The $expected

$expected = <<"EOF;"; <?xml version="1.0" encoding="UTF-8"?> <foo> First line in foo <boom>Fran is fran-def and Zoe is zoe.ent</boom> <bar id="jack" stomp="jill"> <?line-noise *&*&^&<< ?> 1st line in bar <blah> 2nd line in bar </blah> 3rd line in bar <!-- Isn't this a doozy --> </bar> <zap fubar="1" ref="zing"></zap> This, '\302\240', would be a bad character in UTF-8. </foo> EOF;

produces:

<?xml version="1.0" encoding="UTF-8"?> <foo> First line in foo <boom>Fran is fran-def and Zoe is zoe.ent</boom> <bar id="jack" stomp="jill"> <?line-noise *&*&^&<< ?> 1st line in bar <blah> 2nd line in bar </blah> 3rd line in bar <!-- Isn't this a doozy --> </bar> <zap fubar="1" ref="zing"></zap> This, 'ÃÂ ', would be a bad character in UTF-8. </foo>

the extra character in the 2nd This would be a bad character line is coded in... I'm confused to why it's there.


In reply to XML::Parser::PerlSax ... not passing a simple test by vaevictus

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.