Hi Christian, On Donnerstag, 8. März 2007, Christian Boltz wrote:
[...] I want to mail some documentation about available updates to root ;-) and hope that this makes this mail less off-topic here *g* - I need a bit help from XML/XSLT experts which I expect to be in the doc team ;-)
In short: I have written a xsl file that filters the output of zypp-checkpatches-wrapper to send an update notification mail to root.
It basically works, however I have some problems with the whitespace.
Basically, it is a good idea to use xsl:text and xsl:strip-space and/or xsl:preserve-space. Especially if you want exact control of your whitespace. It can be a bit tricky to find the correct combination though. :)
[...]
I'd like to have - no empty at the very beginning - "*** ERROR ***", "Update sources" and "=== ... ===" without leading whitespace - an empty line after the patch summary - less empty lines before "Total updates"
Can someone help me with these issues?
See the attached XSLT file. It gives me the following output: $ xsltproc patch2mail.xsl zypp.xml *** ERROR *** Some error during calculation happened *** ERROR *** Another error Update sources: ftp.gwdg.de (http://ftp.gwdg.de/pub/suse/update/10.1) irgendwo (http://ftp.irgendwo.de) === java-1_5_0-sun- Patch 1438-0(security) === SUN Java packages prior 1.5.0 update 7 allow DOS. Sun Java Runtime Environment (JRE) 1.5.0_6 and earlier, JDK 1.5.0_6 and earlier, and SDK 1.5.0_6 and earlier allows remote attackers to cause a denial of service (disk consumption) by using the Font.createFont function to create temporary files of arbitrary size in the %temp% directory (CVE-2006-2426). === java-1_5_0-sun- Patch 1438-0(security) === SUN Java packages prior 1.5.0 update 7 allow DOS. Sun Java Runtime Environment (JRE) 1.5.0_6 and earlier, JDK 1.5.0_6 and earlier, and SDK 1.5.0_6 and earlier allows remote attackers to cause a denial of service (disk consumption) by using the Font.createFont function to create temporary files of arbitrary size in the %temp% directory (CVE-2006-2426). Total updates: 2 (2 security) __TOTAL__22__ Bye, Tom -- ---------------------------------------------------------------------- SUSE LINUX Products GmbH >o) Documentation Team Maxfeldstrasse 5 /\\ Technical Editor 90409 Nuernberg, Germany _\_v http://en.opensuse.org/Documentation_Team