[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Use XSL:Variable

Subject: Use XSL:Variable
From: "Paulo Mendes Pinto" <paulo.pinto@xxxxxxx>
Date: Tue, 1 Feb 2005 15:04:24 -0000
xsl variable use
Hello

I'm new at this List and new in XSL and I have many problems understanding how
to do something.

I have a XML that I want to transform to in a CSV text file to import to
Excel. Until now I have the text file like I want with the char set that I
want but there is something that I want and I don't know how.

In my XML I have a CONTROL tag with some information that I will use in the
other tags. Some of the tags in CONTROL tag will concatenate with some tags
along the rest the XML.

I have to get some data from the CONTROL tag and save it in a variable and use
to concatenate with fields is another tag.

How can I do that? I was trying to do like this.

     <xsl:template match="CONTROL">
          <xsl:apply-templates/>
     </xsl:template>
    
     <xsl:template match="ObjectFormat">
          <xsl:variable name="FileExtention"><xsl:value-of
select="@FileExtention"/></xsl:variable>
     </xsl:template>

The FileExtention is an Attribute of Object Format tag in CONTROL.

<xsl:template match="ObjectIndex">
     <xsl:value-of select="@Code"/><xsl:text>;</xsl:text>
     <xsl:value-of select="@Description"/><xsl:text>;</xsl:text>
     <xsl:copy-of select="$FileExtention" /><xsl:text>|</xsl:text>
     <xsl:text>&#xD;&#xA;</xsl:text>
</xsl:template>


With this XSL I get an error:
Invalid variable referenceError in XPath expression. Invalid variable
reference

How can I use this variable?

Tkx in advance

Paulo Aboim Pinto 
Engenheiro de Produto
======================
DSTS - Desenvolvimento e Integragco de Servigos e Tecnologia, S.A.
Tel.(+351)21 092 56 28
Fax.(+351)21 092 56 29

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.