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] abbrev/acronym expansion(amplification)


Sam Steingold <sds@gnu.org> writes:

> <acronym>FQDN<remark>Fully Qualified Domain Name</remark></acronym>
> appears to be the only option (right?)

If you use DocBook NG, you can do this:

  <acronym>FQDN<alt>Fully Qualified Domain Name</alt></acronym>

As of today, the DocBook XSL stylesheets support transforming that
into this:

  <span class="acronym" title="Fully Qualified Domain Name">FQDN</span>

And you can style that via CSS using something like this:

  span.acronym[title] {
    border-bottom: 1px dotted black
  }

Or if you're lazy, like me, just do this:

  [title] {
    border-bottom: 1px dotted black
  }

And note that DocBook NG lets you use the Alt element in many
places, not just in Acroynym. The full list of places where Alt is
valid are here:

  http://docbook.org/tdg5/en/html/alt.html#d4e5362

> now I need a stylesheet:
> 
> <xsl:template match="acronym">
>  <acronym>
>   <xsl:attribute name="title">
>    <xsl:value-of select="remark"/>
>   </xsl:attribute>
>   <xsl:apply-imports/>
>  </acronym>
> </xsl:template>
> <xsl:template match="acronym/remark"/>
> 
> it appears to work.
> is it OK?

Or you can just use <acronym>FQDN<alt>... instead and transform it
using the latest snapshot.

  http://docbook.sourceforge.net/snapshot/

Today, I checked in a change to the stylesheets that adds limited
support for having Alt content transformed into content of the
HTML "title" attribute. The change supports about 90 or so inline
elements only, but does include Acronym and Abbrev. Full list:

  abbrev accel acronym action application authorinitials beginpage
  citation citerefentry citetitle city classname code command
  comment computeroutput constant country database email envar
  errorcode errorname errortext errortype exceptionname fax
  filename firstname firstterm foreignphrase function glossterm
  guibutton guiicon guilabel guimenu guimenuitem guisubmenu
  hardware honorific interface interfacedefinition interfacename
  keycap keycode keysym lineage lineannotation literal markup
  medialabel methodname mousebutton option optional otheraddr
  othername package parameter personname phone pob postcode
  productname productnumber prompt property quote refentrytitle
  remark replaceable returnvalue sgmltag shortcut state street
  structfield structname subscript superscript surname symbol
  systemitem tag termdef token trademark type uri userinput
  varname wordasword

It currently does not support any block elements at all. (That
is more work and will take more time.)

And it is an _experimental_ change at this point. If others in the
project decide it's not a good change, or I end up deciding myself
that it's not so great, I may end up backing it out before the
next release (which is overdue and waiting for me to get remaining
loose ends tied up...). So I cannot guarantee it will be supported
in the next release.

  --Mike

P.S. (Because somebody will probably ask...) Yeah, I know, it
might seem better to have the DocBook <acronym> element
transformed into the HTML <acronym> element rather than
<span class="acronym">. The reason it is not done that way is
this: For acronym, a template called "inline.charseq" gets called.
That same template gets called to render many other elements. In
each case, it outputs <span class="foo">, where "foo" is the
DocBook element name. The stylesheets do it that way because, from
a development perspective, it's cleaner and easier to maintain.

Anyway, as far a HTML goes, <span class="acronym"> is for most (or
all) intents and purpose functionally the same as <acronym>. You
can style it with CSS by just doing "span.acronym {}" instead of
"acronym {}". And you can use XPath to find it just by doing
//*[@class = 'acronym'] instead of //acronym

-- 
Michael Smith
http://logopoeia.com/  http://www.oreillynet.com/pub/au/890

smime.p7s



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