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] | [List Home]


Subject: Re: [docbook-apps] Adding a link insided <funcprototype>


Thanks Bob - this is very helpful.
Sadly the URL generated stops after my # and doesn't include any of the text that follows (
"url.html#" instead of "url.html#one").
Since I'm officially stepping outside of the pure DTD by using <link> here at all -- can you suggest an alternative that would use my entire link including the page anchor?
Thanks again!
Kathleen

Bob Stayton wrote:
010401ca2e86$558008b0$0a00a8c0@pazu" type="cite">
Hi Kathleen,
I think the basic problem with using link here is that it is not a valid child of funcdef according to the DTD.  So there is no stylesheet template for link in the mode used for any of the four styles of synopsis.  You could get it to work by adding a template of your own to your customization layer (here using the default style mode):
 
<xsl:template match="link" mode="kr-tabular">
  <xsl:apply-templates select="."/>
</xsl:template>
At the risk of sounding pedantic, I'll point out that you seem to be mixing your DocBook 4 and 5 syntaxes in your link element.  The Docbook MathML DTD that your DOCTYPE references is based on DocBook 4, in which the link element uses @linkend.  The @xlink:href attribute was introduced in DocBook 5.  The DocBook stylesheets are designed to process both DocBook 4 and 5, so it will work.
 
 
Bob Stayton
Sagehill Enterprises
bobs@sagehill.net
 
 
----- Original Message -----
Sent: Saturday, September 05, 2009 11:31 AM
Subject: [docbook-apps] Adding a link insided <funcprototype>

Hi all.

We're transforming XML in to HTML. We're trying to write a C function prototype with the proper tagging to generate an anchor tag for certain parts. For example, in the text

returnType functionName (paramType  *paramName);

we would want <a...> anchor tags with an external URL target to be generated for returnType and paramType. We tried using <link> as shown in the following XML, but the N. Walsh DocBook stylesheets ignore the <link> and no anchor tags gets generated:

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook MathML Module V1.1b1//EN"
            
"http://www.oasis-open.org/docbook/xml/mathml/1.1CR1/dbmathml.dtd">

<refentry>
   <refsynopsisdiv xmlns:xlink=
"http://www.w3.org/1999/xlink">
       <funcsynopsis>
           <funcprototype>
               <funcdef><link xlink:href="url.html#one">returnType</link>
                   <function>functionName</function>
               </funcdef>
               <paramdef><link xlink:href="url.html#two">paramType</link>
                   <parameter>*paramName</parameter>
               </paramdef>
           </funcprototype>
       </funcsynopsis>
  </refsynopsisdiv>
</refentry>

Here is our minimal test stylesheet:

<?xml version='1.0'?>
<xsl:stylesheet
  xmlns:xsl=
"http://www.w3.org/1999/XSL/Transform" version="1.0">
 <xsl:import href=""http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl"/>
</xsl:stylesheet>

What are we missing? Any ideas will be most appreciated.
-- 
Kathleen Mattson
www.millermattson.com
kathleen@millermattson.com
Beaverton, Oregon USA
503-690-4351

-- 
Kathleen Mattson
www.millermattson.com
kathleen@millermattson.com
Beaverton, Oregon USA
503-690-4351


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