xsl-list
[Top] [All Lists]

Re: [xsl] N input nodes to specific number of ouput nodes

2008-10-22 13:06:25
"Chris" == Bordeman, Chris 
<Chris(_dot_)Bordeman(_at_)wolterskluwer(_dot_)com> writes:

    Chris> How?  The for-each loop works on the input set which never
    Chris> gets as high as 10 if there aren't enough items in the
    Chris> input set.

Something like:

<xsl:template match="whatever">
  <xsl_variable name="length" select="."/>

  <xsl:choose/>
   <xsl:when test="count($length) lt 10">
    ...
   <xsl:otherwise>



    Chris> -----Original Message----- From: Colin Paul Adams
    Chris> [mailto:colin(_at_)colina(_dot_)demon(_dot_)co(_dot_)uk] Sent: 
Wednesday, October
    Chris> 22, 2008 10:44 AM To: 
xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
    Chris> Subject: Re: [xsl] N input nodes to specific number of
    Chris> ouput nodes

"Chris" == Bordeman, Chris 
<Chris(_dot_)Bordeman(_at_)wolterskluwer(_dot_)com>
    Chris> writes:

    Chris> Hi all.

    Chris> I need to loop through some nodes and output exactly 10
    Chris> output nodes, no matter how many input nodes there are.  If
    Chris> too few input nodes the ouput will just show "N/A" and if
    Chris> too many input nodes they will just be ignored.

    Chris> I can do the 'too many' with a for-each and a choose based
    Chris> on position() but don't get how the 'too few' scenario is
    Chris> handled.

    Chris> An xsl:choose discriminating on count() should do the
    Chris> trick.  -- Colin Adams Preston Lancashire

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


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


-- 
Colin Adams
Preston Lancashire

--~------------------------------------------------------------------
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>