[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: Re: [docbook-apps] How do I generate the page number of an <anchor> in print?
Adding support for xrefs to anchor is not hard, as long as you want to only use what information an empty anchor can provide. Page number is about it, actually. This template would do it for fo output if you use the xrefstyle select syntax as you suggest: <xsl:template match="anchor" mode="xref-to"> <xsl:param name="referrer"/> <xsl:param name="xrefstyle"/> <xsl:param name="verbose" select="1"/> <xsl:apply-templates select="." mode="object.xref.markup"> <xsl:with-param name="purpose" select="'xref'"/> <xsl:with-param name="xrefstyle" select="$xrefstyle"/> <xsl:with-param name="referrer" select="$referrer"/> <xsl:with-param name="verbose" select="$verbose"/> </xsl:apply-templates> </xsl:template> The object.xref.markup mode will trigger handling the xrefstyle attribute. For HTML output, you could add an xreflabel attribute with some text label to the anchor element. But then it would also override the xrefstyle page number in the FO output. I don't know how you could get them both to work. Bob Stayton Sagehill Enterprises DocBook Consulting bobs@sagehill.net ----- Original Message ----- From: "Rune Enggaard Lausen" <rune@enggaard-lausen.dk> To: <docbook-apps@lists.oasis-open.org> Sent: Wednesday, August 24, 2005 6:55 AM Subject: [docbook-apps] How do I generate the page number of an <anchor> in print? > Hello everybody. > > A tecnical writer at my company wants to generate a cross reference to > an <anchor> in the middle of a long section. He wants the page number of > the page "containing" the anchor to be generated in print output. > > Now, with normal references to, e.g., sections, I would just make him > use <xref linkend="someID" xrefstyle="select: Page"/>. But, as is > documented in Bob Stayton's excellent book, xref to an anchor is not the > way out, which seems reasonable :-). > > Does anyone have a suggestion on how I can get the page number in print > and some other reasonable thingie in HTML/HTMLHelp output? > > Best regards, > > Rune Lausen > > --------------------------------------------------------------------- > To unsubscribe, e-mail: docbook-apps-unsubscribe@lists.oasis-open.org > For additional commands, e-mail: docbook-apps-help@lists.oasis-open.org > > >
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]