This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Global variables/temporary tree problem


I think I found the problem.  It seems the book I have covers the 1.1
version of the standard, but 1.1 went the way of the Dodo?  Xalan
implements 1.0 only, and apparently treating "result tree fragments" as
"temporary trees" that you could do whatever you wanted with is a 1.1
thing.  If anyone cares, I ended up using the document('') hack/feature
to look up the values in the stylesheet itself( my style sheet will be
in a RDMBs so I can not use an external list file).

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
version="1.1">
  <xsl:output method="xml" indent="yes"/>
  <xsl:variable name="hud_races_list">
    <race>white</race>
    <race>black</race>
  </xsl:variable>
  <xsl:variable name="hud_races"
select="document('')//xsl:variable[@name='hud_races_list']/race"/>

  <xsl:template match="client/race[.=$hud_races]">
   <xsl:element name="{name()}"><xsl:value-of select="concat('HUD:',
 text())"/></xsl:element>
  </xsl:template>
</xsl:stylesheet>


On Fri, 2002-09-13 at 10:54, Richard Rowell wrote:
> I'm having problems accessing a global variable that contains a result
> tree fragment (temporary tree?).  If I load the variable by calling
> document()/path/path2 then I can use the variable as I expect.  If I try
> to specify the variable value directly I get an error (from
> Xalan2.3.99).
> 
<snipped for brevity>

Attachment: signature.asc
Description: This is a digitally signed message part


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]