summaryrefslogtreecommitdiffstats
path: root/doc/xslt
diff options
context:
space:
mode:
authorDirk Baechle <dl9obn@darc.de>2013-05-03 22:30:28 (GMT)
committerDirk Baechle <dl9obn@darc.de>2013-05-03 22:30:28 (GMT)
commit106a09dc814071594306eed8382fd30929e605ab (patch)
tree5cda0c7b94858ef25546d5ae059e90aaf23e9ce0 /doc/xslt
parent6af67d1431b5d534731ff0dc17ff306639a1a854 (diff)
downloadSCons-106a09dc814071594306eed8382fd30929e605ab.zip
SCons-106a09dc814071594306eed8382fd30929e605ab.tar.gz
SCons-106a09dc814071594306eed8382fd30929e605ab.tar.bz2
- removed suffix= from 'scons_output_command ' and moved it
one up in the hierarchy to the 'scons_output' tag
Diffstat (limited to 'doc/xslt')
-rw-r--r--doc/xslt/to_docbook.xslt41
-rw-r--r--doc/xslt/xinclude_examples.xslt7
2 files changed, 38 insertions, 10 deletions
diff --git a/doc/xslt/to_docbook.xslt b/doc/xslt/to_docbook.xslt
index 25da999..0b39c28 100644
--- a/doc/xslt/to_docbook.xslt
+++ b/doc/xslt/to_docbook.xslt
@@ -19,6 +19,28 @@
<xsl:copy/>
</xsl:template>
+ <!-- Helper function for replacing strings in strings -->
+ <xsl:template name="string-replace-all">
+ <xsl:param name="text" />
+ <xsl:param name="replace" />
+ <xsl:param name="by" />
+ <xsl:choose>
+ <xsl:when test="contains($text, $replace)">
+ <xsl:value-of select="substring-before($text,$replace)" />
+ <xsl:value-of select="$by" />
+ <xsl:call-template name="string-replace-all">
+ <xsl:with-param name="text"
+ select="substring-after($text,$replace)" />
+ <xsl:with-param name="replace" select="$replace" />
+ <xsl:with-param name="by" select="$by" />
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$text" />
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
<!-- Leaving scons_example empty -->
<xsl:template match="scons:scons_example">
<xsl:apply-templates select="node()"/>
@@ -31,11 +53,10 @@
</xsl:element>
</xsl:template>
- <!-- Changing scons_output to screen -->
+ <!-- Leaving scons_output empty, should already
+ have been handled by xinclude_examples.xslt -->
<xsl:template match="scons:scons_output">
- <xsl:element name="screen">
- <xsl:apply-templates select="node()"/>
- </xsl:element>
+ <xsl:apply-templates select="node()"/>
</xsl:template>
<!-- Leaving scons_output_command empty, should already
@@ -54,7 +75,11 @@
<xsl:template match="scons:file">
<xsl:if test="@printme='1'">
<xsl:element name="programlisting">
- <xsl:apply-templates select="node()"/>
+ <xsl:call-template name="string-replace-all">
+ <xsl:with-param name="text" select="node()" />
+ <xsl:with-param name="replace" select="'__ROOT__'" />
+ <xsl:with-param name="by" select="''" />
+ </xsl:call-template>
</xsl:element>
</xsl:if>
</xsl:template>
@@ -62,7 +87,11 @@
<!-- Changing sconstruct to programlisting -->
<xsl:template match="scons:sconstruct">
<xsl:element name="programlisting">
- <xsl:apply-templates select="node()"/>
+ <xsl:call-template name="string-replace-all">
+ <xsl:with-param name="text" select="node()" />
+ <xsl:with-param name="replace" select="'__ROOT__'" />
+ <xsl:with-param name="by" select="''" />
+ </xsl:call-template>
</xsl:element>
</xsl:template>
diff --git a/doc/xslt/xinclude_examples.xslt b/doc/xslt/xinclude_examples.xslt
index 982391f..50696ac 100644
--- a/doc/xslt/xinclude_examples.xslt
+++ b/doc/xslt/xinclude_examples.xslt
@@ -19,11 +19,10 @@
<xsl:copy/>
</xsl:template>
- <!-- Changing scons_output_command to xinclude -->
- <xsl:template match="scons:scons_output_command">
+ <!-- Changing scons_output to xinclude -->
+ <xsl:template match="scons:scons_output">
<xsl:element name="xsi:include">
- <xsl:attribute name="href"><xsl:value-of select="concat('../generated/examples/',../@example,'_',@suffix,'.out')"></xsl:value-of></xsl:attribute>
- <xsl:attribute name="parse">text</xsl:attribute>
+ <xsl:attribute name="href"><xsl:value-of select="concat('../generated/examples/',@example,'_',@suffix,'.xml')"></xsl:value-of></xsl:attribute>
</xsl:element>
</xsl:template>