W3C home > Mailing lists > Public > xsl-editors@w3.org > April to June 2001

Re: a deficiency in xslt (xpath?)

From: Steve Muench <Steve.Muench@oracle.com>
Date: Mon, 25 Jun 2001 06:13:21 -0700
Message-ID: <001901c0fd78$9ba02340$cc672382@SMUENCHLAP>
To: "Matthew Bentley" <matthew.bentley@brookers.co.nz>, <xsl-editors@w3.org>
Matthew,

This should already work, and does in the XPath implementations
I just tested.

Given an input document like:

<document>
    <part>
    <chapter id="A"/>
    <chapter id="B"/>
    <chapter id="C"/>
  </part>
  <part>
    <chapter id="W"/>
    <chapter id="X"/>
  </part>
  <part>
    <chapter id="Y" />
    <chapter id="Z" />
  </part>
</document>

test.xml> (document//chapter)[last()]

Returns:

<chapter id="Z"/>


______________________________________________________________
Steve Muench, Lead XML Evangelist & Consulting Product Manager
BC4J & XSQL Servlet Development Teams, Oracle Rep to XSL WG
Author "Building Oracle XML Applications", O'Reilly
http://www.oreilly.com/catalog/orxmlapp/

----- Original Message -----
From: "Matthew Bentley" <matthew.bentley@brookers.co.nz>
To: <xsl-editors@w3.org>
Sent: Sunday, June 24, 2001 21:07
Subject: a deficiency in xslt (xpath?)


| Hi,
| I would recommend that in a future version of XSLT, allowance be made for
| expressions like 'select="(document//chapter)[last()]"'
| i.e select the last chapter element descendant of document.
| At the moment all you can do is 'select="document//chapter[last()]"',
which
| selects the last chapter under any given parent under document i.e returns
| multiple results in the following situation:
| <document>
| <part>
| <chapter />
| <chapter />
| <chapter />
| </part>
| <part>
| <chapter />
| <chapter />
| </part>
| <part>
| <chapter />
| <chapter />
| </part>
| </document>
| This is very limiting in many situations-
| Cheers,
| M@
|
Received on Monday, 25 June 2001 09:14:34 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 7 December 2009 10:59:52 GMT