W3C home > Mailing lists > Public > xsl-editors@w3.org > January to March 1999


From: TAMURA Kent <kent@trl.ibm.co.jp>
Date: Thu, 18 Feb 1999 14:33:42 +0900
Message-Id: <199902180533.OAA20898@ns.trl.ibm.com>
To: xsl-editors@w3.org
I propose new PositionExpr `nth-of-type(n)' for XSL.  The result
of nth-of-type(n) is true if the context node is an element and
placed at n-th position in the same element type.

It is required for converting from poor-described tag sets. For
example, if I wanted to convert from Doc-A(see below) to Doc-B,
I wrote a templete like Temp-A. I couldn't find how to select
"2nd td element" in current XSL draft.

Temp-A ----------------------------------------------------------------
<xsl:template match="tr">
  <title><xsl:value-of select="td[first-of-type()]"/></title>
  <uri><xsl:value-of select="td[*** Select 2nd td element! ***]"/></uri>
  <date><xsl:value-of select="td[last-of-type()]"/></date>
Doc-A ----------------------------------------------------------------
  <td>Extensible Markup Language (XML) 1.0</td>
  <td>Document Object Model (DOM) Level 1</td>

Doc-B  ----------------------------------------------------------------
  <title>Extensible Markup Language (XML) 1.0</title>
  <title>Document Object Model (DOM) Level 1</title>


TAMURA, Kent  @ Tokyo Research Laboratory, IBM Japan
Received on Thursday, 18 February 1999 00:33:56 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:44:16 UTC