[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Relying on the orser of excution is harmful (Was:
Thanks for the reminder, Dimitre.
I suppose one way of making sure extension functions are called in a certain sequence would be to wrap them in xsl:variable/@select statements and then make sure the variable is used in the next call to an extension function that depends on the previous call. Right? This works nicely with Java APIs that return the main object even for methods that could just as well return void (and unfortunately most of them do...) <xsl:variable xmlns:e="java:my.Gizmo" name="gizmo" select="e:new()"/> <xsl:variable xmlns:e="java:my.Gizmo" name="configured-gizmo" select="e:configure($gizmo, ...)"/> <xsl:variable xmlns:e="java:my.Gizmo" name="energized-gizmo" select="e:energize($configured-gizmo, ...)"/> Do you have a tip what to do if the Gizmo API is written as public void configure(...); instead of public Gizmo configure(...); ? May be what would be nice was if the Java extension function proxy would automatically return the object itself in case that the method returns void. There isn't really much use for a void value anyway.... Or may be the function proxy would allow trailing void values in an actual argument list to indicate dependencies that remain without value. So I could say: <xsl:variable xmlns:e="java:my.Gizmo" name="gizmo" select="e:new()"/> <xsl:variable xmlns:e="java:my.Gizmo" name="ensure-gizmo-configured" select="e:configure($gizmo, ...)"/> <xsl:variable xmlns:e="java:my.Gizmo" name="energized-gizmo" select="e:energize($gizmo, ..., $ensure-gizmo-configured)"/>
regards, -Gunther Dimitre Novatchev wrote: Having these two instructions in that order: <xsl:apply-templates select="NAME"/> <xsl:apply-templates select="Phone[@type='work']"/> does not guarantee at all that the appropriate templates will be applied on the "NAME" children before the appropriate templates will be applied on the "Phone[@type='work']" children. -- 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
|
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
|