in reply to Re: XML::Twig and ENTITY declarations
in thread XML::Twig and ENTITY declarations

Hi, the code is actually more than this and I've made a mistake when cutting down an example. So no, I do define and use the same.

Thanks for pointing out the use of parse_param_ent ! Now it works as it should, and access to ENTITY variables is easy. Yes, it ought to be found in the XML::Twig docs.

I've noticed that seemingly it cannot be used along with keep_encoding. In my case, that's fine and I won't bother with using both.

On the other hand, the actual DOCTYPE declaration is not handled at all. I have to remove it (eg. sed it out) from the XML files. That could be a normal thing to do in a way since it directs to an external network resource. I'm not a XML expert.

The following:

<?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [ <!ENTITY % component-entities SYSTEM "components.ent"> %component-entities; ]>

Yields the following error:

cannot expand > - cannot load 'http://www.oasis-open.org/docbook/xml/4 +.5/docbookx.dtd' at /usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thr +ead-multi/XML/Parser/Expat.pm line 469

Whereas the following is all OK:

<?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE sect1 [ <!ENTITY % component-entities SYSTEM "components.ent"> %component-entities; ]>

Thanks.