[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

[xsl] Re: EXSL's dyn:evaluate() and XALAN vs. xsl:use-attribute-sets


Subject: [xsl] Re: EXSL's dyn:evaluate() and XALAN vs. xsl:use-attribute-sets
From: "Dimitre Novatchev" <dnovatchev@xxxxxxxxx>
Date: Thu, 21 Aug 2003 09:19:29 +0200

According to the XSLT 1.0 spec "The value of the use-attribute-sets
attribute is a whitespace-separated list of names of attribute sets. Each
name is specified as a QName ..."

A QName cannot be calculated dynamically -- it must be known at compile
time.


Therefore, what you're trying to achieve is impossible in this way.


=====
Cheers,

Dimitre Novatchev.
http://fxsl.sourceforge.net/ -- the home of FXSL


<raphead@xxxxxxx> wrote in message news:29467.1061417799@xxxxxxxxxxxxxxxx
Hi,

As I don't really like mailinglists it was kind of hard for me do this step
but for my current problem
I can't find a proper answer elsewhere:

Suppose I have the following XML document:

...
<elemxy class="test1">Some content</elemxy>
...

And the following template snippet:

...
  <xsl:template match="elemxy">
    <fo:block  xsl:use-attribute-sets="dyn:evaluate(@class)">
    <xsl:apply-templates/>
    </fo:block>
  </xsl:template>
...

Obviously I have several different class attributes (like test1 here) and
want
them to be the name of an attribute-set. This because: I'm generating the
attribute-sets dynamically
and attach them to the xsl stylesheet.

My question is now: Why is the above construct NOT working?
I'm using xalan-j_2_5_1 and my root element of the stylesheet looks like
this:

<xsl:stylesheet version="1.0"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:fo="http://www.w3.org/1999/XSL/Format"
                xmlns:xalan="http://xml.apache.org/xalan"
                xmlns:dyn="http://exslt.org/dynamic"
                extension-element-prefixes="dyn">

Xalan simply ignores the statement. When I replace the expression with
a static name the proper attribute-set is used.

Thomas H.
With greets from Germany


-- 
COMPUTERBILD 15/03: Premium-e-mail-Dienste im Test
--------------------------------------------------
1. GMX TopMail - Platz 1 und Testsieger!
2. GMX ProMail - Platz 2 und Preis-Qualitätssieger!
3. Arcor - 4. web.de - 5. T-Online - 6. freenet.de - 7. daybyday - 8. e-Post


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





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



Current Thread
Keywords