RE: [docbook-apps] Adding attributes/parameters to the "<para>" template?

From
David White <>
Date
2006-02-22T21:15:24+00:00
ID
002001c637f5$567d3840$
Thread
RE: [docbook-apps] Adding attributes/parameters to the "<para>" template?
Something like this?

 

<xsl:template 
match="para[@pm='+++']">

<xsl:param 
name="pm" select="self::*[@pm][1]/@pm"/>

<fo:inline>

<xsl:value-of 
select="$pm"/></xsl:apply-templates>

</fo:inline>

</xsl:template>

 

If <para> has no pm attribute this template would be 
ignored.

<xsl:template match="strict_para[@pm] != 'xxx' 
">

</xsl:template>

The above would 
catch any use of <strict_para> that didn't have an attribute pm which 
equals 'xxx'.

A good place to 
read up on XSLT: http://en.wikipedia.org/wiki/XSLT

Hope that 
helps,

David 
White

From: Sheldon Plankton 
[mailto:] 
Sent: Wednesday, February 22, 2006 
2:09 PM
To: 
Subject: 
[docbook-apps] Adding attributes/parameters to the "<para>" 
template?

Hi,

I am having a hard time trying add a "para 
template" in my "customization" layer.

I would want to add an parameter to the para 
template.  This parameter would

contain a string that would be prepended to the 
paragraph. 

So if I had in my xml file this 
...

<para pm="+++ ">Hi there 
</para>

... output would be in html something like 
...

<p>+++ Hi 
there</p>

Also how would I make the template use a default value 
if the attribute/parameter

was left out?  Also how could I make another 
template say ... strict_para ... that

would cause an error if the parameter was left 
out?

I guess I should get a book on xsl ... right?  or 
is xstl?

Thanks

Plankton

What are the most popular cars? Find out at Yahoo! 
Autos