Web components
File detail
Source code
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" version="1.0" encoding="utf-8" indent="yes" omit-xml-declaration="yes"/>
<xsl:strip-space elements="*"/>
<!--<xsl:preserve-space elements="pre"/>
-->
<xsl:template match="/">
<xsl:apply-templates />
</xsl:template>
<!-- Match root element -->
<xsl:template match="/page">
<div id='content'>
<xsl:comment>Begin of block generated by XSLT processor using PageServer.xsl template</xsl:comment>
<xsl:call-template name="displayTitle"/>
<xsl:apply-templates/>
<xsl:comment>End of block generated by XSLT processor using PageServer.xsl template</xsl:comment>
</div>
</xsl:template>
<!-- Display H1 using $pageTitle PHP's variable -->
<xsl:template name="displayTitle">
<xsl:processing-instruction name="php">
echo " <h1>$pageTitle</h1>\n";
</xsl:processing-instruction>
</xsl:template>
<!-- Copy MainPage element's content to output document -->
<xsl:template match="MainPage[parent::page]">
<xsl:apply-templates mode="copy"/>
</xsl:template>
<!-- Handle processing instruction -->
<xsl:template match="processing-instruction('php')" mode="copy">
<xsl:processing-instruction name="php">
<xsl:value-of select="self::processing-instruction('php')"/>
</xsl:processing-instruction>
</xsl:template>
<!-- Copy all content recursively -->
<xsl:template match="*" mode="copy">
<xsl:copy>
<xsl:for-each select="@*">
<xsl:copy-of select="."/>
</xsl:for-each>
<xsl:apply-templates mode="copy"/>
</xsl:copy>
</xsl:template>
<!-- suppress default actions -->
<xsl:template match="*" />
</xsl:stylesheet>