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] Create caps presentation of phrase?


On Wed, Apr 02, 2003 at 09:35:24PM +0200, Steinar Bang wrote:
> Platform: DocBook XML 4.2, DocBook XSL 1.69.1
> 
> Is it simple/possible to do something in the local XSL customization
> layer, so that eg. <phrase role="caps">Some TeXt</phrase> can be
> rendered as "SOME TEXT"?
> 
> It's a request from a DocBook user at work, that I don't know how to
> answer. 

Sure, add this to your customization layer:

<xsl:template match="phrase[@role='caps']//text()">
   <xsl:value-of select="translate(., 'abcdefghijklmnopqrstuvwxyz',
	'ABCDEFGHIJKLMNOPQRSTUVWXYZ')"/>
</xsl:template>

This template matches on any text nodes ( text() )
that are ancestors ( // ) of <phrase role="caps">.
It applies the XSL translate() function to
the current node's text.  The translation converts
the lowercase letters to uppercase letters.

-- 

Bob Stayton                                 400 Encinal Street
Publications Architect                      Santa Cruz, CA  95060
Technical Publications                      voice: (831) 427-7796
The SCO Group                               fax:   (831) 429-1887
                                            email: bobs@sco.com


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