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

RE: number collapsing

Subject: RE: number collapsing
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Tue, 14 Dec 2004 16:07:43 -0000
RE:  number collapsing
I think the cleanest separation of concerns would be to have a function that
takes a sequence of numbers as input (e.g. (1,2,3,8,9,10)) and produces a
string as output, e.g. "1-3, 8-10". That would have a signature

<xsl:function name="xxx" as="xs:string">
  <xsl:param name="numbers" as="xs:integer*"/>

Michael Kay
http://www.saxonica.com/

> -----Original Message-----
> From: Bruce D'Arcus [mailto:bdarcus@xxxxxxxxxxxxx] 
> Sent: 14 December 2004 15:45
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: Re:  number collapsing
> 
> 
> On Dec 14, 2004, at 10:30 AM, Michael Kay wrote:
> 
> > It's better to document the function's
> > expectations by putting "as" attributes on the xsl:param elements.
> 
> So you're saying I should do the castable test on the 
> template that is 
> calling the function, and only call it if the value is castable as an 
> integer, and then do this?
> 
>    <xsl:function name="bib:number-condense">
>      <xsl:param name="begin" as="xs:integer"/>
>      <xsl:param name="end" as="xs:integer"/>
> 
> Bruce

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.