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

Re: xsl:import, variables and html

Subject: Re: xsl:import, variables and html
From: Jeni Tennison <jeni@xxxxxxxxxxxxxxxx>
Date: Tue, 9 Oct 2001 16:58:20 +0100
xsl import variable
Hi Julio,

> I have this problem. I have an xsl which import another xsl, this
> last have the definitions of variables which have html code. When I
> try to use those variables in the original xsl, it output nothing.
> How can I fix this?

I think that the problem is in the importing stylesheet. First, you
have the elements that you want to generate at the top level of the
stylesheet rather than within a template. More importantly, you're
getting the *value* of the two variables rather than copying them.
Because you don't have any textual content in the result tree
fragments that the variables hold, you get nothing when you get their
values. Instead, use xsl:copy-of to copy them, as follows:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:fo="http://www.w3.org/1999/XSL/Format">

<xsl:import href="definitions.xsl"/>

<xsl:template match="/">
  <table width="50%" align="center"><tr><td>
  <xsl:choose>
    <xsl:when test="./CONSULTAS/LINKSRCIMG=1">
       <xsl:copy-of select="$propaganda1_link"/>
    </xsl:when>
    <xsl:otherwise>
       <xsl:copy-of select="$propaganda1_img"/>
    </xsl:otherwise>
  </xsl:choose>
  </td></tr></table>
</xsl:template>

</xsl:stylesheet>

I hope that helps,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/


 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.