RE: Passing arrays into XSL
Hi, Thanks for the mail. I am bit new to XSL processing. If we can't pass the arrays into XSL, then i hope that we can pass array string as a variable. Say i have an XML file <colors> <color>color<color> <color>color<color> <color>color<color> </colors> And my XSL may looks like <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:variable name="arrayString"> color,color </xsl:variable> <xsl:template match="colors"> <xsl:if test="contains(color,$arrayString)"> <xsl:text> do something</xsl:text> </xsl:if> </xsl:template> </xsl:stylesheet> The above XSL will fail to process to match with multiple values in the array string. So in this case how we can fix the searching problem ? Thanks and regards, Deepak --- Michael Kay <mike@xxxxxxxxxxxx> wrote: > The kinds of object you can pass as the value of an > xsl:param depend on your > processor. The XSLT 1.0 type system includes > node-sets, which you may or may > not be able to supply as an array of nodes, > depending on your processor. > It's unlikely that an XSLT 1.0 processor would > support any other kind of > array. XSLT 2.0 supports sequences of nodes or > atomic values, so it's much > more likely that you will be able to pass, say, an > array of strings or > integers. > > But the best way of passing a complex object as > input to the transformation > is to represent the complex object as XML, because > that's what XSLT is > designed to handle. > > Michael Kay > http://www.saxonica.com/ > > > -----Original Message----- > > From: Deepak [mailto:deepak_vn@xxxxxxxxx] > > Sent: 24 February 2006 13:05 > > To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx > > Subject: Passing arrays into XSL > > > > Hi, > > > > I was wondering is that possible to pass an array > > object to XSL and retreve the values from array. > > > > Do you have any suitable example examplains above > > details ? > > > > Thanks and Regards., > > deepak > > > > __________________________________________________ > > Do You Yahoo!? > > Tired of spam? Yahoo! Mail has the best spam > protection around > > http://mail.yahoo.com > > __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
PURCHASE STYLUS STUDIO ONLINE TODAY!
Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!
Download The World's Best XML IDE!
Accelerate XML development with our award-winning XML IDE - Download a free trial today!
Subscribe in XML format