Re: [xsl] Different results with different processors

Subject: Re: [xsl] Different results with different processors
From: David Carlisle <davidc@xxxxxxxxx>
Date: Thu, 7 Jun 2007 23:37:03 +0100
best to make a complete 6 or 7 line input file and stylesheet that shows
different results, if we can confirm one of them is wrong then you can
post to the appropriate bug channel.


<xsl:apply-templates select="node()[name() != 'bar']" />

<xsl:for-each select="node()[name() != 'bar']">
  <xsl:apply-templates select="." />

thy should select the same nodes, and apply the same templates, they
could give different results as position() an last() are alwas 1 in the
second form, but in the first form position() runs from 1 to last()
which is the number of nodes selected.  So if your template use those
functions the output may be dufferent.

actually comparing against name() in an xslt1 system is implementation
dependent if theer are any namespaces around.

If the elements are in no-namespace then name() will return 'bar'
if and only if  the element name is bar.

However if the element bar is in a namespace but appears unprefixed due
to an xmlns="zzz" declaration, name() probably returns "bar" but it
could return "ns42:bar" or any other prefix it has chosen.  It's
generally better to write the test as node()[not(self::bar)] especially
in the namespace case, as then the behaviour is fully defined.


The Numerical Algorithms Group Ltd is a company registered in England
and Wales with company number 1249803. The registered office is:
Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom.

This e-mail has been scanned for all viruses by Star. The service is
powered by MessageLabs. 

Current Thread