This is the mail archive of the
docbook-apps@lists.oasis-open.org
mailing list .
[docbook-apps] DSSSL/XSL: act on an attribute and then do the usual thing?
- From: Sam Steingold <sds at gnu dot org>
- To: docbook-apps at lists dot oasis-open dot org
- Date: 12 May 2003 12:49:11 -0400
- Subject: [docbook-apps] DSSSL/XSL: act on an attribute and then do the usual thing?
- Organization: disorganization
- Reply-to: sds at gnu dot org
suppose I want
<quote role="foo">bar</quote>
to be translated by the DSSSL and XSL into
<strong class="foo">"bar"</strong>
I do not want to copy the whole of the "quote" transforms into my *.dsl
and *.xsl customization layers.
I do not want to replace all my <quote role="foo">bar</quote> with
<emphasis role="foo"><quote>bar</quote></emphasis>
because I might want to use <tt> instead of <strong> and I do not want
to have to replace it again with
<literal role="foo"><quote>bar</quote></literal>
[actually, I would not have to do that, I will just need to change the
way <emphasis role="foo"> is handled, but forget that for a sec].
The bottom line is : how do I write:
(element quote
(let ((role (attribute-string (normalize "role"))))
(make element gi: "STRONG" attributes: (list (list "CLASS" role))
now-transform-the-original-quote-the-standard-way-as-if-there-was-no-role)))
and
<xsl:template match="quote[@role = 'package']">
<strong class="{@role}"><xsl:now-transform-the-original-quote-the-standard-way-as-if-there-was-no-role/></strong>
</xsl:template>
I thought that
<xsl:template match="quote[@role = 'package']">
<strong class="{@role}">
<xsl:call-template name="quote"/>
<xsl:apply-templates/>
</strong>
</xsl:template>
would work, but I get
runtime error: file common.xsl line 24 element call-template
xsl:call-template : template quote not found
any suggestions?
thanks!
--
Sam Steingold (http://www.podval.org/~sds) running RedHat9 GNU/Linux
<http://www.camera.org> <http://www.iris.org.il> <http://www.memri.org/>
<http://www.mideasttruth.com/> <http://www.palestine-central.com/links.html>
If Perl is the solution, you're solving the wrong problem. - Erik Naggum
---------------------------------------------------------------------
To unsubscribe, e-mail: docbook-apps-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: docbook-apps-help@lists.oasis-open.org