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

RE: separate white space and show in combo individuall

Subject: RE: separate white space and show in combo individually
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Thu, 12 Feb 2009 12:24:40 -0000
RE:  separate white space and show in combo individuall
In XSLT 2.0 use

<xsl:for-each select="tokenize($in, ' ')">
  <option><xsl:value-of select="."/></option>
</xsl:for-each> 

In XSLT 1.0 it's more difficult but it's been done before so you don't need
to do it again; download the str:tokenize template from www.exslt.org and
incorporate it into your code.

Michael Kay
http://www.saxonica.com/

> -----Original Message-----
> From: himanshu padmanabhi [mailto:himanshu.padmanabhi@xxxxxxxxx] 
> Sent: 12 February 2009 12:06
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  separate white space and show in combo individually
> 
> Perl code
> 
> <CODE>
> $str=$in{'values_separated_by_space'};
> my $results = $stylesheet->transform($source, arg  => 
> "'$str'",val => "'1'"); </CODE>
> 
> "$arg" contains any number of space separated values say 
> "abcd pqrwr xyz dd3 24322" and I want these values in a combo 
> box individually using xsl file.What should I do?
> 
> I only know this much code..:(
> 
> <xsl:for-each select=(till values are there)>  <select>
>      <option>
>            <xsl:value-of select="substring-before($arg, ' ')"/>
>      </option>
>  </select>
> </xsl:for-each>

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.