Subject: Re: [xsl] LimitPredicate From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx> Date: Sat, 07 Aug 2004 10:37:48 -0400 |
I am having trouble detecting specific nodes in a node-set ... I mean can i write something like select"ITEM[position() mod 3 = 1](4) to select just the fourth node among the particular nodes.
t:\ftemp>type manousos.xml <ITEMS> <ITEM>1</ITEM> <ITEM>2</ITEM> <ITEM>5</ITEM> <ITEM>7</ITEM> <ITEM>2</ITEM> <ITEM>5</ITEM> <ITEM>10</ITEM> <ITEM>2</ITEM> <ITEM>5</ITEM> <ITEM>15</ITEM> <ITEM>2</ITEM> <ITEM>5</ITEM> <ITEM>17</ITEM> <ITEM>2</ITEM> <ITEM>5</ITEM> </ITEMS>
t:\ftemp>type manousos.xsl <?xml version="1.0" encoding="iso-8859-1"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template match="ITEMS"> <xsl:value-of select="ITEM[position() mod 3 = 1][4]"/> </xsl:template>
</xsl:stylesheet> t:\ftemp>saxon manousos.xml manousos.xsl 15 t:\ftemp>
-- World-wide on-site corporate, govt. & user group XML/XSL training. G. Ken Holman mailto:gkholman@xxxxxxxxxxxxxxxxxxxx Crane Softwrights Ltd. http://www.CraneSoftwrights.com/s/ Box 266, Kars, Ontario CANADA K0A-2E0 +1(613)489-0999 (F:-0995) Male Breast Cancer Awareness http://www.CraneSoftwrights.com/s/bc Legal business disclaimers: http://www.CraneSoftwrights.com/legal
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] LimitPredicate, David Carlisle | Thread | Re: [xsl] LimitPredicate, mankar |
[xsl] LimitPredicate, mankar | Date | Re: [xsl] LimitPredicate, mankar |
Month |