[Top] [All Lists]

Re: [xsl] attribute value templates in elements fetched from a map?

2020-09-02 17:16:12
On Wed, 2020-09-02 at 20:09 +0000, Graydon graydon(_at_)marost(_dot_)ca wrote:

<xsl:map-entry key="'list'">
      <style-name val="List" />
            <level depth="{$calculated[1]}"/>

returns an error because $calculated is undefined. 

You could replace it with a function, but unfortunately markup gets
flattened early, so the functionness is lost.

Another approach might be to transform what you have (using XSLT) into
an XSLT stylesheet and execute that with fn:transform(). It could be
just a sungle template with your entire result in it.

So, <level depth="$calulated[1]" />

might become in the XSLT you generate, <level depth="{ $calculated[1] }
and be evaluated.

Yuo can pass a stylesheet node to fn:transform, of course.

Liam Quin, https://www.delightfulcomputing.com/
Available for XML/Document/Information Architecture/XSLT/
XSL/XQuery/Web/Text Processing/A11Y training, work & consulting.
Barefoot Web-slave, antique illustrations:  http://www.fromoldbooks.org
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
EasyUnsubscribe: http://lists.mulberrytech.com/unsub/xsl-list/1167547
or by email: xsl-list-unsub(_at_)lists(_dot_)mulberrytech(_dot_)com

<Prev in Thread] Current Thread [Next in Thread>