xsl-list
[Top] [All Lists]

RE: a beginner question

2004-06-23 11:09:18
In XSLT 1.0 you can put the code in a named template, which you can call
using xsl:call-template.

In XSLT 2.0 you can put it in a function, which you can call from within an
XPath expression.

In both cases, however, the xsl:decimal-format declaration has to stay
outside the function: it must be global to the stylesheet.

Michael Kay

 

-----Original Message-----
From: Antonio Santos [mailto:antonio(_dot_)santos(_at_)atosorigin(_dot_)com] 
Sent: 23 June 2004 11:43
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] a beginner question

Sorry, but I'm a beginner in the xsl's universe

I have this code to transform a number


<?xml version="1.0"?>
<!--prueba.xsl-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
version="1.0">
 <xsl:decimal-format name="formato" decimal-separator=","
grouping-separator="."/>
 <xsl:template match="/">
  <xsl:for-each select="//item">
   <xsl:text> ___ </xsl:text>
   <xsl:value-of 
select="format-number(translate(money,',','.'),'#.###,##',
'formato')"/>
  </xsl:for-each>
 </xsl:template>
</xsl:stylesheet>



I need this code (from the last example) in a function


 <xsl:decimal-format name="formato" decimal-separator=","
grouping-separator="."/>
   <xsl:value-of 
select="format-number(translate(money,',','.'),'#.###,##',
'formato')"/>


where "money" is the value of the node.

¿How could I develop the code? ¿How do I call the function?

Thanks

------------------------------------------------------------------
This e-mail and the documents attached are confidential and 
intended solely
for the addressee; it may also be privileged. If you receive 
this e-mail
in error, please notify the sender immediately and destroy it.
As its integrity cannot be secured on the Internet, the Atos 
Origin group
liability cannot be triggered for the message content. Although the
sender endeavours to maintain a computer virus-free network, 
the sender does
not warrant that this transmission is virus-free and will not 
be liable for
any damages resulting from any virus transmitted.

"Este mensaje y los ficheros adjuntos pueden contener información
confidencial destinada solamente a la(s) persona(s) mencionadas
anteriormente. Pueden estar protegidos por secreto 
profesional Si usted
recibe este correo electrónico por error, gracias de informar 
inmediatamente
al remitente y destruir el mensaje.
Al no estar asegurada la integridad de este mensaje sobre la red, Atos
Origin no se hace responsable por su contenido. Su contenido 
no constituye
ningún compromiso para el grupo Atos Origin, salvo 
ratificación escrita por
ambas partes.
"Aunque se esfuerza al máximo por mantener su red libre de 
virus, el emisor
no puede garantizar nada al respecto y no será responsable de 
cualesquiera
daños que puedan resultar de una transmisión de virus"
------------------------------------------------------------------

--+------------------------------------------------------------------
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>
--+--




<Prev in Thread] Current Thread [Next in Thread>