xsl-list
[Top] [All Lists]

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

2003-08-22 00:51:40
dyn:evaluate() is an XPath expression, so you can use it anywhere an
XPath expression is allowed, and nowhere else.

Michael Kay

-----Original Message-----
From: owner-xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com 
[mailto:owner-xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com] On Behalf Of 
raphead(_at_)gmx(_dot_)net
Sent: 22 August 2003 07:10
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: Re: [xsl] Re: EXSL's dyn:evaluate() and XALAN vs. 
xsl:use-attribute-sets


Hi,

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.

I'm aware of that but my understanding of the dyn:evaluate 
extension is, that is let's say 'on level above the xslt 
processing'. While reading the spec on exslt.org the 
following sentence confirmed this somehow:

...The string is always evaluated exactly as if it had been 
literally included in place of the call to the dyn:evaluate function.

And if you're right, how can one determine for which params 
etc. dyn:evaluate will work?



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


Do you have an ide, how to achive it? I also tried with 
chained templates and parameters but then I really stuck with 
the problem with qnames.

Thomas

=====
Cheers,

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


<raphead(_at_)gmx(_dot_)net> wrote in message 
news:29467(_dot_)1061417799(_at_)www20(_dot_)gmx(_dot_)net(_dot_)(_dot_)(_dot_)
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


-- 
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