This is the mail archive of the docbook-apps@lists.oasis-open.org mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: XSL stylesheets: adding elements via customizationlayer


Thanks Bob, that takes care of the errors I was seeing. I still have to
add support for other elements in our DocBook customization, so I'll get
back to work... I needed the xref fix too.

Gershon


On Tue, 30 Oct 2001, Bob Stayton wrote:

> > From: Gershon L Joseph <gershon@mainsoft.com>
> >
> > I'm trying to extend the XSL stylesheets to cater for our extensions to
> > the DocBook DTD. I have elements at the same level as <sect1>, which are
> > to be treated the same way as <sect1>s. I've managed to get the TOC in the
> > HTML Help appearing, but I'm getting this error while processing with
> > Saxon 6.4.3:
> >
> > No template named "commandlineprogramdef" exists in the context named
> > "section-title" in the "en" localization.
> >
> > I've searched the entire stylesheet installation tree, and can't find
> > where to define this. The only places where context section-title appear
> > are in common/gentext.xsl and en.xml. The error message is generated in
> > l10n.xsl.
> >
> > I've overridden all code that process <sect1>s to include my elements, and
> > I can't get rid of this message.
> >
> > Any ideas where to look or how to fix this?
> >
> > Any hints on adding support for new elements to the stylesheets? I get the
> > feeling I'm reinventing the wheel here...
>
> I'm not sure how you customized, so I'm not sure
> if what I suggest here will work.  But you were on
> the right track.
>
> The file en.xml defines text templates (not xsl:templates)
> for generated text, including titles.  It allows the
> stylesheet to generate something like
> "Section 3.2: My title" or whatever you want.
> And it can work in many languages by defining
> similar templates in each language file like en.xml.
>
> You can extend the set of templates with your customization
> layer using something like this:
>
> <xsl:param name="local.l10n.xml" select="document('')"/>
> <l:i18n xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0";>
>   <l:l10n language="en">
>     <l:context name="section-title">
>       <l:template name="commandlineprogramdef" text="%t"/>
>     </l:context>
>     <l:context name="section-xref">
>       <l:template name="commandlineprogramdef" text="%t"/>
>     </l:context>
>   </l:l10n>
> </l:i18n>
>
> I added one for section-xref in case you want to
> form an <xref> to link to one of your new sections.
> This extension only covers English doc, unless you
> add more.
>
> This will fix the error you are seeing, but I'm not sure
> if it will satisfy everything.


----------------------------------------------------------------
To subscribe or unsubscribe from this elist use the subscription
manager: <http://lists.oasis-open.org/ob/adm.pl>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]