|
[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
Hi David,
Thanks for the input.
> <!ELEMENT xsl:function (xsl:param*, xsl:variable*, xsl:return)>
Personally, I think that this is too restrictive. As you point out,
it makes ifs and chooses quite difficult. I'd prefer something along
the lines of:
<!ELEMENT exsl:function (xsl:param*, (xsl:for-each | xsl:if |
xsl:choose | xsl:message |
xsl:fallback | exsl:return)*)>
with multiple exsl:returns allowed in different xsl:whens, for
example.
> Another thing: wouldn't <xsl:result> be a better name for
> <xsl:return> (assuming it can only appear once)? At least to me it
> sounds more declarative.
I think we've been assuming that there's more than one, as above, but
I personally have no strong feeling either way about the name.
But this sparked something for me - having an exsl:return inside a
xsl:for-each:
<xsl:for-each select="$node">
<xsl:if test="*">
<exsl:return select="true()" />
</xsl:if>
</xsl:for-each>
(in effect equivalent to <exsl:return select="boolean($node[*])" />)
Perhaps xsl:for-each shouldn't be allowed directly within function
definitions? Can anyone come up with a use case where it's helpful to
have it?
Cheers,
Jeni
---
Jeni Tennison
http://www.jenitennison.com/
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








