Saxon CE Example

来源:互联网 发布:移动硬盘分区隐藏软件 编辑:程序博客网 时间:2024/06/06 07:35

Saxon CE Start up code

Remember to put files inside the saxon folder. saxon ce has to be on the server.


stylesheet.html:

<!DOCTYPE html><html><head><title>stylesheet</title><script type="text/javascript" language="javascript"         src="../SaxonceDebug/Saxonce.nocache.js"></script><script type="text/javascript" language="javascript">  d = new Date();onSaxonLoad = function() {       proc = Saxon.run( {        stylesheet:   'stylesheet.xsl?'+ d.getUTCSeconds(),        source:       'stylesheet.xml?'+ d.getUTCSeconds(),        logLevel:     'SEVERE'    } );}</script></head><body><h1>stylesheet</h1><p>Auto-generated HTML template for Saxon-CE</p><div id="main"></div></body></html>



stylesheet.xml

<?xml version="1.0" encoding="utf-8"?><items><item>London</item><item>Paris</item><item>Rome</item><item>Prague</item></items>


stylesheet.xsl

<xsl:transformxmlns:xsl="http://www.w3.org/1999/XSL/Transform"xmlns:ixsl="http://saxonica.com/ns/interactiveXSLT"xmlns:js="http://saxonica.com/ns/globalJS"xmlns:prop="http://saxonica.com/ns/html-property"xmlns:style="http://saxonica.com/ns/html-style-property"xmlns:xs="http://www.w3.org/2001/XMLSchema"exclude-result-prefixes="xs prop"extension-element-prefixes="ixsl"version="2.0"><xsl:template name="main" match="/"><xsl:result-document href="#main" method="append-content"><ul><xsl:apply-templates select="items/item"/></ul></xsl:result-document></xsl:template><xsl:template match="item"><li><xsl:value-of select="."/></li></xsl:template></xsl:transform>