Bruce Miller <bruce miller nist gov> writes:
Rich Salz wrote:This would seem to be an important cleanup operation, even if it isn't fast, since you pay for the excess declarations everytime you use the resulting document.Look at the C14N (canonicalization) code that is part of the library. It handles things like duplicate xmlns declarations. (It also does more, like re-ordering attributes, etc., that you might *not* want, but the semantic information is not changed.)Ah, interesting...that spelling hadn't occurred to me :> And in fact there already _is_ a binding to it in XML::LibXML!! But it does do _quite_ a bit more than I had really wanted! It drops the XML declaration & doctype, converts empty elements and canonicallizes all space (& newlines). Still, it's probably better than dealing with the declarations. Thanks a lot for the pointer.
Maybe I'm wrong, but isn't C14N only a method of serializing a document tree? If yes, then a function that would do the NS cleanup directly on a live tree would still be very useful. -- Petr Pajas
/r$ -- Rich Salz Chief Security Architect DataPower Technology http://www.datapower.com XS40 XML Security Gateway http://www.datapower.com/products/xs40.html XML Security Overview http://www.datapower.com/xmldev/xmlsecurity.html-- bruce miller nist gov http://math.nist.gov/~BMiller/ _______________________________________________ xml mailing list, project page http://xmlsoft.org/ xml gnome org http://mail.gnome.org/mailman/listinfo/xml
--
Attachment:
pgpHGKab83uaw.pgp
Description: PGP signature