|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Designs for XSLT functions (Was: Re: RE: syntax su
I've given a bit of thought to exsl:return and I see there
are two distinct, and perhaps seperable requirements:
(a) to exit a exsl:function 'early
(b) to allow the return of a node-set
Trying to keep them seperate, I came up with:
1. For this discussion, assume that a function always
returns a node-set, aka list. Call this growable
list the result-set.
2. For normal template-style items, such as xsl:element,
xsl:value-of, xsl:text, let the corresponding result-fragment
be created; and then convert the result-fragment into a
tempoary node-set, and append the node-set to the result-set.
3. Create a new tag, <xsl:append select="xpath" /> which will:
(a) if the xpath type is a node-set, then it appends each
element of the node set onto the result-set.
(b) otherwise, a text node is appended with the string-value
of the path expression.
4. If execution must return 'early, then a new tag, <xsl:return />
can be used to return the result-set constructed.
5. If given a select statement, like <xsl:return select="xpath" />,
then the xpath expression selected will be returned instead
of the result-set being constructed.
Thoughts? Certainly this will not stand muster as a serious
proposal... it is just a few ideas jotted down. It is
an attempt at the "accumulator" pattern.
Clark
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
|

Cart








