(finally found some time to work on this...)
on Montag, 24. November 2008, Thomas Schraitle wrote:
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:
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
Indeed, that helps. There was a xsl:output tag sitting around already,
but commented out - unfortunately I don't remember why I disabled it
(might be because it included an encoding flag).
Nevertheless: Works _with_ the xsl:output tag :-)
I also changed my wrapper script to call zypper always with LANG=C
because I got some warnings about non-UTF8 input (I still use
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:
<message type="error">--terse is not implemented, does
# zypper --version
That's an outdated zypper version ;-) - openSUSE 11.1 has zypper 1.0.2.
I'll attach zypper output from 11.1 (and the updated XSLT file) in case
you want to test it.
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.
I changed the version and removed the xsl:document "wrap" around the
xsl:apply-templates for <update-status /> - still seems to work.
If you really need this functionality, use
the document element from the EXSLT initiative, see .
The only functionality I need is "parse the XML and output text/plain".
I don't really care how or why it works as long as it works ;-)
I guess, you need a new template with
match="message/text()" somewhere, but that could be a bit too
I found a working solution:
<!-- messages, unless type="info" -->
<xsl:if test="@type != 'info'">
<xsl:text> ERROR: </xsl:text>
Thanks for your help!
Lass Dir kein X für ein U vormachen,
sei auf der Hxt!