|
Subject: Re: [xsl] *[@new='yes'] From: "Nikolai Grigoriev" <grig@xxxxxxxxxxx> Date: Tue, 6 Feb 2001 15:00:59 +0300 |
Gustaf,
One way to achieve it is to create a template that matches the attribute:
<xsl:template match="@new[.='yes']">
<xsl:attribute name="color">red</xsl:attribute>
</xsl:template>
Then you put a respective xsl:apply-templates inside each of the templates for
<p>, <h>, etc:
<xsl:template match="p">
<fo:block>
<xsl:apply-templates select="@new"/>
.....
</fo:block>
</xsl:template>
Regards,
Nikolai
----- Original Message -----
From: Gustaf Liljegren <gustaf.liljegren@xxxxxx>
To: <xsl-list-digest@xxxxxxxxxxxxxxxxxxxxxx>
Sent: Tuesday, February 06, 2001 2:02 PM
Subject: [xsl] *[@new='yes']
> Hello,
>
> I'm been playing with a sample where I'm trying to get all new parts of a
> document to show up in red, using XSL FO. There are headers, paragraphs and
> other typical document elements. All of them can have a new attribute with
> the value "yes", like this:
>
> <?xml version="1.0"?>
> <test>
> <h>This is a header, but it's not new.</h>
> <p>This paragraph is not new.</p>
> <p>This paragraph isn't new either.</p>
> <p new="yes">This paragraph is new.</p>
> <p>This isn't.</p>
> <h new="yes">This header is new</h>
> <p>Another paragraph. Not new.</p>
> <p new="yes">Another paragraph. New.</p>
> </test>
>
> The problem is that both headers and paragraphs has their default
> appearance too, and I haven't found a good way to just add the attribute
> color="red". Of course I could make separate templates, like p[@new='yes']
> and h[@new='yes'], but this means I must define their default appearance
twice.
>
> Regards,
>
> Gustaf Liljegren
>
>
> XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
>
>
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| Re: [xsl] *[@new='yes'], David Carlisle | Thread | RE: [xsl] *[@new='yes'], Richard Lander |
| Re: [xsl] Returning Xpath functions, David Carlisle | Date | RE: [xsl] Detecting presence of att, DPawson |
| Month |