xsl-list
[Top] [All Lists]

Re: [xsl] position()!=last() works in one env, not in another

2007-02-08 10:52:39
On 2/7/07, G. Ken Holman <gkholman(_at_)cranesoftwrights(_dot_)com> wrote:
You don't show enough of the code to tell.

For example, if your data were:

<test>
  <a/><b/><c/>
</test>

And you did:

 <xsl:apply-templates/>

... with the following match:

<xsl:template match="c">
 <xsl:if test="position()!=last()">
   ...

Then it would return true() because the last node child of <test> is
a text node.  Perhaps you are doing something similar.

Why would XMLSpy return true()?  Perhaps it is incorrectly throwing
away white-space-only text nodes and thinks that the last node child
of <test> is <c/>, which it isn't.  For example, you would get the
same incorrect result using Internet Explorer, since it has a bug
that throws away white-space-only text nodes.  If XMLSpy is using
msxml.dll the same way that Internet Explorer is using it, then you
will get non-conformant behaviour.

You where 100% on the mark.  The apply-template did not have a select
statement, when I added one with only the relavent nodes, it works as
expected.  Thanks for both your help and Michaels help.

Sam

--~------------------------------------------------------------------
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>