[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
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
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|