xsl-list
[Top] [All Lists]

RE: [xsl] separate white space and show in combo individually

2009-02-17 04:21:27

Ohhh.........then can I switch to some other more enhanced 
package than LibXSLT supporting XSLT 2.0.

Yes, you can use Saxon. Except that there's no direct way of calling it from
Perl, because it's Java based. So it depends on the constraints of your
processing environment.

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


On Thu, Feb 12, 2009 at 8:03 PM, Michael Kay 
<mike(_at_)saxonica(_dot_)com> wrote:

LibXSLT does not yet support XSLT 2.0, unfortunately.

Michael Kay
Saxonica

-----Original Message-----
From: himanshu padmanabhi 
[mailto:himanshu(_dot_)padmanabhi(_at_)gmail(_dot_)com]
Sent: 12 February 2009 13:54
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: Re: [xsl] separate white space and show in combo 
individually

Thank you all.

I already got that code of str,tokenize.But I will prefer 
to switch 
to XSLT 2.0.

Can anyone tell me how to do that?

I am using CentOS 5.2 and "perl-XML-LibXSLT-1.62-1.fc6.rf"
and "perl-XML-LibXML-1.65-1.el5.rf".

Just mentioning

"<xsl:stylesheet version="2.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
    xmlns="http://www.w3.org/1999/xhtml";>"

shouldn't be enough.Right?Some rpms should be there for XSLT 2.0.



On Thu, Feb 12, 2009 at 5:54 PM, Michael Kay 
<mike(_at_)saxonica(_dot_)com> 
wrote:

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(_dot_)padmanabhi(_at_)gmail(_dot_)com]
Sent: 12 February 2009 12:06
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] 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>



--~------------------------------------------------------------------
XSL-List info and archive:
http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--





--~------------------------------------------------------------------
XSL-List info and archive:  
http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--





--
Regards,
Himanshu Padmanabhi


--~------------------------------------------------------------------
XSL-List info and archive:  
http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--




--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--





--
Regards,
Himanshu Padmanabhi

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--