Table of Contents
![]() | Note to self: Need to add section on stylesheets, and all the XML and CSS stylesheets here. |
<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<!-- Copies the whole tree, with attributes. -->
<xsl:template match="node()|@*">
<xsl:copy><xsl:apply-templates select="node()|@*"/></xsl:copy>
</xsl:template>
<!-- Changes markup for programlisting. If the pathname is relative, it
strips off the first '../', because that is used only for the SGML
that operates from a subdirectory.-->
<xsl:template match="programlisting">
<xsl:variable name="fref" select="inlinemediaobject/imageobject/imagedata/@fileref"/>
<xsl:variable name="filenm">
<xsl:choose>
<!-- Note to self: change this to simply $fref after switching from SGML to XML,
take out the choose/otherwise option, and rewrite all paths without the
first '../' -->
<xsl:when test="(substring($fref, 1, 3)) = string('../')">
<xsl:value-of select="substring($fref, 4)"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$fref"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<programlisting>
<xsl:text disable-output-escaping="yes"><xi:include href="</xsl:text>
<xsl:value-of select="$filenm"/>
<xsl:text disable-output-escaping="yes">" parse="text"
xmlns:xi="http://www.w3.org/2001/XInclude"/></xsl:text>
</programlisting>
</xsl:template>
</xsl:stylesheet>
Copyright © 1995-2004 by Cogent Real-Time Systems, Inc. All rights reserved.