xsl-list
[Top] [All Lists]

RE: number collapsing

2004-12-14 09:07:43
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(_at_)myrealbox(_dot_)com] 
Sent: 14 December 2004 15:45
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: Re: [xsl] 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


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--




--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>