
Von: "Henrik Genssen" thanks for you explanation as well.
Did anyone use http://www.exslt.org with lxml?
They seem to have many functions limbxml ready, but I could not find any examples using them with lxml or a recommendation for using it instead of XSLT2.
Yes, I've used some exslt stuff in the past, namely { http://exslt.org/dynamic%7Devaluate and {http://exslt.org/common%7Dnode-set, to do s.th. like
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:dyn="http://exslt.org/dynamic" xmlns:exsl="http://exslt.org/common%22%3E
...
<!-- use the xpath expression given in the column definition to dynamically create the column value --> <xsl:variable name="calculated" select="current()/@calculated"/> <!-- select the current schema node, to provide evaluation context for the @calculated xpath expression --> <xsl:for-each select="$currentNode"> xsl:text"</xsl:text> <!-- Dynamically evaluate the "calculated" xpath expression. This had to be separated from the next exsl:node-set step to keep Xalan happy (no problem with xsltproc, though) --> <xsl:variable name="calculatedResult" select="dyn:evaluate ($calculated)"/> <!-- Using exsl:node-set converts plain text results to a text() node set, so we can use for-each regardless of what the executed xpath expression given in the @calculated attribute returns --> <xsl:for-each select="exsl:node-set($calculatedResult)">
Not through lxml but directly with xsltproc but I'm sure this will also just work with lxml.
I am mostly interested in the date function - http://www.exslt.org/ date/index.html - especially DateAdd: http://www.exslt.org/date/functions/add/index.html
Haven't used this function.
If you don't care for usability of the stylesheet in a non-Python-context you might also consider using custom extension functions and XSLT extension elements:
http://lxml.de/xpathxslt.html#dealing-with-stylesheet-complexity
Holger
Landesbank Baden-Wuerttemberg Anstalt des oeffentlichen Rechts Hauptsitze: Stuttgart, Karlsruhe, Mannheim, Mainz HRA 12704 Amtsgericht Stuttgart