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

Re: Re: Assignment no, dynamic scoping si (was: Re: RE

Subject: Re: Re: Assignment no, dynamic scoping si (was: Re: RE: Wishes for XSL revisions ...
From: Gunther Schadow <gunther@xxxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 02 Jan 2002 16:26:25 -0500
Re:  Re: Assignment no
Hi Wendell,

> Is there a reason I missed why
> <xsl:template match='paragraph'>
>   <p class='ancestor-or-self::*[@source][last()]/@source'>
>     <xsl:apply-templates/>
>   </p>
> </xsl:template>
> wouldn't work for your example?

no you didn't miss a reason in my *example*, but my example
may have been distracting for the use case :-) In this case it
would work because the value is *provided* so you can grab it from
the source document via XPath.

However, what if the value is not provided in the document, but
is *computed* as templates are being processed? For example, the
text-indent of an XML to ASCII pretty printer.

In that case your only option with this approach would be to redo
the computation process from the structure of the document wherever
you need that value. I would not worry so much how inefficient that
may be at runtime; what I do care is that it requires to manage that
computation separately from the normal flow of template processing.


-- Gunther Schadow, M.D., Ph.D. gschadow@xxxxxxxxxxxxxxx Medical Information Scientist Regenstrief Institute for Health Care Adjunct Assistant Professor Indiana University School of Medicine tel:1(317)630-7960 http://aurora.regenstrief.org

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

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.