Posted on 2009-04-08 15:46:36-07 by schaafb
entity expansion

Our input to $doc=$parser->parse_file (<file>) contains:

<Body>&#x91;hello&#x92;</Body>

A record is read from $doc with findnodes and $record->toString() renders:

<Body>'hello'</Body>

We would like to see the quote entities not expanded and have the following output instead (because of subsequents scripts):
<Body>&#x91;hello&#x92;</Body>

Is it possible to prevent the character entities from being converted in the toString output?
The option $parser->expand_entities(0) doesn't seem to work.
In a Solaris 8 environment this code used to give the desired output. After migrating to Solaris 10, with the same code the character entities are converted.

Direct Responses: Write a response
Perl Weekly newsletter
A free weekly newsletter for people who are busy to read all the blogs. click here to check it out.