Subject: RE: Creating JavaScript recursively
From: "Passin, Tom" <tpassin@xxxxxxxxxxxx>
Date: Tue, 21 Oct 2003 14:45:25 -0400
|
[Jonny Pony]
> I want to dynamically create JavaScript with my xsl document
> from an xml
> document.
> The xsl should recursively go through the xml and create the
> JavScript
> described below.
>
[code snipped]
The javascript you want does not seem to be recursive. It looks like
each node element becomes a javascript function call. If that is
correct, you can probably get what you want using something like
xsl:apply-templates select='//node'/>
Normally I do not favor using "//", but in this case it will pick up all
the nodes in document order. Alternatively - if you decided to use
recursion after all - you could use
<xsl:template match='node'>
... do things here ....
<xsl:apply-templates select='node'/>
</xsl:template>
This would recursively pick up all child nodes.
Cheers,
Tom P
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|