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]
Other format: [Raw text]

Re: [docbook-apps] productname


The source of the problem is that in the  DocBook DTD, productname has a
default value of 'trade' for its 'class' attribute.  The parser inserts it,
even when it is not there.  There is no way for the stylesheet to detect if
it was inserted automatically or by the author.

You have to customize the template to fix it.  Copy the match="productname"
template from html/inline.xsl to your customization layer and change it to
something like:

<xsl:template match="productname">
  <xsl:call-template name="inline.charseq"/>
  <xsl:if test="@class != 'trade' or (@class = 'trade' and
@role='showmark')">
    <xsl:call-template name="dingbat">
      <xsl:with-param name="dingbat" select="@class"/>
    </xsl:call-template>
  </xsl:if>
</xsl:template>


This adds a second condition to the test that triggers the insertion of the
TM trademark but leaves other symbols alone.  For the instances of the
productname element you want to show a TM, add a role="showmark" attribute.

Bob Stayton
Sagehill Enterprises
DocBook Consulting
bobs@sagehill.net


----- Original Message ----- 
From: "Kai Hagemeister" <kh@planoweb.de>
To: <docbook-apps@lists.oasis-open.org>
Sent: Tuesday, February 22, 2005 2:41 AM
Subject: [docbook-apps] productname


> Namaste,
>
> i'm trying to change the default value of productname which ist trade to
> no value. This seems to be easy. I looked for the template which matches
> productname. In the file html/inline.xsl i found this:
>
> <xsl:template match="productname">
>   <xsl:call-template name="inline.charseq"/>
>   <xsl:if test="@class">
>     <xsl:call-template name="dingbat">
>       <xsl:with-param name="dingbat" select="@class"/>
>     </xsl:call-template>
>   </xsl:if>
> </xsl:template>
>
> Now, in my sourcedocument stands something like:
> <productname>foo</productname>
> So the template should match the element and call inline.charseq which
> prints the value of the element, nothing more. It never should pass the
> xsl:if test for the attribut class.
> But something peculiar happens. When the template matches productname it
> has a attribut class with value trade which i had never defined in the
> source-document. I grepped for the string trade and the string productname
> to find a place where this attribut is set. But I didnt find anything.
> Has somebody out there an idea and could assist.
> Thanks in advance.
> Kai
>
>
> -- 
> P L A N O M E D I A
>
>



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