OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [xml-dev] Variables in XSL!


> Is it possible to have variables/counters
> in XSL, like in vbscript: i=i+1 etc?.

Not like that, no. You can assign values to "variables" but then you cannot
change the value once you have set it (in the current scope).

> I would like to keep track of when the 10th value comes and then
> do a line break...

Something like this will do the trick.

<xsl:for-each select="/MyElements">
  <xsl:if test="position()=10">
    <br />

In order to actually maintain variables you have to convert the template to
operate recursively and then you can use the output.

Jeff Rafter
Defined Systems
XML Development and Developer Web Hosting