|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: How can I avaliate an expression XPath in a variab
Hi Giovani,
try
<xsl:for-each select="/di/docentes/prof">
<profRef href = "#{translate(.,' ','-')}"/>
</xsl:for-each>
Hope this helps
Vasu
----- Original Message -----
From: "Giovani Librelotto" <grl@xxxxxxxxxxxx>
To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
Sent: Wednesday, October 23, 2002 11:08 AM
Subject: How can I avaliate an expression XPath in a variable
>
> Hello all,
>
> I've a problem when I try to avaliate the value of a variable that
> contain an expression XPath, as below:
>
> The XML file:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <di>
> <nome>Departamento de Informatica</nome>
> <docentes>
> <prof>Pedro Silva</prof>
> <prof>Jorge Santos</prof>
> <prof>Paulo Camargo</prof>
> </docentes>
> </di>
>
> The stylesheet:
>
> <xsl:for-each select="/di/docentes/prof">
> <xsl:element name="profRef">
> <xsl:attribute name="href">
> <xsl:variable name="pos" select="concat('/di/docentes/prof', '[',
> position(), ']')"/>
> #<xsl:value-of select="translate($pos, ' ', '-')"/>
> </xsl:attribute>
> </xsl:element>
> </xsl:for-each>
>
> The generated XML file:
>
> <profRef href="#./docentes/prof[1]"/>
> <profRef href="#./docentes/prof[2]"/>
> <profRef href="#./docentes/prof[3]"/>
>
> The desired XML file:
>
> <profRef href="#Pedro-Silva"/>
> <profRef href="#Jorge-Santos"/>
> <profRef href="#Paulo-Camargo"/>
>
> Thanks in advance.
> Regards,
>
> ------------------------------------
> Giovani Rubert Librelotto
> Ph.D. Student
> Universidade do Minho
> Braga - Portugal
> grl@xxxxxxxxxxxx
>
>
>
>
> XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
>
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
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








