Posted on 2006-02-16 10:56:40-08 by rennard
Entities as attributes ?
How does one insert an entity into an attribute, without XML::Writer converting the & into & ? It seems hardcoded to convert all '&', whether they are part of an entity or not.

It should reference the DTD to find out about known entities, or at least accept a list of entities to not reencode. Or, as I have done, not encode anything that matches /\&\S\;/

Also, XML::Writer is extremely subclassing-hostile - it would be easy enough to subclass it and override the _escapeLiteral method, except the way it's been written it's not easy, and I've ended up having to take a copy of the entire module and hack it. Messy !
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.