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

Re: attribute value templates in elements fetched from

Subject: Re: attribute value templates in elements fetched from a map?
From: "Martin Honnen martin.honnen@xxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 2 Sep 2020 22:27:11 -0000
Re:  attribute value templates in elements fetched from
On 02.09.2020 22:08, Graydon graydon@xxxxxxxxx wrote:

The prototype has a whole bunch of individual templates which are mostly
the same except in match expression and in one of the values created;
the XML structure is mostly identical.  Many other things about the
process are being driven out of a map already, and I find myself
wondering if there's a way to (in effect) have a dynamic call-template
instruction; I want to keep the context, and maybe evaluate some
attribute value templates in the xml nodes provided, but which exact
nodes (and which exact attribute value templates) vary.

The transform function is computationally expensive and I'd have to pass
in arbitrary context (for things like determining heading depth); that
doesn't seem appealing.  xsl:evaluate can evaluate the XPath in the
current context but then there's no obvious way to get that value into
the markup:

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

returns an error because $calculated is undefined.

I don't understand where you use xsl:evaluate and where you bind the value to $calculated.

If you have

  <xsl:variable name="calculated" as="item()*">
    <xsl:evaluate .../>

before that xsl:map the variable should be defined.

Current Thread


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.
First Name
Last Name
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.