xsl-list
[Top] [All Lists]

Re: numbering

2004-08-24 23:46:29
Hi,

just combine the two previous answers:

XML:

<root>
      <text>one</text>
      <text>two</text>
</root>

XSL (based on example 4 shown at http://www.w3schools.com/xsl/el_number.asp):

<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
<xsl:template match="root">
<html>
<body>
<p>
<xsl:for-each select="text">
  <xsl:number value="position()" format="1.- " />
  <xsl:value-of select="text()" /><br />
</xsl:for-each>
</p>
</body>
</html>
</xsl:template>
</xsl:stylesheet>

HTML:

<html><body><p>1.- one<br>2.- two<br></p></body></html>

Menzo Windhouwer

Dionisio Ruiz de Zárate wrote:

but this bucle is into one for-each
how can i put :
1.-
2.-
3.-
......

?
thanks
----- Original Message ----- From: "Michael Kay" <mhk(_at_)mhk(_dot_)me(_dot_)uk>
To: <xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com>
Sent: Wednesday, August 25, 2004 1:24 AM
Subject: RE: [xsl] numbering


Use <xsl:number format="1.- "/>

Michael Kay

-----Original Message-----
From: Dionisio Ruiz de Zárate [mailto:dionisio(_at_)tinieblas(_dot_)com]
Sent: 24 August 2004 23:34
To: XSL-List(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] numbering

hello
i load the data from one xml file for showing into onw html page with:
<xsl:for-each select="node">
<xsl:value-of select="nodename"/>
</xsl:for-each>

but i want to show the data with one number:
1.- text
2.- text
3.- text

how can i put this number for each nodename (<xsl:value-of
select="nodename"/>)

can anybody helps me?
thanks



--+------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--+--




--+------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--+--





--+------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--+--


--
Menzo Windhouwer, Centre for Mathematics and Computer Science (CWI)
Kruislaan 413, NL 1098 SJ Amsterdam, The Netherlands
url: http://www.cwi.nl/~windhouw/,  e-mail: windhouw(_at_)cwi(_dot_)nl




<Prev in Thread] Current Thread [Next in Thread>