| 1 |
<?xml version='1.0'?> |
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" |
| 8 |
xmlns:fo="http://www.w3.org/1999/XSL/Format" |
| 9 |
version='1.0'> |
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
<xsl:template match="*[contains(@class,' topic/topic ')]/*[contains(@class,' topic/title ')]" priority="2"> |
| 19 |
<fo:block xsl:use-attribute-sets="topictitle1" padding-top="1.4pc"> |
| 20 |
<fo:block border-top-color="black" border-top-width="3pt" line-height="100%" |
| 21 |
border-left-width="0pt" border-right-width="0pt"> |
| 22 |
<xsl:call-template name="get-title"/> |
| 23 |
</fo:block> |
| 24 |
</fo:block> |
| 25 |
</xsl:template> |
| 26 |
|
| 27 |
|
| 28 |
<xsl:template match="*[contains(@class,' topic/topic ')]/*[contains(@class,' topic/topic ')]/*[contains(@class,' topic/title ')]" priority="3"> |
| 29 |
<fo:block xsl:use-attribute-sets="topictitle2" padding-top="1pc"> |
| 30 |
<fo:block border-top-color="black" border-top-width="1pt" |
| 31 |
border-left-width="0pt" border-right-width="0pt"> |
| 32 |
<xsl:call-template name="get-title"/> |
| 33 |
</fo:block> |
| 34 |
</fo:block> |
| 35 |
</xsl:template> |
| 36 |
|
| 37 |
|
| 38 |
<xsl:template match="*[contains(@class,' topic/topic ')]/*[contains(@class,' topic/topic ')]/*[contains(@class,' topic/topic ')]/*[contains(@class,' topic/title ')]" priority="4"> |
| 39 |
<fo:block xsl:use-attribute-sets="topictitle3"> |
| 40 |
<xsl:call-template name="get-title"/> |
| 41 |
</fo:block> |
| 42 |
</xsl:template> |
| 43 |
|
| 44 |
|
| 45 |
<xsl:template match="*[contains(@class,' topic/topic ')]/*[contains(@class,' topic/topic ')]/*[contains(@class,' topic/topic ')]/*[contains(@class,' topic/topic ')]/*[contains(@class,' topic/title ')]" priority="5"> |
| 46 |
<fo:block xsl:use-attribute-sets="topictitle4"> |
| 47 |
<xsl:if test="$trace='yes'"><fo:inline color="purple"></fo:inline></xsl:if> |
| 48 |
<xsl:call-template name="get-title"/> |
| 49 |
</fo:block> |
| 50 |
</xsl:template> |
| 51 |
|
| 52 |
|
| 53 |
<xsl:template match="*[contains(@class,' topic/topic ')]/*[contains(@class,' topic/topic ')]/*[contains(@class,' topic/topic ')]/*[contains(@class,' topic/topic ')]/*[contains(@class,' topic/topic ')]/*[contains(@class,' topic/title ')]" priority="6"> |
| 54 |
<fo:block xsl:use-attribute-sets="topictitle5"> |
| 55 |
<xsl:call-template name="get-title"/><xsl:text>: </xsl:text> |
| 56 |
</fo:block> |
| 57 |
</xsl:template> |
| 58 |
|
| 59 |
|
| 60 |
<xsl:template match="*[contains(@class,' topic/topic ')]/*[contains(@class,' topic/topic ')]/*[contains(@class,' topic/topic ')]/*[contains(@class,' topic/topic ')]/*[contains(@class,' topic/topic ')]/*[contains(@class,' topic/topic ')]/*[contains(@class,' topic/title ')]" priority="7"> |
| 61 |
<fo:block xsl:use-attribute-sets="topictitle6"> |
| 62 |
<xsl:call-template name="get-title"/><xsl:text>: </xsl:text> |
| 63 |
</fo:block> |
| 64 |
</xsl:template> |
| 65 |
|
| 66 |
|
| 67 |
|
| 68 |
|
| 69 |
<xsl:template match="*[contains(@class,' topic/section ')]/*[contains(@class,' topic/title ')]"> |
| 70 |
<fo:block font-weight="bold"> |
| 71 |
<xsl:apply-templates/> |
| 72 |
</fo:block> |
| 73 |
</xsl:template> |
| 74 |
|
| 75 |
|
| 76 |
|
| 77 |
|
| 78 |
<xsl:template match="*[contains(@class,' topic/example ')]/*[contains(@class,' topic/title ')]"> |
| 79 |
<fo:block font-weight="bold"> |
| 80 |
<xsl:apply-templates/> |
| 81 |
</fo:block> |
| 82 |
</xsl:template> |
| 83 |
|
| 84 |
|
| 85 |
|
| 86 |
|
| 87 |
<xsl:template match="*[contains(@class,' topic/table ')]/*[contains(@class,' topic/title ')]"> |
| 88 |
<xsl:variable name="tbl-pfx-txt"> |
| 89 |
<xsl:call-template name="getString"> |
| 90 |
<xsl:with-param name="stringName" select="'Table'"/> |
| 91 |
</xsl:call-template> |
| 92 |
<xsl:value-of select="count(preceding::*[contains(@class,' topic/table ')]/*[contains(@class,' topic/title ')])+1"/> |
| 93 |
</xsl:variable> |
| 94 |
<fo:block font-weight="bold"> |
| 95 |
<fo:inline color="red"><xsl:value-of select="$tbl-pfx-txt"/>. </fo:inline> |
| 96 |
<xsl:apply-templates/> |
| 97 |
</fo:block> |
| 98 |
</xsl:template> |
| 99 |
|
| 100 |
|
| 101 |
|
| 102 |
|
| 103 |
<xsl:template match="*[contains(@class,' topic/fig ')]/*[contains(@class,' topic/title ')]"> |
| 104 |
<xsl:variable name="fig-pfx-txt"> |
| 105 |
<xsl:call-template name="getString"> |
| 106 |
<xsl:with-param name="stringName" select="'Figure'"/> |
| 107 |
</xsl:call-template> |
| 108 |
<xsl:value-of select="count(preceding::*[contains(@class,' topic/fig ')]/*[contains(@class,' topic/title ')])+1"/> |
| 109 |
</xsl:variable> |
| 110 |
<fo:block font-weight="bold"> |
| 111 |
<fo:inline color="red"><xsl:value-of select="$fig-pfx-txt"/>. </fo:inline> |
| 112 |
<xsl:apply-templates/> |
| 113 |
</fo:block> |
| 114 |
</xsl:template> |
| 115 |
|
| 116 |
|
| 117 |
|
| 118 |
|
| 119 |
<xsl:template name="place-tbl-lbl"> |
| 120 |
<xsl:variable name="tbl-count"> |
| 121 |
<xsl:number count="*/table/title" level="multiple"/> |
| 122 |
</xsl:variable> |
| 123 |
<xsl:variable name="tbl-count-actual"> |
| 124 |
<xsl:choose> |
| 125 |
<xsl:when test="not($tbl-count>0) and not($tbl-count=0) and not($tbl-count<0)">1</xsl:when> |
| 126 |
<xsl:otherwise><xsl:value-of select="$tbl-count+1"/></xsl:otherwise> |
| 127 |
</xsl:choose> |
| 128 |
</xsl:variable> |
| 129 |
<xsl:choose> |
| 130 |
<xsl:when test="*[contains(@class,' topic/title ')]"> |
| 131 |
<fo:block><fo:inline font-weight="bold"> |
| 132 |
<xsl:call-template name="getString"> |
| 133 |
<xsl:with-param name="stringName" select="'Table'"/> |
| 134 |
</xsl:call-template><xsl:text> </xsl:text><xsl:value-of select="$tbl-count-actual"/>.<xsl:text> </xsl:text> |
| 135 |
<xsl:apply-templates select="*[contains(@class,' topic/title ')]" mode="exhibittitle"/> |
| 136 |
</fo:inline> |
| 137 |
<xsl:if test="*[contains(@class,' topic/desc ')]"> |
| 138 |
<xsl:text>. </xsl:text><xsl:apply-templates select="*[contains(@class,' topic/desc ')]" mode="exhibitdesc"/> |
| 139 |
</xsl:if> |
| 140 |
</fo:block> |
| 141 |
</xsl:when> |
| 142 |
<xsl:when test="*[contains(@class,' topic/desc ')]"> |
| 143 |
<fo:block>****<xsl:value-of select="*[contains(@class,' topic/desc ')]"/></fo:block> |
| 144 |
</xsl:when> |
| 145 |
</xsl:choose> |
| 146 |
</xsl:template> |
| 147 |
|
| 148 |
|
| 149 |
<xsl:template name="place-fig-lbl"> |
| 150 |
<xsl:variable name="fig-count"> |
| 151 |
<xsl:number count="*/fig/title" level="multiple"/> |
| 152 |
</xsl:variable> |
| 153 |
<xsl:variable name="fig-count-actual"> |
| 154 |
<xsl:choose> |
| 155 |
<xsl:when test="not($fig-count>0) and not($fig-count=0) and not($fig-count<0)">1</xsl:when> |
| 156 |
<xsl:otherwise><xsl:value-of select="$fig-count+1"/></xsl:otherwise> |
| 157 |
</xsl:choose> |
| 158 |
</xsl:variable> |
| 159 |
<xsl:choose> |
| 160 |
<xsl:when test="*[contains(@class,' topic/title ')]"> |
| 161 |
<fo:block><fo:inline font-weight="bold"> |
| 162 |
<xsl:call-template name="getString"> |
| 163 |
<xsl:with-param name="stringName" select="'Figure'"/> |
| 164 |
</xsl:call-template><xsl:text> </xsl:text><xsl:value-of select="$fig-count-actual"/>.<xsl:text> </xsl:text> |
| 165 |
<xsl:apply-templates select="*[contains(@class,' topic/title ')]" mode="exhibittitle"/> |
| 166 |
</fo:inline> |
| 167 |
<xsl:if test="desc"> |
| 168 |
<xsl:text>. </xsl:text><xsl:apply-templates select="*[contains(@class,' topic/desc ')]" mode="exhibitdesc"/> |
| 169 |
</xsl:if> |
| 170 |
</fo:block> |
| 171 |
</xsl:when> |
| 172 |
<xsl:when test="*[contains(@class, ' topic/desc ')]"> |
| 173 |
<fo:block>****<xsl:value-of select="*[contains(@class,' topic/desc ')]"/></fo:block> |
| 174 |
</xsl:when> |
| 175 |
</xsl:choose> |
| 176 |
</xsl:template> |
| 177 |
|
| 178 |
|
| 179 |
|
| 180 |
|
| 181 |
|
| 182 |
<xsl:template name="get-title"> |
| 183 |
|
| 184 |
|
| 185 |
|
| 186 |
<xsl:choose> |
| 187 |
<xsl:when test="parent::*/@id"> |
| 188 |
<xsl:apply-templates select="parent::*/@id"/> |
| 189 |
</xsl:when> |
| 190 |
|
| 191 |
<xsl:when test="parent::*[contains(@class, ' topic/topic ')]"> |
| 192 |
<fo:inline id="{generate-id(parent::*)}"></fo:inline> |
| 193 |
</xsl:when> |
| 194 |
<xsl:otherwise/> |
| 195 |
</xsl:choose> |
| 196 |
<xsl:choose> |
| 197 |
|
| 198 |
<xsl:when test="@spectitle"> |
| 199 |
<xsl:value-of select="@spectitle"/> |
| 200 |
</xsl:when> |
| 201 |
<xsl:otherwise> |
| 202 |
<xsl:apply-templates/> |
| 203 |
</xsl:otherwise> |
| 204 |
</xsl:choose> |
| 205 |
</xsl:template> |
| 206 |
|
| 207 |
<xsl:template name="get-sect-heading"> |
| 208 |
<xsl:choose> |
| 209 |
|
| 210 |
<xsl:when test="@spectitle"> |
| 211 |
<xsl:value-of select="@spectitle"/> |
| 212 |
</xsl:when> |
| 213 |
<xsl:otherwise> |
| 214 |
<xsl:apply-templates select="title"/> |
| 215 |
</xsl:otherwise> |
| 216 |
</xsl:choose> |
| 217 |
</xsl:template> |
| 218 |
|
| 219 |
|
| 220 |
<xsl:template name="sect-heading"> |
| 221 |
<xsl:param name="deftitle" select="."/> |
| 222 |
<xsl:variable name="heading"> |
| 223 |
<xsl:choose> |
| 224 |
<xsl:when test="*[contains(@class,' topic/title ')]"> |
| 225 |
<xsl:value-of select="*[contains(@class,' topic/title ')]"/> |
| 226 |
</xsl:when> |
| 227 |
<xsl:when test="@spectitle"> |
| 228 |
<xsl:value-of select="@spectitle"/> |
| 229 |
</xsl:when> |
| 230 |
<xsl:otherwise/> |
| 231 |
</xsl:choose> |
| 232 |
</xsl:variable> |
| 233 |
|
| 234 |
|
| 235 |
<xsl:choose> |
| 236 |
<xsl:when test="not($heading='')"> |
| 237 |
<xsl:if test="normalize-space($heading)=''"> |
| 238 |
|
| 239 |
|
| 240 |
</xsl:if> |
| 241 |
<xsl:value-of select="$heading"/> |
| 242 |
</xsl:when> |
| 243 |
<xsl:when test="$deftitle"> |
| 244 |
<xsl:value-of select="$deftitle"/> |
| 245 |
</xsl:when> |
| 246 |
<xsl:otherwise></xsl:otherwise> |
| 247 |
</xsl:choose> |
| 248 |
</xsl:template> |
| 249 |
|
| 250 |
|
| 251 |
</xsl:stylesheet> |