OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

docbook-apps message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [Elist Home]


Subject: Re: DOCBOOK-APPS: chunking all sections and links/xrefs


On Wed, Nov 28, 2001 at 02:39:55PM -0600, David Cramer wrote:
> Hi there,
> In my customization layer to the chunking stylesheets, I've hacked
> chunk-common as shown below (working with v. 1.44) to cause it to chunk
> all sections no matter how deep. So far so good. Unfortunately, now
> links and xrefs from anyplace to text in a section or to a section no
> longer work. The stylesheets report Error: no ID for constraint linkend:
> blah. and the link is dead. 
> 
> I don't really understand how these stylesheets work. I was hoping that
> by short circuiting the code that determines what a chunk is I could get
> the desired result. Could someone point me in the right direction for
> fixing the linking problem?
> 
> Thanks,
> David
> 
> $ diff chunk-common.xsl chunk-common.hacked.xsl
> 51c51
> < <xsl:param name="chunk.first.sections" select="'0'"/>
> ---
> > <xsl:param name="chunk.first.sections" select="'1'"/>
> 110,122c110,111
> <     <xsl:when test="$chunk.sections != 0
> <                     and name($node)='sect1'
> <                     and ($chunk.first.sections != 0
> <                          or count($node/preceding-sibling::sect1) >
> 0)">
> <       <xsl:text>1</xsl:text>
> <     </xsl:when>
> <     <xsl:when test="$chunk.sections != 0
> <                     and name($node)='section'
> <                     and count($node/parent::section) = 0
> <                     and ($chunk.first.sections != 0
> <                          or
> count($node/preceding-sibling::section))>0">
> <       <xsl:text>1</xsl:text>
> <     </xsl:when>
> ---
> >     <xsl:when test="name($node)='sect1'">1</xsl:when>
> >     <xsl:when test="name($node)='section'">1</xsl:when>
> 778c767
> <              |preceding::section[name(parent::*) != 'section'][1]
> ---
> >              |preceding::section[1]
> 803c792
> <              |following::section[name(parent::*) != 'section'][1]
> ---
> >              |following::section[1]
> 823c812
> <              |descendant::section[name(parent::*) !=
> 'section'][1])[1]"/>
> ---
> >              |descendant::section[1])[1]"/>
> 964,965c953
> <                      |/section
> <                      |section[local-name(parent::*) != 'section']">
> ---
> >                      |section">


Are you using id's to name your output files, or are
you generating filenames?  If so, then the problem
with cross references is probably how it counts sections
to form the filenames like ch01s01s02s01.html.

The chunk-filename template in chunk-common.xsl now
has this for section:

<xsl:when test="name(.)='sect1' or name(.)='section'">
   <xsl:apply-templates mode="chunk-filename" select="parent::*">
      <xsl:with-param name="recursive" select="true()"/>
   </xsl:apply-templates>
   <xsl:text>s</xsl:text>
   <xsl:number level="any" format="01" from="preface|chapter|appendix"/>
   <xsl:if test="not($recursive)">
     <xsl:value-of select="$html.ext"/>
   </xsl:if>
</xsl:when>

The problem is the <xsl:number> element.
The level="any" doesn't distinguish section levels,
and you want to count from the parent for each nested
section, not just from the chapter container.  As a result,
I think you would be getting duplicate filenames.
So try this instead:

<xsl:number level="single" format="01" from="section|preface|chapter|appendix"/>

I tested this in Saxon 6.44 on Win2K, and it handled the
filenames and xrefs properly.

Oddly, though, xsltproc produced filenames like
ch01sss.html, losing the section number entirely.
I think that is probably a bug in xsltproc?
Daniel, would like a test file?

Bob Stayton                                 400 Encinal Street
Publications Architect                      Santa Cruz, CA  95060
Technical Publications                      voice: (831) 427-7796
Caldera International, Inc.                 fax:   (831) 429-1887
                                            email: bobs@caldera.com


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [Elist Home]


Powered by eList eXpress LLC