xsl-list
[Top] [All Lists]

Re: [xsl] Different results with different processors

2007-06-07 15:37:18
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.

comparing

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

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


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.

David


________________________________________________________________________
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. 
________________________________________________________________________

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>