Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - Re: Is it possible to have array like thing in xslt [Thread Next] Re: Is it possible to have array like thing in xsltTo: NULL Date: 1/9/2009 1:15:00 PM Manish Bafna wrote: > I have only html,javascript,xslt and xml as development tools.That is we are > required to develop using just javascript and xslt In XSLT there are no arrays, you can however pass a node-set around. It is also possible to store data in your stylesheet e.g. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:md="http://example.com/2009/mydata" exclude-result-prefixes="md"> <xsl:output method="html" indent="yes"/> <md:data> <item-list xmlns=""> <item>foo</item> <item>bar</item> <item>baz</item> <item>foobar</item> </item-list> </md:data> <xsl:template match="/"> <html lang="en"> <head> <title>Example</title> </head> <body> <xsl:apply-templates select="document('')/xsl:stylesheet/md:data/item-list"/> </body> </html> </xsl:template> <xsl:template match="item-list"> <ul> <xsl:apply-templates select="item"/> </ul> </xsl:template> <xsl:template match="item"> <li><xsl:value-of select="."/></li> </xsl:template> </xsl:stylesheet> So in that stylesheet document('')/xsl:stylesheet/md:data access the data stored in the stylesheet and you can apply templates to that data or pass it as a parameter to templates. -- Martin Honnen --- MVP XML http://JavaScript.FAQTs.com/ | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
