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

Re: List type, probably a sequence problem (XSL 2)

Subject: Re: List type, probably a sequence problem (XSL 2)
From: "Graydon graydon@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 8 Jun 2023 18:54:20 -0000
Re:  List type
On Thu, Jun 08, 2023 at 06:40:55PM -0000, Trevor Nicholls
trevor@xxxxxxxxxxxxxxxxxx scripsit:
> The rules are that steps should always be numbered. Lists should
> always use the alternate scheme to their nearest ancestor, and a list
> with no ancestor list or step should be numeric.

So if I'm standing on an li --

<xsl:template match="li">
    <xsl:choose>
        <!-- my parent list is a steps list -->
        <xsl:when test="parent::steps">
            <xsl:attribute name="list-type" select='decimal'/>
        </xsl:when>
        <xsl:when test="count(ancestor::list[not(descendant::steps)])
        mod 2 eq 0>
         <xsl:attribute name="list-type" select='alpha'/>
        </xsl:when>
        <xsl:when test="count(ancestor::list[not(descendant::steps)])    
        mod 2 eq 1>
         <xsl:attribute name="list-type" select='decimal'/>
        </xsl:when>
    </xsl:choose>
<!-- other stuff -->
</xsl:template>

(I don't think I've managed to retain the correct style names for the
list types, so this won't be exactly right.)

-- 
Graydon Saunders  | graydonish@xxxxxxxxx
^fs oferiode, pisses swa mfg.
-- Deor  ("That passed, so may this.")

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.