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

RE: Please help: section labels and other XSL woes

Subject: RE: Please help: section labels and other XSL woes
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Thu, 22 May 2008 12:20:09 +0100
RE:  Please help: section labels and other XSL woes
I'm afraid this isn't self-contained enough, for example what does this do:

>       <xsl:apply-templates select=".."
> mode="intralabel.punctuation"/>

and what does this do:

>       <xsl:variable name="format">
>         <xsl:call-template name="autolabel.format">
>           <xsl:with-param name="format"
> select="$section.autolabel"/>
>         </xsl:call-template>
>       </xsl:variable>

I think you'd be better off on a DocBook list.

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


> -----Original Message-----
> From: Nancy Brandt [mailto:nancy_brndt@xxxxxxxxx] 
> Sent: 22 May 2008 12:07
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: RE:  Please help: section labels and other XSL woes
> 
> Ok, so I'll dare to paste a code snippet that handles the 
> section labels + label separators
> :
> <xsl:template match="section" mode="label.markup">
>   <!-- if this is a nested section, label the parent
> -->
>   <xsl:if test="local-name(..) = 'section'">
>     <xsl:variable name="parent.section.label">
>       <xsl:call-template name="label.this.section">
>         <xsl:with-param name="section" select=".."/>
>       </xsl:call-template>
>     </xsl:variable>
>     <xsl:if test="$parent.section.label != '0'">
>       <xsl:apply-templates select=".."
> mode="label.markup"/>
>       <xsl:apply-templates select=".."
> mode="intralabel.punctuation"/>
>     </xsl:if>
>   </xsl:if>
> 
>   <!-- if the parent is a component, maybe label that too -->
>   <xsl:variable name="parent.is.component">
>     <xsl:call-template name="is.component">
>       <xsl:with-param name="node" select=".."/>
>     </xsl:call-template>
>   </xsl:variable>
> 
>   <!-- does this section get labelled? -->
>   <xsl:variable name="label">
>     <xsl:call-template name="label.this.section">
>       <xsl:with-param name="section" select="."/>
>     </xsl:call-template>
>   </xsl:variable>
> 
>   <xsl:if
> test="$section.label.includes.component.label != 0
>                 and $parent.is.component != 0">
>     <xsl:variable name="parent.label">
>       <xsl:apply-templates select=".."
> mode="label.markup"/>
>     </xsl:variable>
>     <xsl:if test="$parent.label != ''">
>       <xsl:apply-templates select=".."
> mode="label.markup"/>
>       <xsl:apply-templates select=".."
> mode="intralabel.punctuation"/>
>     </xsl:if>
>   </xsl:if>
> 
> <!--
>   <xsl:message>
>     test: <xsl:value-of select="$label"/>, <xsl:number 
> count="section"/>
>   </xsl:message>
> -->
> 
>   <xsl:choose>
>     <xsl:when test="@label">
>       <xsl:value-of select="@label"/>
>     </xsl:when>
>     <xsl:when test="$label != 0">      
>       <xsl:variable name="format">
>         <xsl:call-template name="autolabel.format">
>           <xsl:with-param name="format"
> select="$section.autolabel"/>
>         </xsl:call-template>
>       </xsl:variable>
>       <xsl:number format="{$format}" count="section"/>
>     </xsl:when>
>   </xsl:choose>
> </xsl:template>
> 
> If the last number is not a parent, why the dot is added after it? 
> 
> Regarding the TOC in parts: I didn't find a piece of code 
> that is dedicated to generating the TOC in parts.
> 
> Thanks for any advice!
> 
> Nancy

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.