Mailinglist Archive: opensuse-doc (7 mails)

< Previous Next >
Re: [opensuse-doc] XSLT question - how to hide some items?
  • From: Thomas Schraitle <thomas.schraitle@xxxxxxx>
  • Date: Tue, 9 Dec 2008 14:20:53 +0100
  • Message-id: <200812091420.53855.thomas.schraitle@xxxxxxx>

On Tuesday 09 December 2008, Christian Boltz wrote:
I found a working solution:

<!-- messages, unless type="info" -->
<xsl:template match="message">
<xsl:if test="@type != 'info'">

You can omit the xsl:if clause with a predicate in "match" to
make it a bit more compact:

<xsl:template match="message[@type='info']">

Shouldn't it be "!=" instead of "="?

Ahh, you're right.

Maybe you need a another template to deal with general message
elements or with other message elements that contains other
values in your @type attributes. I haven't tested it. With your
given XML file both templates work.

Well, it's a matter of style not of functionality. :)

Then I'll keep the xsl:if ;-) and commit an updated patch2mail to
the buildservice later.

Whatever you like. Just to show you another possibilitiy. :)


Thomas Schraitle

SUSE LINUX GmbH >o) Documentation Specialist
Maxfeldstrasse 5 /\\
90409 Nuernberg _\_v
To unsubscribe, e-mail: opensuse-doc+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse-doc+help@xxxxxxxxxxxx

< Previous Next >
List Navigation