[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Crazy idea

Subject: Re: Crazy idea
From: Francis Norton <francis@xxxxxxxxxxx>
Date: Fri, 10 Sep 1999 06:57:34 +0100
crazy ideas list

Oren Ben-Kiki wrote:
> 
> Francis Norton <francis@xxxxxxxxxxx> wrote:
> > Oren Ben-Kiki wrote:

...

> 
> > I would add another objection - I'm not sure that XSLT is powerful
> > enough to do the data-validation (as opposed to the structure
> > validation) unless/until it gets regular expressions.
> 
> Some sort of order constraints on sub elements are obviously useful. Simple
> sequences with optional repeating elements are trivial to express in XSLT
> (though not as elegantly as in XSchemas, I admit). Anything further becomes
> hairy, but it isn't clear to me that much more is useful in practice.
> 
> I don't see any easy way to add regular expressions to XSLT.
> 

It's on the list of possible extensions -
http://www.w3.org/TR/xslt#section-Features-under-Consideration-for-Future-Versions-of-XSLT

> > On a less fundamental note, I'd also like the ability to define XSLT
> > functions in XSLT, which would make programs very
> > much more concise and legible.
> 
> You can, using "named templates".
> 

Yes, but a function call typically takes a single line, maybe less than
one line. If I'm trying to keep my code legible then each parameterised
named template call will take about 2+n lines where n is the number of
parameters; eg:

	<!-- generate and implictly pass back a result object -->
	<xsl:call-template name="valid-choice">
		<xsl:with-param name="tree-count" select="$tree-count" />
		<xsl:with-param name="content-list" select="$content-list" />
		<xsl:with-param name="valid-pattern" select="$valid-pattern" />
	</xsl:call-template>
			
v.

	<!-- [hypothetical syntax] generate and implictly pass back a result
object -->
	fn:valid-choice($tree-count, $content-list, $valid-pattern)

Cheers -

Francis.


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.