|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: comparing values
Tempore 17:26:49, die 02/20/2005 AD, hinc in
xsl-list@xxxxxxxxxxxxxxxxxxxxxx scripsit Dionisio Ruiz de ZC!rate
<dionisio@xxxxxxxxxxxxx>:
Hi,hello i have into one xml this: - <eleccion> <eleccionusuario_id>219</eleccionusuario_id> <eleccion_id>2</eleccion_id> <usuario_id>55</usuario_id> <eleccionusuario_valor>false,true,false,false,true,false,true,false,false</eleccionusuario_valor> </eleccion> In XSLT1.0, you'd have to use some recursively called template that does some string-realted tests. e.g.: <xsl:template match="eleccionusuario_valor"> <xsl:call-template name="number"/> </xsl:template> <xsl:template name="number"> <xsl:param name="index" select="1"/> <xsl:param name="string" select="."/> <xsl:if test="substring-before($string,',') = 'true'"> <xsl:value-of select="$index"/> <xsl:if test="contains(substring-after($string,','), 'true')"> <xsl:text>,</xsl:text> </xsl:if> </xsl:if> <xsl:if test="contains($string,',')"> <xsl:call-template name="number"> <xsl:with-param name="string" select="substring-after($string,',')"/> <xsl:with-param name="index" select="$index + 1"/> </xsl:call-template> </xsl:if> </xsl:template> (tested with AltovaXSLT) regards, -- Joris Gillis (http://www.ticalc.org/cgi-bin/acct-view.cgi?userid=38041) "Et ipsa scientia potestas est" - Francis Bacon , Meditationes sacrae
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








