[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Passing arrays into XSL

Subject: RE: Passing arrays into XSL
From: Deepak <deepak_vn@xxxxxxxxx>
Date: Sat, 25 Feb 2006 11:03:05 -0800 (PST)
passing array to xslt
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[1]<color>
<color>color[2]<color>
<color>color[3]<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[1],color[2]
</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 

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.