| •1 |
<?xml version='1.0'?> |
| 2 |
|
| 3 |
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> |
| 4 |
<xsl:output |
| 5 |
doctype-public="-//OASIS//DTD DocBook MathML Module V1.1b1//EN" |
| 6 |
doctype-system="http://www.oasis-open.org/docbook/xml/mathml/1.1CR1/dbmathml.dtd" |
| 7 |
cdata-section-elements="book" |
| 8 |
indent="yes" |
| 9 |
encoding="UTF-8" |
| 10 |
/> |
| 11 |
|
| 12 |
|
| 13 |
<xsl:template name="str.split"> |
| 14 |
<xsl:param name="text"/> |
| 15 |
<xsl:param name="elem"/> |
| 16 |
<xsl:param name="sep" /> |
| 17 |
<xsl:if test="string-length($text) > 0"> |
| 18 |
<xsl:variable name="next" select="substring-before(concat($text,$sep), $sep)"/> |
| 19 |
<xsl:element name="{$elem}"> |
| 20 |
<xsl:value-of select="normalize-space($next)"/> |
| 21 |
</xsl:element> |
| 22 |
<xsl:call-template name="str.split"> |
| 23 |
<xsl:with-param name="text" select="substring-after($text, $sep)"/> |
| 24 |
<xsl:with-param name="elem" select="$elem"/> |
| 25 |
<xsl:with-param name="sep" select="$sep"/> |
| 26 |
</xsl:call-template> |
| 27 |
</xsl:if> |
| 28 |
</xsl:template> |
| 29 |
|
| 30 |
|
| 31 |
<xsl:template match="@*|node()"> |
| 32 |
<xsl:copy> |
| 33 |
<xsl:apply-templates select="@*|node()"/> |
| 34 |
</xsl:copy> |
| 35 |
</xsl:template> |
| 36 |
|
| 37 |
<xsl:template match="refpurpose"> |
| 38 |
<refpurpose> |
| 39 |
<xsl:value-of select="normalize-space(.)"/> |
| 40 |
</refpurpose> |
| 41 |
</xsl:template> |
| 42 |
|
| 43 |
<xsl:template match="refname"> |
| 44 |
<refname> |
| 45 |
<xsl:value-of select="normalize-space(.)"/> |
| 46 |
</refname> |
| 47 |
</xsl:template> |
| 48 |
|
| 49 |
<xsl:template match="refentrytitle"> |
| 50 |
<refentrytitle> |
| 51 |
<xsl:value-of select="normalize-space(.)"/> |
| 52 |
</refentrytitle> |
| 53 |
</xsl:template> |
| 54 |
|
| 55 |
|
| 56 |
<xsl:template match="keyword"> |
| 57 |
<xsl:call-template name="str.split"> |
| 58 |
<xsl:with-param name="text" select="."/> |
| 59 |
<xsl:with-param name="elem" select="'keyword'"/> |
| 60 |
<xsl:with-param name="sep" select="', '"/> |
| 61 |
</xsl:call-template> |
| 62 |
</xsl:template> |
| 63 |
|
| 64 |
|
| 65 |
|
| 66 |
|
| 67 |
|
| 68 |
<xsl:template match="/refentry/refmeta/manvolnum"> |
| 69 |
<manvolnum> |
| 70 |
<xsl:value-of select="concat(normalize-space(.), 'clc')"/> |
| 71 |
</manvolnum> |
| 72 |
</xsl:template> |
| 73 |
|
| 74 |
|
| 75 |
|
| 76 |
<xsl:template match="copyright/holder"> |
| 77 |
<holder> |
| 78 |
<xsl:value-of select="concat(substring-before(normalize-space(), '. '), '.')"/> |
| 79 |
</holder> |
| 80 |
</xsl:template> |
| 81 |
|
| 82 |
|
| 83 |
<xsl:template match="/refentry/refentryinfo"> |
| 84 |
<xsl:copy> |
| 85 |
|
| 86 |
<xsl:apply-templates select="@*|node()"/> |
| 87 |
|
| 88 |
|
| 89 |
<xsl:variable name="wrongpath" select="../refmeta/refmiscinfo/copyright"/> |
| 90 |
|
| 91 |
<xsl:variable name="cprt" select="normalize-space($wrongpath)"/> |
| 92 |
<xsl:apply-templates select="$wrongpath"/> |
| 93 |
<xsl:element name="legalnotice"> |
| 94 |
|
| 95 |
|
| 96 |
<xsl:value-of select="substring-after($cprt, '. ')"/> |
| 97 |
</xsl:element> |
| 98 |
|
| 99 |
<xsl:element name="orgname"> |
| 100 |
<xsl:attribute name="class">consortium</xsl:attribute> |
| 101 |
<xsl:text>The Khronos Group</xsl:text> |
| 102 |
</xsl:element> |
| 103 |
</xsl:copy> |
| 104 |
</xsl:template> |
| 105 |
|
| 106 |
|
| 107 |
|
| 108 |
<xsl:template match="/refentry/refmeta/refmiscinfo"/> |
| 109 |
|
| 110 |
|
| 111 |
<xsl:template match="/refentry/refmeta"> |
| 112 |
<xsl:copy> |
| 113 |
|
| 114 |
<xsl:apply-templates select="@*|node()"/> |
| 115 |
|
| 116 |
<xsl:element name="refmiscinfo"> |
| 117 |
<xsl:attribute name="class">manual</xsl:attribute> |
| 118 |
<xsl:text>OpenCL Manual</xsl:text> |
| 119 |
</xsl:element> |
| 120 |
</xsl:copy> |
| 121 |
</xsl:template> |
| 122 |
|
| 123 |
|
| 124 |
|
| 125 |
|
| 126 |
<xsl:template match="link"> |
| 127 |
<xsl:value-of select="normalize-space(.)"/> |
| 128 |
</xsl:template> |
| 129 |
|
| 130 |
|
| 131 |
|
| 132 |
|
| 133 |
<xsl:template match="paramdef/parameter/text()[starts-with(.,'*')]"> |
| 134 |
<xsl:value-of select="substring-after(., '*')"/> |
| 135 |
</xsl:template> |
| 136 |
<xsl:template match="paramdef/parameter"> |
| 137 |
<xsl:text> </xsl:text> |
| 138 |
<xsl:if test="starts-with(text(), '*')"> |
| 139 |
<xsl:text>*</xsl:text> |
| 140 |
</xsl:if> |
| 141 |
<xsl:copy> |
| 142 |
<xsl:apply-templates select="@*|node()"/> |
| 143 |
</xsl:copy> |
| 144 |
</xsl:template> |
| 145 |
|
| 146 |
|
| 147 |
|
| 148 |
|
| 149 |
|
| 150 |
|
| 151 |
<xsl:template match="refsect1[@id='specification']//imageobject"/> |
| 152 |
|
| 153 |
|
| 154 |
|
| 155 |
<xsl:key name='specref' match='section' use='@id'/> |
| 156 |
<xsl:template match="olink"> |
| 157 |
<xsl:variable name="secref" select="@uri"/> |
| 158 |
<xsl:element name="ulink"> |
| 159 |
<xsl:attribute name="url"> |
| 160 |
|
| 161 |
<xsl:text>page </xsl:text> |
| 162 |
<xsl:for-each select="document('section-to-page.xml')"> |
| 163 |
<xsl:value-of select="key('specref', $secref)/page"/> |
| 164 |
</xsl:for-each> |
| 165 |
<xsl:text>, section </xsl:text> |
| 166 |
<xsl:for-each select="document('section-to-page.xml')"> |
| 167 |
<xsl:value-of select="key('specref', $secref)/title"/> |
| 168 |
</xsl:for-each> |
| 169 |
</xsl:attribute> |
| 170 |
<xsl:apply-templates/> |
| 171 |
</xsl:element> |
| 172 |
</xsl:template> |
| 173 |
|
| 174 |
|
| 175 |
<xsl:template match="refsect3[@id='Copyright']"/> |
| 176 |
|
| 177 |
|
| 178 |
<xsl:template match="refsect1[@id='seealso']/title"> |
| 179 |
<title>See also</title> |
| 180 |
</xsl:template> |
| 181 |
|
| 182 |
</xsl:stylesheet> |