This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Re: Assignment no, dynamic scoping si (was: Re: RE: Wishes for XSL revisions ...


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.

regards
-Gunther


-- 
Gunther Schadow, M.D., Ph.D.                    gschadow@regenstrief.org
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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]