- Timestamp:
- Feb 21, 2023 12:06:11 PM (22 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/doc/manual/refsect2_replace.xsl
r98604 r98671 1 1 <!-- 2 2 refsect2_replace.xsl: 3 Replaces refsect2 elements with corresponding refsect1. 3 - Replaces refsect2 elements with corresponding refsect1. It looks 4 like dita does not like nested refsect sections. So we flat them out. 5 - When href attribute of a xref element has http in its value 6 then add scope="external" attribute to that element. This attribute 7 tells dita pdf output java stuff not to retrieve and parse those documents. 4 8 --> 5 9 <!-- … … 26 30 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> 27 31 <xsl:output encoding="UTF-8" method="xml" omit-xml-declaration="no" indent="yes" /> 28 <xsl:output doctype-system="http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" 29 doctype-public="-//OASIS//DTD DocBook XML V4.5//EN"/> 32 <xsl:output doctype-system="http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" doctype-public="-//OASIS//DTD DocBook XML V4.5//EN"/> 30 33 31 34 <xsl:template match="refsect2"> 32 35 <xsl:element name="refsect1"> 33 36 <xsl:for-each select="@*"> 34 <xsl:attribute name="{name()}"><xsl:value-of select="." /></xsl:attribute> 37 <xsl:attribute name="{name()}"> 38 <xsl:value-of select="." /> 39 </xsl:attribute> 35 40 </xsl:for-each> 36 41 <xsl:copy-of select="node()"/> 37 42 </xsl:element> 38 43 </xsl:template> 44 39 45 <xsl:template match="node()|@*"> 40 46 <xsl:copy> … … 42 48 </xsl:copy> 43 49 </xsl:template> 50 51 52 <xsl:template match="xref"> 53 <xsl:choose> 54 <xsl:when test="contains(@href, 'http')"> 55 <xsl:copy> 56 <xsl:attribute name="scope">external</xsl:attribute> 57 <xsl:apply-templates select="@*|node()"/> 58 </xsl:copy> 59 </xsl:when> 60 <xsl:otherwise> 61 <xsl:copy-of select="."/> 62 </xsl:otherwise> 63 </xsl:choose> 64 </xsl:template> 44 65 </xsl:stylesheet>
Note:
See TracChangeset
for help on using the changeset viewer.