Subject: Re: [xsl] Help cleaning up this 1.0 gem From: Abel Braaksma <abel.online@xxxxxxxxx> Date: Sat, 06 Oct 2007 12:28:23 +0200 |
anything with lots of conditional arithemetic expressions is
likely to be easier to maintain in xslt 2 rather than 1, so upgrading
now rather than later should (or could) be considered.
Without being able to run it, yor code sample is rather too long to
grock by eye so cant make too many comments, but beware != any stylesheet
that uses it is liable to strange bugs. In teh cases where != doesn't do
the same thing as not ( = ) then it almost aways does the wrong thing.
<list> <item>test</item> <item>test-wrong</item> </list> <list> <item>test-good</item> </list>
<xsl:value-of select="list/item != list/item" /> <xsl:value-of select="//item != //item" /> <xsl:value-of select="//item[1] != //item[1]" /> <xsl:value-of select="list/item != 'whateverstring' " />
<xsl:value-of select="string(//item) != string(//item)" /> <xsl:value-of select="string(list/item) != string(list/item)" /> <xsl:value-of select="string(list/item) != 'test-wrong' " /> <xsl:value-of select="(//item)[1] != (//item)[1]" />
<xsl:value-of select="list/item != list/item" /> <xsl:value-of select="(list/item)[1] != (list/item)[1]" /> <xsl:value-of select="list[1]/item != list[1]/item" /> <xsl:value-of select="list[1]/item[1] != list[1]/item[1]" />
<xsl:value-of select="list/notexistingnode != list/item" /> <xsl:value-of select="list/notexistingnode[1] != list/item[1]" /> <xsl:value-of select="list/item[10] != list/item[10]" /> <xsl:value-of select="list/item[10] = list/item[10]" /> <xsl:value-of select="list/notexistingnode = list/item[1]" /> <xsl:value-of select="list/notexistingnode > list/item[1]" /> <xsl:value-of select="list/notexistingnode < list/item[1]" /> <xsl:value-of select="list/item[10] >= list/item[10]" />
Cheers, -- Abel Braaksma
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Help cleaning up this 1.0, David Carlisle | Thread | Re: [xsl] Help cleaning up this 1.0, Andrew Welch |
Re: [xsl] Transforming RDF with XSL, M. David Peterson | Date | Re: [xsl] Help cleaning up this 1.0, Andrew Welch |
Month |