This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: newbie How to use "xsl:counter"
- To: "'xsl-list at mulberrytech dot com'" <xsl-list at mulberrytech dot com>
- Subject: RE: newbie How to use "xsl:counter"
- From: Jonathan Marsh <jmarsh at microsoft dot com>
- Date: Wed, 10 May 2000 14:21:10 -0700
- Reply-To: xsl-list at mulberrytech dot com
<xsl:counter> was in the December 1998 XSL Working Draft, but not
implemented in IE5 under the namespace http://www.w3.org/TR/WD-xsl. It was
removed before XSLT was issued as a recommendation under the namespace
http://www.w3.org/1999/XSL/Transform.
- Jonathan Marsh
Microsoft
> -----Original Message-----
> From: Brian Mulder [mailto:mulbum@worldonline.nl]
> Sent: Wednesday, May 10, 2000 12:30 PM
> To: Xsl-List
> Subject: newbie How to use "xsl:counter"
>
>
> Hi list,
>
> have been lurking now for a week.....
>
> got my feet wet on xml and xsl and have a question.
> don't know where to look for the error, looked at the web etc...
>
> found no cure, and i'm simply missing something obvious here
>
> got a book xml document
>
> <?xml version='1.0'?>
> <?xml-stylesheet type="text/xsl" href="count.xsl" ?>
> <book xmlns:HTML="<http://www.w3.org/Profiles/XHTML-transitional>">
> <bookname>
> <bname>Sample XML Counter</bname>
> </bookname>
> <chapter>
> <chaptername>
> <cname>Chapter 1</cname>
> </chaptername>
> <topic>
> <topicname>
> <tname>Introduction</tname>
> </topicname>
> <paragraph>"Yada yada yada", said Elaine</paragraph>
> <stopic>
> <stopicname>
> <stname>Subtopic 1</stname>
> </stopicname>
> <paragraph>"Yada yada yada", said Elaine</paragraph>
> </stopic>
> <stopic>
> <stopicname>
> <stname>Subtopic 2</stname>
> </stopicname>
> <paragraph>"Yada yada yada", said Elaine</paragraph>
> </stopic>
> </topic>
> </chapter>
> </book>
>
> count.xsl:
>
> <xsl:stylesheet xmlns:xsl="<http://www.w3.org/TR/WD-xsl>"
> xmlns:HTML="<http://www.w3.org/Profiles/XHTML-transitional>">
> <xsl:template><xsl:apply-templates/></xsl:template>
> <xsl:template match="text()"><xsl:value-of/></xsl:template>
> <xsl:template match="/">
> <HTML>
> <HEAD>
> <TITLE><xsl:value-of select="parts/tablename/name"/></TITLE>
> </HEAD>
> <BODY>
> </BODY>
> </HTML>
> </xsl:template>
> <xsl:template match="book">
> <xsl:counter-reset name="chaps" />
> <xsl:apply-templates />
> </xsl:template>
>
> <xsl:template match="book/chapter">
> <xsl:text>Chapter </xsl:text>
> <xsl:counter name="chaps" />
> <xsl:counter-increment name="chaps" />
> <xsl:text>:</xsl:text>
> <xsl:apply-templates />
> </xsl:template>
>
> </xsl:stylesheet>
>
> it's giving errors about "can't use xsl:text", if i take the first
> appearance out
> of the xsl sheet then it complains about the next line i
> startt with "xsl:"
>
> so it has something to do with a node within a parent that's
> not matching
> gonna pull my hair out for this. it costed me already more
> then lotsa hours.
>
> anyway thanks for the thoughts
>
> Brian Mulder
>
>
> XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
>
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list