xsl-list
[Top] [All Lists]

Re: [xsl] grouping problem

2010-04-02 07:09:30
Michael Ludwig wrote:
Martin Honnen schrieb am 02.04.2010 um 12:06:46 (+0200):

<xsl:for-each-group select="*" group-adjacent="self::ueberschrift or self::absatz[matches(., 'I+\.')]">
        <xsl:choose>
          <xsl:when test="current-grouping-key()">
            <xsl:copy-of select="current-group()"/>
          </xsl:when>
          <xsl:otherwise>
            [...]

It took me a while to understand this. I find it really clever!

The matching of the roman number needs improvement I think, based on
http://markmail.org/message/tw36hslmzf6fxw6w
it could be changed to
self::absatz[matches(., '^M*(CM|CD|D?C{0,3})(XC|XL|L?X{0,3})(IX|IV|V?I{0,3})\.$')]


--

        Martin Honnen
        http://msmvps.com/blogs/martin_honnen/

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