Greens
Greens

Reputation: 3067

XSLT pass array of Integers

Hos do I pass array of Integers as a params to XSLT?

Upvotes: 1

Views: 4267

Answers (2)

Rashmi Pandit
Rashmi Pandit

Reputation: 23828

You can pass it in an xml format. That would make processing in the xslt easier too.

<array>
 <int>23</int>
 <int>45</int>
</array>

You can then process it in your xslt as:

<xsl:param name="intArray" />
...
...
<xsl:template match="/">
 ...
 <xsl:for-each select="$intArray/int">
  <!-- Process int array -->
  ...
  ...
 </xsl:for-each>
</xsl:template>

Upvotes: 3

Varun Mahajan
Varun Mahajan

Reputation: 7297

Convert it into comma-separated string

Upvotes: 0

Related Questions