NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.
All the Perl that's Practical to Extract and Report
Stories, comments, journals, and other submissions on use Perl; are Copyright 1998-2006, their respective owners.
Looks proper enough… (Score:1)
Apart from the weird 'eval' (toStringC14N is defined in XML::LibXML::Node, so anything that's part of a XML::LibXML document should have it), it doesn't look "humiliating".
You can create a quotient of all XML (text) representations by putting in the same class those that produce the same DOM (internal) representation; you want to see if two nodes fall into the same equivalence class. Canonicalization is a way to produce a representative of the class, so comparing two canonicalized representation of DOM subt
Re: (Score:2)
The eval is there because I kept hitting nodes which would have that method defined, but I get this error:
I don't know what's causing that, but the eval protects against it.
Re:Looks proper enough... (Score:1)
Looking through the source code of libxml2, it looks like it's caused by nodes that have no textual content: the xmlC14NDocDumpMemory function (used by toStringC14N) does not set its "output buffer" parameter if the buffer would be empty.
Strange behaviour, I'd call it a bug, or at least a documentation deficiency.
Reply to This
Parent
Re: (Score:2)
Thanks for digging into this. I've included the URL of this discussion in our code base so people have a clue what that weird eval is for.