Subject: Re: [xsl] Standards checkers for XSLT|
From: "bryan rasmussen" <rasmussen.bryan@xxxxxxxxx>
Date: Fri, 24 Nov 2006 10:08:11 +0100
Well, we have this document http://www.oio.dk/files/OIXML_XSLT_Guidebook.pdf which basically has both links to online resources and evaluation of those resources(XSL-T 1.0, somewhat out of date, needs to be updated in evaluation of external resources, plus there are some minor faults in some of the explanations) with some general guidelines for usage of particular elements - e.g. standards we would like to see in transformations expected to work in our infrastructure.
I was thinking of taking these out and making a document of rules for transformations provided by third parties because of the need to quality check - nothing cheeses me off more than getting sent something like this:
<xsl:for-each select="elementA"> <div><ol> <xsl:for-each select="@a"> <li>a = <xsl:value-of select="."/></li> </xsl:for-each> <xsl:for-each select="@b"> <li>b = <xsl:value-of select="."/></li> </xsl:for-each> <xsl:for-each select="@c"> <xsl:variable name="cvalue" select="."> <xsl:for-each select="parent::elementA/@b"> <xsl:if test="$cvalue=."><li>C is redundant</li></xsl:if> <xsl:if test="$cvalue!=."><li><xsl:value-of select="$cvalue"/></li></xsl:if> </xsl:for-each> </xsl:for-each> </xsl:for-each> </ol> </div> </xsl:for-each>
please note, actual code received as supposed solutions to problems is worse than this. I'm just paraphrasing the horror.
So does anyone have any standards. Well, personal standards sure, but I guess any official standards for quality are not that well distributed yet (of course there are probably lots of people that have had to work with my code that sit around cursing my date of birth).
Cheers, Bryan Rasmussen
Kamal Bhatt wrote: > Hi > We have a fair bit of XSLT and I would like to start enforcing > standards. I was wondering if anyone knows of any standards checkers > for XSLT/XML. Is anyone using standards checkers for their projects? I > am looking for something that can be run from Ant/Maven, and something > that integrates with Eclipse and Dreamweaver would be nice. In the > past, I have used XSLT's to check XSD files, its is not pretty, so I > would like to avoid this approach (besides, you can't check formatting > with XSLT's). > > If no one has a standards checker, does anyone use any standards? Any tips for formatting, presentation, even best practices.
-- Kamal Bhatt