in reply to XML::LibXML expand_entities always expands entities
Here's an example of how it works:
If called with a true argument, the output will be:#!/usr/bin/perl use strict; use XML::LibXML; my $fh = *DATA; my $parser = XML::LibXML->new(); $parser->expand_entities($ARGV[0]); my $doc = $parser->parse_fh( $fh ); my $root = $doc->getDocumentElement; print $root->toString(1, 1), "\n"; __END__ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE author [ <!ELEMENT author (#PCDATA)> <!ENTITY js "Jo Smith"> ]> <author>&js;</author>
and if called with a false argument, the output is:<author>Jo Smith</author>
<author>&js;</author>
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: XML::LibXML expand_entities always expands entities
by shamu (Acolyte) on May 14, 2008 at 16:54 UTC | |
|
Re^2: XML::LibXML expand_entities always expands entities
by shamu (Acolyte) on May 14, 2008 at 16:54 UTC |