scotth has asked for the wisdom of the Perl Monks concerning the following question:
All,
I have an XML document with an external parameter entity in the doctype. When I use toString on the XML::LibXML document object, this entity is being expanded in the doctype. Is there any way to turn expansion off on such entities? I am alreadying turning off the expand_entities option, and it works throughout the rest of the document, but this seems not to impact the the doctype tag.
Here is some sample XML, demonstrating what I am talking about:
<?xml version="1.0" standalone="no"?> <!DOCTYPE student [ <!ENTITY % student SYSTEM "http://www.university.com/student.dtd"> %student; ]>
Using the provided example, "%student;" is being replaced by the contents of the entity when I print out the document. I would like to be able to print the doctype tag in the same format that it was provided (i.e. unexpanded).
Here are the parameters that I am passing to the LibXML parser:
$parser->line_numbers(1); $parser->validation(0); $parser->load_ext_dtd(1); $parser->expand_entities(0);
Please let me know if there is any other information that I could provide that would prove useful, and thanks for your consideration.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Suppressing XML::LibXML External Parameter Entity Expansion
by ikegami (Patriarch) on Mar 29, 2010 at 21:27 UTC | |
by scotth (Initiate) on Mar 30, 2010 at 13:42 UTC | |
|
Re: Suppressing XML::LibXML External Parameter Entity Expansion
by scotth (Initiate) on Apr 06, 2010 at 12:19 UTC | |
|
Re: Suppressing XML::LibXML External Parameter Entity Expansion
by Anonymous Monk on Mar 14, 2013 at 23:49 UTC |