RE: newbie How to use "xsl:counter"

Subject: RE: newbie How to use "xsl:counter"
From: "Brian Mulder" <mulbum@xxxxxxxxxxxxxx>
Date: Thu, 11 May 2000 06:55:39 +0200
thanks for the responses

i'm using the XSL Tester that can be downloaded from www.vbxml.com and it
uses IE 5 to confirm the XSL.

i've been looking at their site and found the XSLT reference, to comprehense
my understanding and making things a bit cleaner i've made the next sheet

<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl";>

<xsl:template match="book">
    <HTML>
      <HEAD>
	<TITLE></TITLE>
      </HEAD>
	<BODY><xsl:value-of name="chapter"/></BODY>
     </HTML>
</xsl:template>

<xsl:template match="book">
	xsl:number count name="chapter"
</xsl:template>

</xsl:stylesheet>

xsl:counter is indeed not used anymore as pointed out by Jonathan and
Wendell. so i replaced it by "number"  and "count", i hope i understand
this in the right way.

if i make the call in the body to display the count of the number of
chapters
in the xml document "book" it display nothing. all i want to do is display
in the
body the number of chapter for example, if i got that, counting the other
properties is quite the same.

Regards
Brian.

-----Oorspronkelijk bericht-----
Van: owner-xsl-list@xxxxxxxxxxxxxxxx
[mailto:owner-xsl-list@xxxxxxxxxxxxxxxx]Namens John Robert Gardner
Verzonden: woensdag 10 mei 2000 22:10
Aan: Xsl-List
Onderwerp: Re: newbie How to use "xsl:counter"



Okay, with trepidation, I suggest the questions, why "<", ">" in your
xmlnx declarations?  remove them from inside the quotes and see how it
behaves, I'm also curious why there is not "match=" on your first
template.  Don't you mean to match "/" ?

It's also not clear the context node for your "match="text()"" - cf. the
preceding absence of a mtach= statement.

=-=-=-=-=-=-=-=-=-==-=-=-=
John Robert Gardner, Ph.D.
XML Engineer
Emory University
------------------------------------------------------------
http://vedavid.org/diss/
"If there is something you're thinking of doing, or wish you could do,
begin it.  In boldness there is mystery and power . . . . "  -Goethe

On Wed, 10 May 2000, Brian Mulder wrote:

> Hi list,
>
> 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


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread