Well, if you define component-entities and then you use general-entities, any software will have trouble figuring out where to get the value you want.
Then indeed you need to remove the doctype declaration, which is probably a bug in XML::Twig, I have to check some more.
Once that's done, you need to use the parse_param_ent option to get the value to be read. That option is undocumented because it's inherited directly from XML::Parser. I'll add the doc about it in XML::Twig.
Once that's done, your file looks like this:
<?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE sect1 [ <!ENTITY % component-entities SYSTEM "component.ent"> %component-entities; ]> <component>Engine-&engine-version;</component>
and you can see how it's processed by doing this:
perl -MXML::Twig -e'XML::Twig->new( parse_param_ent => 1)->parsefile( "ent1.xml")->print'In reply to Re: XML::Twig and ENTITY declarations
by mirod
in thread XML::Twig and ENTITY declarations
by carcassonne
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |