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

cannot include global level variables

Subject: cannot include global level variables
From: "Chang, Shining" <Shining.Chang@xxxxxxxxxxxxx>
Date: Wed, 20 Aug 2003 19:20:16 -0700
url xsl
I'd like to include a xsl, which contains a url link. Somehow, it does not work. 
Here is my code 
in A.xsl: 
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
  xmlns:xalan="http://xml.apache.org/xslt"
  xmlns:name="http://blue.com/eng/arch/dna/name/"
  xmlns:bo="http://blue.com/eng/arch/dna/bo/"
  xmlns:dna="http://blue.com/eng/arch/dna/type/">
<xsl:output method="xml" omit-xml-declaration="yes" />

<xsl:import href="config/bp/xsl/url.xsl" />

<xsl:template match="/dna:dna">
...
    <tr>
    <td width="324" align="right"><img>
    <xsl:attribute name="src"><xsl:copy-of select="$url" />?BARCODE=<xsl:value-of select="bo:USER_ACCOUNT/name:customerNum"/>&amp;BAR_HEIGHT=.5&amp;FONT_COLOR=WHITE&amp;WIDTH=100</xsl:attribute>
    <xsl:attribute name="height">50</xsl:attribute>
    <xsl:attribute name="width">100</xsl:attribute>
    </img></td>
    </tr>
...
</xsl:template> 


and in "url.xsl", I have: 
<xsl:variable name="url"> 
<xsl:text>//localhost:7019/servlet/barCode</xsl:text> 
</xsl:variable> 
With this code, I got error:
file:///C:/clienteling/; Line -1; Column -1; VariableReference given for variable out of context or
without definition!  Name = url

If I replace the <xsl:include ...> with the actual code in url.xsl, then it worked.  I did make sure that the "href" points to the right file.

Is it because the way I am writing the url.xsl file?

Any suggestions are appreciated.

Thanks,

Shining

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


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.