I just found out the problem is because the url.xsl is not a proper style sheet.
Thanks,
Shining
-----Original Message-----
From: Chang, Shining [mailto:Shining(_dot_)Chang(_at_)nordstrom(_dot_)com]
Sent: Wednesday, August 20, 2003 7:20 PM
To: XSL-List(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] cannot include global level variables
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"/>&BAR_HEIGHT=.5&FONT_COLOR=WHITE&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
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list