xsl-list
[Top] [All Lists]

Re: Conditional splitting of string with XSL

2003-01-27 15:25:39
Hello Mukul,

you can use the EXSLT node set function, which is supported by Xalan.

Joerg

Mukul wrote:
Hi Dimitre,
Thanks for your reply. I have to use Apache Xalan &
Xerces parsers. Your program uses the syntax
xmlns:msxsl="urn:schemas-microsoft-com:xslt" . Would Microsoft specific namespace work with Apache XSLT
engine? Your source also imports a file
str-foldl.xsl.. Where can I find this file..?

Regards,
Mukul

--- Dimitre Novatchev <dnovatchev(_at_)yahoo(_dot_)com> wrote:

"Mukul" <mukulw3(_at_)yahoo(_dot_)com> wrote in message


news:20030126165854(_dot_)65085(_dot_)qmail(_at_)web41114(_dot_)mail(_dot_)yahoo(_dot_)com(_dot_)(_dot_)(_dot_)

Thanks for your reply. Is it possible that I can
output only first 3 lines? Since we cannot

increment

variables in XSL, is there a solution to this

problem.

Will appreciate any help..

Regards,
Mukul

In the solution, which is presented in:



http://sources.redhat.com/ml/xsl-list/2001-12/msg00651.html

replace the following code:

     <xsl:for-each
select="msxsl:node-set($vResult)/line">
       <xsl:for-each select="word">
         <xsl:value-of select="concat(., ' ')"/>
       </xsl:for-each>
       <xsl:value-of select="'

'"/>

     </xsl:for-each>

with:

     <xsl:for-each
select="msxsl:node-set($vResult)/line
[position() &lt; 4]">
       <xsl:for-each select="word">
         <xsl:value-of select="concat(., ' ')"/>
       </xsl:for-each>
       <xsl:value-of select="'

'"/>

     </xsl:for-each>


Hope this helped.




=====
Cheers,

Dimitre Novatchev.



XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list