[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: Re: [docbook-apps] docbook: xref to generic elements
Adding some gentext templates is the first step for making an xref to a new element. But you also need to create an XSL template with mode="xref-to" for each element. That template would handle the particulars of how the xref text would be generated for that element. It can call the gentext template, apply-templates in 'object.xref.markup' mode, count list items, or anything you want. See fo/xref.xsl for examples. You will see that the default match="*" mode="xref-to" is the template generating that error message. In your case, you may want to output the classname content and then apply-templates in mode="object.xref.markup" to generate the page reference using your gentext templates from the xref context. Bob Stayton Sagehill Enterprises DocBook Consulting bobs@sagehill.net ----- Original Message ----- From: "Bernd Kuemmerlen" <bkuemmer@gmx.net> To: <docbook-apps@lists.oasis-open.org> Sent: Monday, September 06, 2004 2:07 AM Subject: [docbook-apps] docbook: xref to generic elements > Hello there, > > our docbook users often make xrefs to a lot of elements which do not > have gentext templates and therefore, using the docbook-xsl stylsheets, > in the html or pdf output they have links of the form ??? (which at > least point to the correct location in the html output). > > I tried to add gentext templates for some of the used elements like > described in <http://www.sagehill.net/docbookxsl/CustomXrefs.html> in my > customization layer: > > <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="xref"> > <l:template name="classname" text="(p. %p)"/> > <l:template name="constant" text="(p. %p)"/> > </l:context> > </l:l10n> > </l:i18n> > > However when transforming using xsltproc, I get messages like > > Don't know what gentext to create for xref to: "classname", > ("TypeInfosBase") > > I guess I am doing something wrong here... Can anyone help? > > I also tried to set xreflabels on individual xrefs, but still only "???" > is shown. > > Is there a more generic solution to create xref text for elements which > otherwise don't have a valid label? It would be for example great to > have (page XY) for pdf output and (chapter XY) for html output > > Thanks for any help or pointers on how to do this > Bernd > -- > "I'm a doctor, I am supposed to tell people where it hurts (so I can > fix it and make money)." > -- Mark S. > > > > >
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]