Re: [xsl] function last() not matching the last element tag

Subject: Re: [xsl] function last() not matching the last element tag
From: "James A. Robinson" <jim.robinson@xxxxxxxxxxxx>
Date: Fri, 26 Jan 2007 09:07:14 -0800
Ross, I think you've hit a bug in that version of xsltproc.  I get the
same results from my xsltproc of the same version, but the version built
into Oxygen, as well as Saxon and Xalan return the 'lastP' as you want.

The folks here have pointed out the better way to proof your application
against changes to the input (e.g., additional elements being added to
the list which are not 'p') is to check for preceeding or following
siblings of the same type.

I'm actually a bit confused about something here, and I hope people
don't mind if I follow this up with a question of my own.  If one
runs

  <xsl:apply-templates/>

that is defined to select all child::node(), right?  Doesn't that
mean it will pick up the whitespace in the example, making it a
sequence of 7 items, three p elements and 4 text() element?

What am I missing? Something w/re to how xsl:template computes
its inner context when it applies the predicate match?

Jim

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
James A. Robinson                       jim.robinson@xxxxxxxxxxxx
Stanford University HighWire Press      http://highwire.stanford.edu/
+1 650 7237294 (Work)                   +1 650 7259335 (Fax)

Current Thread