This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Designs for XSLT functions (Was: Re: RE: syntax sugar for call-template)


> So let's discuss some possibilities...
> 
> 1. conditional construct
> 
> a. test ? true : false
> 
>    Note: possible problems with : being used - have to make sure that
>    it has spaces either side to distinguish between it being used in
>    this construct and in a name
> 
> b. test ? true ! false

I like this one.

> c. IF test THEN true ELSE false
> d. #if test #then true #else false
> e. if(test, true, false)
> 
>    Note: as discussed, need to change the semantics of when arguments
>    in functions are evaluated with this last option
> 
> 2. changing context node for id(), key() & unparsed-entity-uri()
> 
> a. document(doc, base)/id(identifier)

I don't see why not this simple approach.  i.e. I vote a.

> b. document(doc, base) -> id(identifier)
> c. id(identifier, doc, base)
> d. id(identifier) IN document(doc, base)
> e. id(identifier) #in document(doc, base)
> f. WITH document(doc, base) id(identifier)
> 
> 3. comparing/sorting strings
> 
> a. compare-strings(string1, string2)
> b. string1 > string2  (etc.)
> c. sort(string1, string2)
> d. sort(nodes, ...)

I say we begin experimentation using functions, and then we can move to 
operators if all looks well.


-- 
Uche Ogbuji                               Principal Consultant
uche.ogbuji@fourthought.com               +1 303 583 9900 x 101
Fourthought, Inc.                         http://Fourthought.com 
4735 East Walnut St, Ste. C, Boulder, CO 80301-2537, USA
Software-engineering, knowledge-management, XML, CORBA, Linux, Python



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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]