Project

Profile

Help

PyXsltProcessor.transform_to_file() not working. » try_saxon.xsl

Daniel Haley, 2021-03-18 22:41

 
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output indent="yes"/>
<xsl:strip-space elements="*"/>

<xsl:param name="before"/>
<xsl:param name="after"/>

<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>

<xsl:template match="/*">
<xsl:copy>
<xsl:attribute name="vendor" select="system-property('xsl:vendor')"/>
<xsl:attribute name="xsl_version" select="system-property('xsl:version')"/>
<xsl:attribute name="prod-name" select="system-property('xsl:product-name')"/>
<xsl:attribute name="prod-ver" select="system-property('xsl:product-version')"/>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
<xsl:message>Message from XSLT: Hello!</xsl:message>
</xsl:template>
<xsl:template match="li[contains(.,$before)]">
<xsl:copy>
<xsl:value-of select="replace(.,$before,$after)"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
(2-2/3)