I have XML like so:
<rec name="basic_header" type="template">
<title><pic path="logo"/> <link url="http://www.domain.com/">
+www.domain.com</link></title>
<break type="line"/>
</rec>
I have an XML::Parse constructor like so:
my $parser = XML::Parser->new( 'Handlers' =>
{ Start => $xml_start,
End => $xml_end,
Char => $xml_char,
Default => $xml_char,
},
'NoExpand' => 'TRUE',
);
$parser->parse( $XML );
Where the handlers $xml_start, $xml_end, $xml_char are all anon sub refs-- the routines (for the most part) convert my XML to HTML for output. I've added the NoExpand option since this error, "undefined entity", started appearing. I've also tried point Unparsed and Entity handlers at $xml_char as well. Nothing helps... the error continues to appear. I suppose I could go to the trouble of creating an official DTD for my XML, but the list of entities is HUGE (since they will all be basically lifted from HTML)-- or are there a lot of entities I shouldn't have to define? Either way, how can I retain the entity in the text so that I can pass it along in my output?
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|