Looking at it a bit further, and adding the expand_external_ents option, the following error is returned:

syntax error at line 65, column 0, byte 2841: <![%sgml.features;[ ^ at /usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi/XML/P +arser.pm line 188 at /usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi/XML/P +arser/Expat.pm line 469

So I've looked in Parser.pm at line 188 and put a debug statement to see what could be $arg:

eval { print "DEBUG: arg: $arg\n"; $result = $expat->parse($arg); };

And $arg is in fact a file that starts like:

<!DOCTYPE sect1 [<!-- ................................................ +...................... --> <!-- DocBook XML DTD V4.5 ............................................ +..... --> <!-- File docbookx.dtd ............................................... +..... --> <!-- Copyright 1992-2006 HaL Computer Systems, Inc., O'Reilly & Associates, Inc., ArborText, Inc., Fujitsu Software

And at line 65 of that file is the sgml.features line:

<!-- Enable SGML features ............................................ +..... --> <!ENTITY % sgml.features "IGNORE"> <![%sgml.features;[ <!ENTITY % xml.features "IGNORE"> ]]>

Doing a /usr-wide serach I found that there are several of these files in /share/sgml/docbook/, for instance:

./share/sgml/docbook/xml-dtd-4.5-1.0-33.fc8/docbookx.dtd

Could it be that the XML::Twig error is about such a file being broken ? If I do not care at this stage for any DOCTYPE declaration, can I still use 'straight' ENTITY declarations (w/o the DOCTYPE) so that XML::Twig can actually process them ?

Does this make any sense ;-) ?


In reply to Re: XML::Twig and ENTITY declarations by carcassonne
in thread XML::Twig and ENTITY declarations by carcassonne

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.