[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: position()!=last() works in one env, not in anothe

Subject: Re: position()!=last() works in one env, not in another
From: "Sam Carleton" <scarleton@xxxxxxxxx>
Date: Thu, 8 Feb 2007 12:52:19 -0500
Re:  position()!=last() works in one env
On 2/7/07, G. Ken Holman <gkholman@xxxxxxxxxxxxxxxxxxxx> 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

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2011 All Rights Reserved.