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 attributes/parameters to the "<para>" template?

Hi David
Thanks that works.   But after thinking about it I could always just
put the text I want to appear at the start of each paragraph by putting
the text there like so ...
<para>+++ blah blah blah</para>
... so I will probably not use that version of the para template.
But the strict_para is useful in situations where it is important
that paragraphs start with a particular string.  And I probably
didn't make it clear that this template would work like this ...
<strict_para pm="XXX --">blah blah blah</strict_para>
<strict_para pm="lmnop: ">blah blah blah</strict_para>
... this would result in html ...
<p>XXX --blah blah blah</p>
<p>lmnop: blah blah blah</p>
... while ...
<strict_para>blah blah blah</strict_para>
... or ...
<strict_para pm="">blah blah blah</strict_para>
... would result in an error.

David White <davidw@kencook.com> wrote:
Something like this?
<xsl:template match="para[@pm='+++']">
<xsl:param name="pm" select="self::*[@pm][1]/@pm"/>
<xsl:value-of select="$pm"/></xsl:apply-templates>
If <para> has no pm attribute this template would be ignored.
<xsl:template match="strict_para[@pm] != 'xxx' ">
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:sheldonplankton@yahoo.com]
Sent: Wednesday, February 22, 2006 2:09 PM
To: docbook-apps@lists.oasis-open.org
Subject: [docbook-apps] Adding attributes/parameters to the "<para>" template?

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?

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

Yahoo! Mail
Use Photomail to share photos without annoying attachments.

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