Re: testing xml/xslt with perl?

Vaclav Barta <[email protected]> Mon, 24 Jan 2011 07:46:24 +0100
Newsgroups gmane.comp.lang.perl.xml
Message-ID <[email protected]>
Hi,

On Sunday 23 January 2011 21:13:30 Michael Ludwig wrote:
> 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.
Well, I think that for XML::DifferenceMarkup, canonicalization would be better 
than assertions - I want to ensure the whole DOM of my diff is as expected, not 
just parts of it. OTOH it's another step which can fail (especially as it's 
using an extra executable)... Is it possible to compare trees in XSLT?

	Bye
		Vasek
--
http://www.mangrove.cz/
Open Source integration
_______________________________________________
Perl-XML mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs