Re: testing xml/xslt with perl?

Michael Ludwig <[email protected]> Sun, 23 Jan 2011 21:13:30 +0100
Newsgroups gmane.comp.lang.perl.xml
Message-ID <20110123201330.GA3176@wladimir>
Moin Vasek,

Vaclav Barta schrieb am 23.01.2011 um 16:41 (+0100):

> I'm testing XML transformations in Perl (not XSLT, but XS on top of
> libxml2) with Test::More, comparing the transformation's result with a
> precomputed value, and it's a pain - different versions of libxml2
> keep changing the generated text (mostly whitespace, but also
> namespace declarations and other "non-semantic" changes), breaking my
> tests. I must admit the pain hadn't been sharp enough to drive me to
> an alternative yet, :-) but if you know any, I certainly would like to
> hear about it...

For starters, try canonicalization:

  xmllint | grep -i canonical

But that's not a real solution, in my view. Rather, use a technology
that's devised for this specific purpose, i.e. probably the assertion
stuff such as Schematron, or even plain XSLT. Again, it all depends on
your specific requirements.

-- 
Michael Ludwig
_______________________________________________
Perl-XML mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs