Mailinglist Archive: opensuse-doc (5 mails)

< Previous Next >
Re: [opensuse-doc] XSLT question - how to hide some items?
  • From: Thomas Schraitle <thomas.schraitle@xxxxxxx>
  • Date: Mon, 24 Nov 2008 08:55:52 +0100
  • Message-id: <200811240855.53240.thomas.schraitle@xxxxxxx>
Hi,

On Friday 21 November 2008, Christian Boltz wrote:
[...]
I have two small issues with my patch2mail (update notification)
script: It includes two lines at the end of the output which I'd
like to supress:

<?xml version="1.0"?>
Daten des Repositorys laden...Installierte Pakete lesen...

The first one is obviously the XML "header",

Yes, the header is the XML declaration. That's easy to omit it: Insert
a <xsl:output method="text"/> right after the <xsl:stylesheet>
element.


the second one is
composed from two <message type="info">...</message> lines.

The current XSLT file is attached - you can feed it with
zypper --xmlout -t patch | xsltproc patch2mail.xsl -
if you want to test it.

That doesn't work for me. If I use only the first part, I get:

<?xml version='1.0'?>
<stream>
<message type="error">--terse is not implemented, does
nothing</message>
<message type="error">Unknown command &apos;patch&apos;</message>
<message type="info">Type &apos;zypper help&apos; to get a list of
global options and commands.</message>
</stream>

# zypper --version
zypper 0.11.10


What do I have to change to remove the above lines?
(Note: Only messages with type "info" should be hidden.)

First, fix your stylesheet. :) It contains version="1.1". As far as I
know, this version is not really supported by libxslt. Use
version="1.0". Especially the xsl:document element is unknown in the
XSLT 1.0 specification. If you really need this functionality, use
the document element from the EXSLT initiative, see [1].

I guess, you need a new template with match="text()" or
match="message/text()" somewhere, but that could be a bit too
radical.


Bye,
Tom

------
[1] http://www.exslt.org/exsl/elements/document/index.html


--
Thomas Schraitle

----------------------------------------------------------------------
SUSE LINUX GmbH >o) Documentation Specialist
Maxfeldstrasse 5 /\\
90409 Nuernberg _\_v http://en.opensuse.org/Documentation_Team
http://developer.novell.com/wiki/index.php/Lessons_for_Lizards
http://lizards.opensuse.org/author/thomas-schraitle/
---------------------------------------------------------------------
--
To unsubscribe, e-mail: opensuse-doc+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse-doc+help@xxxxxxxxxxxx

< Previous Next >
List Navigation
References