| 1 | <?xml version="1.0"?> |
|---|
| 2 | |
|---|
| 3 | <!-- <!ENTITY acute "´">--> |
|---|
| 4 | |
|---|
| 5 | <!DOCTYPE xsl:stylesheet [ |
|---|
| 6 | <!ENTITY nbsp " "> |
|---|
| 7 | <!ENTITY acute "'"> |
|---|
| 8 | <!ENTITY dotwidth "20"> |
|---|
| 9 | <!ENTITY dotheight "16"> |
|---|
| 10 | <!ENTITY tab "	"> |
|---|
| 11 | <!ENTITY br "
"> |
|---|
| 12 | ]> |
|---|
| 13 | |
|---|
| 14 | |
|---|
| 15 | <!-- used to create ARB help in internal format --> |
|---|
| 16 | |
|---|
| 17 | |
|---|
| 18 | <xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" |
|---|
| 19 | version="1.0" |
|---|
| 20 | > |
|---|
| 21 | |
|---|
| 22 | <!-- <xsl:output method="text" encoding='iso-8859-15'/>--> |
|---|
| 23 | <xsl:output method="text"/> |
|---|
| 24 | |
|---|
| 25 | <xsl:param name="myname"/> |
|---|
| 26 | <xsl:param name="xml_location"/> |
|---|
| 27 | |
|---|
| 28 | <!-- includes --> |
|---|
| 29 | |
|---|
| 30 | <xsl:include href="date.xsl"/> |
|---|
| 31 | |
|---|
| 32 | <xsl:variable name="rootpath"> |
|---|
| 33 | <xsl:choose> |
|---|
| 34 | <xsl:when test="string-length(substring-before($myname,'/'))>0">../</xsl:when> |
|---|
| 35 | <xsl:otherwise></xsl:otherwise> |
|---|
| 36 | </xsl:choose> |
|---|
| 37 | </xsl:variable> |
|---|
| 38 | |
|---|
| 39 | <xsl:variable name="author">ARB development</xsl:variable> |
|---|
| 40 | <xsl:variable name="maildomain">arb-home.de</xsl:variable> |
|---|
| 41 | |
|---|
| 42 | <!--columns allowed in preformatted text output. |
|---|
| 43 | has to match value in arb_help2xml.cxx@preformatted-default-width |
|---|
| 44 | --> |
|---|
| 45 | <xsl:variable name="preformatted-default-width"><xsl:value-of select="91"/></xsl:variable> |
|---|
| 46 | |
|---|
| 47 | <!--columns in text output (applies only to reflown text). derived from width of help window in arb. --> |
|---|
| 48 | <xsl:variable name="reflow-width" select="$preformatted-default-width - 3"/> |
|---|
| 49 | |
|---|
| 50 | <xsl:variable name="lb"><xsl:text>&br;</xsl:text></xsl:variable> <!--used to detect line-breaks in XML--> |
|---|
| 51 | |
|---|
| 52 | <!-- =============== --> |
|---|
| 53 | <!-- warning --> |
|---|
| 54 | <!-- =============== --> |
|---|
| 55 | |
|---|
| 56 | <xsl:template name="error"> |
|---|
| 57 | <xsl:param name="text" select="'Unknown error'"/> |
|---|
| 58 | <xsl:message terminate="yes">Error: <xsl:value-of select="$text"/></xsl:message> |
|---|
| 59 | </xsl:template> |
|---|
| 60 | <xsl:template name="warning"> |
|---|
| 61 | <xsl:param name="text" select="'Unknown warning'"/> |
|---|
| 62 | <xsl:message terminate="no">Warning: <xsl:value-of select="$text"/></xsl:message> |
|---|
| 63 | </xsl:template> |
|---|
| 64 | |
|---|
| 65 | <!-- ============ --> |
|---|
| 66 | <!-- LINKs --> |
|---|
| 67 | <!-- ============ --> |
|---|
| 68 | |
|---|
| 69 | <!--insert-link--> |
|---|
| 70 | <xsl:template name="insert-link"> |
|---|
| 71 | <xsl:param name="address"/> |
|---|
| 72 | <xsl:param name="linktext"/> |
|---|
| 73 | |
|---|
| 74 | <xsl:copy-of select="$address"/> |
|---|
| 75 | <!-- [see: <xsl:value-of select="$address"/><xsl:text>]</xsl:text>--> |
|---|
| 76 | </xsl:template> |
|---|
| 77 | |
|---|
| 78 | <!--insert-email-link--> |
|---|
| 79 | <xsl:template name="insert-email-link"> |
|---|
| 80 | <xsl:param name="linktext"/> |
|---|
| 81 | <xsl:param name="address" select="arb"/> |
|---|
| 82 | <xsl:param name="subject"/> |
|---|
| 83 | |
|---|
| 84 | |
|---|
| 85 | <xsl:variable name="add"> |
|---|
| 86 | <xsl:choose> |
|---|
| 87 | <xsl:when test="string-length(substring-before($address,'@'))>0"><xsl:value-of select="$address"/></xsl:when> |
|---|
| 88 | <xsl:otherwise><xsl:value-of select="$address"/>@<xsl:value-of select="$maildomain"/></xsl:otherwise> |
|---|
| 89 | </xsl:choose> |
|---|
| 90 | </xsl:variable> |
|---|
| 91 | |
|---|
| 92 | <xsl:value-of select="$linktext"/> [mailto: <xsl:value-of select="$add"/> |
|---|
| 93 | <xsl:text> subject: ´</xsl:text> |
|---|
| 94 | <xsl:value-of select="$subject"/> |
|---|
| 95 | <xsl:text>´]</xsl:text> |
|---|
| 96 | |
|---|
| 97 | </xsl:template> |
|---|
| 98 | |
|---|
| 99 | <!-- ======================== --> |
|---|
| 100 | <!-- link-to-document --> |
|---|
| 101 | <!-- ======================== --> |
|---|
| 102 | <xsl:template name="link-to-document"> |
|---|
| 103 | <xsl:param name="doc"/> |
|---|
| 104 | <xsl:param name="missing"/> |
|---|
| 105 | <xsl:param name="type"/> |
|---|
| 106 | |
|---|
| 107 | <xsl:choose> |
|---|
| 108 | <xsl:when test="$type='ps'"> |
|---|
| 109 | <xsl:text>Postscript: </xsl:text> |
|---|
| 110 | <xsl:value-of select="$doc"/> |
|---|
| 111 | </xsl:when> |
|---|
| 112 | <xsl:when test="$type='pdf'"> |
|---|
| 113 | <xsl:text>PDF: </xsl:text> |
|---|
| 114 | <xsl:value-of select="$doc"/> |
|---|
| 115 | </xsl:when> |
|---|
| 116 | <xsl:when test="$type='hlp'"> |
|---|
| 117 | <xsl:variable name="docbase"> |
|---|
| 118 | <xsl:value-of select="substring-before($doc,'.hlp')"/> |
|---|
| 119 | </xsl:variable> |
|---|
| 120 | <xsl:choose> |
|---|
| 121 | <xsl:when test="$missing='1'"> |
|---|
| 122 | <xsl:value-of select="concat('Missing Link to ',$docbase,'.hlp')"/> |
|---|
| 123 | </xsl:when> |
|---|
| 124 | <xsl:otherwise> |
|---|
| 125 | <xsl:for-each select="document(concat($xml_location,'/',$docbase,'.xml'))"> |
|---|
| 126 | <xsl:for-each select="PAGE/TITLE">´<xsl:copy-of select="normalize-space(text())"/>´</xsl:for-each> |
|---|
| 127 | </xsl:for-each> |
|---|
| 128 | </xsl:otherwise> |
|---|
| 129 | </xsl:choose> |
|---|
| 130 | </xsl:when> |
|---|
| 131 | <xsl:otherwise> |
|---|
| 132 | <xsl:call-template name="error"><xsl:with-param name="text">Unhandled document link type '<xsl:value-of select="$type"/>' in link-to-document</xsl:with-param></xsl:call-template> |
|---|
| 133 | </xsl:otherwise> |
|---|
| 134 | </xsl:choose> |
|---|
| 135 | </xsl:template> |
|---|
| 136 | |
|---|
| 137 | <!-- ==================== --> |
|---|
| 138 | <!-- up/sublinks --> |
|---|
| 139 | |
|---|
| 140 | <xsl:template name="help-link"> |
|---|
| 141 | <xsl:param name="dest"/> |
|---|
| 142 | |
|---|
| 143 | <xsl:value-of select="$dest"/> |
|---|
| 144 | <xsl:text>&br;</xsl:text> |
|---|
| 145 | </xsl:template> |
|---|
| 146 | |
|---|
| 147 | <xsl:template name="insert-topic"> |
|---|
| 148 | <xsl:param name="type"/> |
|---|
| 149 | <xsl:param name="dest"/> |
|---|
| 150 | |
|---|
| 151 | <xsl:value-of select="$type"/> |
|---|
| 152 | <xsl:text> </xsl:text> |
|---|
| 153 | <xsl:call-template name="help-link"> |
|---|
| 154 | <xsl:with-param name="dest" select="$dest"/> |
|---|
| 155 | </xsl:call-template> |
|---|
| 156 | </xsl:template> |
|---|
| 157 | |
|---|
| 158 | <xsl:template match="UP" mode="uplinks"> |
|---|
| 159 | <xsl:call-template name="insert-topic"> |
|---|
| 160 | <xsl:with-param name="type" select="'UP '"/> |
|---|
| 161 | <xsl:with-param name="dest" select="@dest"/> |
|---|
| 162 | </xsl:call-template> |
|---|
| 163 | </xsl:template> |
|---|
| 164 | <xsl:template match="*|text()" mode="uplinks"></xsl:template> |
|---|
| 165 | |
|---|
| 166 | <xsl:template match="SUB" mode="sublinks"> |
|---|
| 167 | <xsl:call-template name="insert-topic"> |
|---|
| 168 | <xsl:with-param name="type" select="'SUB'"/> |
|---|
| 169 | <xsl:with-param name="dest" select="@dest"/> |
|---|
| 170 | </xsl:call-template> |
|---|
| 171 | </xsl:template> |
|---|
| 172 | <xsl:template match="*|text()" mode="sublinks"></xsl:template> |
|---|
| 173 | |
|---|
| 174 | <!-- ==================== --> |
|---|
| 175 | <!-- indentation --> |
|---|
| 176 | |
|---|
| 177 | <xsl:template match="ENTRY|P" mode="calc-indent"> |
|---|
| 178 | <xsl:text> </xsl:text><!--this defines the indentation per level--> |
|---|
| 179 | <xsl:apply-templates mode="calc-indent" select=".."/> |
|---|
| 180 | </xsl:template> |
|---|
| 181 | <xsl:template match="T|ENUM|LIST" mode="calc-indent"> |
|---|
| 182 | <xsl:apply-templates mode="calc-indent" select=".."/> |
|---|
| 183 | </xsl:template> |
|---|
| 184 | <xsl:template match="SECTION" mode="calc-indent"></xsl:template> |
|---|
| 185 | |
|---|
| 186 | <xsl:template name="find-last-space"> |
|---|
| 187 | <xsl:param name="text"/> |
|---|
| 188 | <xsl:param name="len" select="string-length($text)"/> |
|---|
| 189 | |
|---|
| 190 | <xsl:variable name="beforelen" select="string-length(substring-before($text,' '))"/> |
|---|
| 191 | <xsl:variable name="after" select="substring-after($text,' ')"/> |
|---|
| 192 | <xsl:variable name="afterlen" select="string-length($after)"/> |
|---|
| 193 | |
|---|
| 194 | <xsl:choose> |
|---|
| 195 | <xsl:when test="number($afterlen)>0"> |
|---|
| 196 | <!--sth behind space--> |
|---|
| 197 | <xsl:variable name="next-space"> |
|---|
| 198 | <xsl:call-template name="find-last-space"> |
|---|
| 199 | <xsl:with-param name="text" select="$after"/> |
|---|
| 200 | <xsl:with-param name="len" select="$afterlen"/> |
|---|
| 201 | </xsl:call-template> |
|---|
| 202 | </xsl:variable> |
|---|
| 203 | <xsl:value-of select="number($beforelen)+1+number($next-space)"/> |
|---|
| 204 | </xsl:when> |
|---|
| 205 | <xsl:otherwise> <!--$afterlen=0--> |
|---|
| 206 | <xsl:choose> |
|---|
| 207 | <xsl:when test="number($beforelen)=0"> |
|---|
| 208 | <!--no spaces found--> |
|---|
| 209 | <xsl:value-of select="'0'"/> |
|---|
| 210 | </xsl:when> |
|---|
| 211 | <xsl:otherwise> |
|---|
| 212 | <!--space at last position--> |
|---|
| 213 | <xsl:value-of select="number($beforelen)+1"/> |
|---|
| 214 | </xsl:otherwise> |
|---|
| 215 | </xsl:choose> |
|---|
| 216 | </xsl:otherwise> |
|---|
| 217 | </xsl:choose> |
|---|
| 218 | </xsl:template> |
|---|
| 219 | |
|---|
| 220 | <xsl:template name="print-length-checked-line"> |
|---|
| 221 | <xsl:param name="indent" select="''"/> |
|---|
| 222 | <xsl:param name="text"/> |
|---|
| 223 | <xsl:param name="prefix" select="''"/> |
|---|
| 224 | <xsl:param name="preformatted-width"/> |
|---|
| 225 | |
|---|
| 226 | <xsl:variable name="indent-length"><xsl:value-of select="string-length($indent) + string-length($prefix)"/></xsl:variable> |
|---|
| 227 | <xsl:variable name="printlen"><xsl:value-of select="$preformatted-width - $indent-length"/></xsl:variable> |
|---|
| 228 | <xsl:variable name="textlen"><xsl:value-of select="string-length($text)"/></xsl:variable> |
|---|
| 229 | |
|---|
| 230 | <xsl:if test="$textlen > $printlen"> |
|---|
| 231 | <xsl:call-template name="warning"> |
|---|
| 232 | <xsl:with-param name="text">Preformatted text '<xsl:value-of select="$text"/>' is <xsl:value-of select="$textlen - $printlen"/> characters too wide.</xsl:with-param> |
|---|
| 233 | </xsl:call-template> |
|---|
| 234 | </xsl:if> |
|---|
| 235 | |
|---|
| 236 | <xsl:value-of select="concat($indent,$prefix,$text)"/> |
|---|
| 237 | <xsl:text>&br;</xsl:text> |
|---|
| 238 | </xsl:template> |
|---|
| 239 | |
|---|
| 240 | <xsl:template name="indent-preformatted"> |
|---|
| 241 | <xsl:param name="indent" select="''"/> |
|---|
| 242 | <xsl:param name="text"/> |
|---|
| 243 | <xsl:param name="prefix" select="''"/> |
|---|
| 244 | <xsl:param name="preformatted-width"/> |
|---|
| 245 | |
|---|
| 246 | <xsl:variable name="indent-length"><xsl:value-of select="string-length($indent) + string-length($prefix)"/></xsl:variable> |
|---|
| 247 | <xsl:variable name="printlen"><xsl:value-of select="$reflow-width - $indent-length"/></xsl:variable> |
|---|
| 248 | <xsl:variable name="textlen"><xsl:value-of select="string-length($text)"/></xsl:variable> |
|---|
| 249 | |
|---|
| 250 | <xsl:variable name="line1" select="substring-before($text,$lb)"/> |
|---|
| 251 | <xsl:variable name="line2" select="substring-after($text,$lb)"/> |
|---|
| 252 | |
|---|
| 253 | <xsl:choose> |
|---|
| 254 | <xsl:when test="concat($line1,$line2)=''"> |
|---|
| 255 | <xsl:call-template name="print-length-checked-line"> |
|---|
| 256 | <xsl:with-param name="indent" select="$indent"/> |
|---|
| 257 | <xsl:with-param name="text" select="$text"/> |
|---|
| 258 | <xsl:with-param name="prefix" select="$prefix"/> |
|---|
| 259 | <xsl:with-param name="preformatted-width" select="$preformatted-width"/> |
|---|
| 260 | </xsl:call-template> |
|---|
| 261 | </xsl:when> |
|---|
| 262 | <xsl:when test="string-length($line1)=0"> |
|---|
| 263 | <xsl:call-template name="indent-preformatted"> |
|---|
| 264 | <xsl:with-param name="indent" select="$indent"/> |
|---|
| 265 | <xsl:with-param name="text" select="$line2"/> |
|---|
| 266 | <xsl:with-param name="prefix" select="$prefix"/> |
|---|
| 267 | <xsl:with-param name="preformatted-width" select="$preformatted-width"/> |
|---|
| 268 | </xsl:call-template> |
|---|
| 269 | </xsl:when> |
|---|
| 270 | <xsl:otherwise> |
|---|
| 271 | <xsl:call-template name="print-length-checked-line"> |
|---|
| 272 | <xsl:with-param name="indent" select="$indent"/> |
|---|
| 273 | <xsl:with-param name="text" select="$line1"/> |
|---|
| 274 | <xsl:with-param name="prefix" select="$prefix"/> |
|---|
| 275 | <xsl:with-param name="preformatted-width" select="$preformatted-width"/> |
|---|
| 276 | </xsl:call-template> |
|---|
| 277 | |
|---|
| 278 | <xsl:if test="string-length($line2)>0"> |
|---|
| 279 | <xsl:variable name="next-indent"> |
|---|
| 280 | <xsl:choose> |
|---|
| 281 | <xsl:when test="$prefix=''"> |
|---|
| 282 | <xsl:value-of select="$indent"/> |
|---|
| 283 | </xsl:when> |
|---|
| 284 | <xsl:otherwise> |
|---|
| 285 | <xsl:variable name="enough-spaces"> |
|---|
| 286 | <xsl:value-of select="$indent"/> |
|---|
| 287 | <xsl:text> </xsl:text> |
|---|
| 288 | </xsl:variable> |
|---|
| 289 | <xsl:value-of select="substring($enough-spaces, 1, $indent-length)"/> |
|---|
| 290 | </xsl:otherwise> |
|---|
| 291 | </xsl:choose> |
|---|
| 292 | </xsl:variable> |
|---|
| 293 | |
|---|
| 294 | <xsl:call-template name="indent-preformatted"> |
|---|
| 295 | <xsl:with-param name="indent" select="$next-indent"/> |
|---|
| 296 | <xsl:with-param name="text" select="$line2"/> |
|---|
| 297 | <xsl:with-param name="preformatted-width" select="$preformatted-width"/> |
|---|
| 298 | </xsl:call-template> |
|---|
| 299 | </xsl:if> |
|---|
| 300 | </xsl:otherwise> |
|---|
| 301 | </xsl:choose> |
|---|
| 302 | </xsl:template> |
|---|
| 303 | |
|---|
| 304 | <xsl:template name="reflow-paragraph"> |
|---|
| 305 | <xsl:param name="indent" select="''"/> |
|---|
| 306 | <xsl:param name="text"/> |
|---|
| 307 | <xsl:param name="prefix" select="''"/> |
|---|
| 308 | |
|---|
| 309 | <xsl:variable name="indent-length"><xsl:value-of select="string-length($indent) + string-length($prefix)"/></xsl:variable> |
|---|
| 310 | <xsl:variable name="printlen"><xsl:value-of select="$reflow-width - $indent-length"/></xsl:variable> |
|---|
| 311 | <xsl:variable name="textlen"><xsl:value-of select="string-length($text)"/></xsl:variable> |
|---|
| 312 | |
|---|
| 313 | <xsl:variable name="this-indent"> |
|---|
| 314 | <xsl:choose> |
|---|
| 315 | <xsl:when test="$prefix=''"> |
|---|
| 316 | <xsl:value-of select="$indent"/> |
|---|
| 317 | </xsl:when> |
|---|
| 318 | <xsl:otherwise> |
|---|
| 319 | <xsl:value-of select="$indent"/> |
|---|
| 320 | <xsl:value-of select="$prefix"/> |
|---|
| 321 | </xsl:otherwise> |
|---|
| 322 | </xsl:choose> |
|---|
| 323 | </xsl:variable> |
|---|
| 324 | |
|---|
| 325 | <xsl:choose> |
|---|
| 326 | <xsl:when test="number($printlen) >= number($textlen)"> |
|---|
| 327 | <xsl:value-of select="concat($this-indent,$text)"/> |
|---|
| 328 | <xsl:text>&br;</xsl:text> |
|---|
| 329 | </xsl:when> |
|---|
| 330 | <xsl:otherwise> |
|---|
| 331 | <xsl:variable name="last-space"> |
|---|
| 332 | <xsl:call-template name="find-last-space"> |
|---|
| 333 | <xsl:with-param name="text" select="substring($text,1,$printlen+1)"/> |
|---|
| 334 | <xsl:with-param name="len" select="$printlen+1"/> |
|---|
| 335 | </xsl:call-template> |
|---|
| 336 | </xsl:variable> |
|---|
| 337 | |
|---|
| 338 | <xsl:variable name="print"> |
|---|
| 339 | <xsl:choose> |
|---|
| 340 | <xsl:when test="$last-space='0'"><xsl:value-of select="substring($text,1,$printlen)"/></xsl:when> |
|---|
| 341 | <xsl:otherwise><xsl:value-of select="substring($text,1,$last-space - 1)"/></xsl:otherwise> |
|---|
| 342 | </xsl:choose> |
|---|
| 343 | </xsl:variable> |
|---|
| 344 | <xsl:variable name="rest"> |
|---|
| 345 | <xsl:choose> |
|---|
| 346 | <xsl:when test="$last-space='0'"><xsl:value-of select="substring($text,$printlen+1)"/></xsl:when> |
|---|
| 347 | <xsl:otherwise><xsl:value-of select="substring($text,$last-space+1)"/></xsl:otherwise> |
|---|
| 348 | </xsl:choose> |
|---|
| 349 | </xsl:variable> |
|---|
| 350 | |
|---|
| 351 | <xsl:variable name="restlen"><xsl:value-of select="string-length($rest)"/></xsl:variable> |
|---|
| 352 | |
|---|
| 353 | <xsl:value-of select="concat($this-indent,$print)"/> |
|---|
| 354 | <xsl:text>&br;</xsl:text> |
|---|
| 355 | |
|---|
| 356 | <xsl:if test="number($restlen)"> |
|---|
| 357 | |
|---|
| 358 | <xsl:variable name="next-indent"> |
|---|
| 359 | <xsl:choose> |
|---|
| 360 | <xsl:when test="$prefix=''"> |
|---|
| 361 | <xsl:value-of select="$indent"/> |
|---|
| 362 | </xsl:when> |
|---|
| 363 | <xsl:otherwise> |
|---|
| 364 | <xsl:variable name="enough-spaces"> |
|---|
| 365 | <xsl:value-of select="$indent"/> |
|---|
| 366 | <xsl:text> </xsl:text> |
|---|
| 367 | </xsl:variable> |
|---|
| 368 | <xsl:value-of select="substring($enough-spaces, 1, $indent-length)"/> |
|---|
| 369 | </xsl:otherwise> |
|---|
| 370 | </xsl:choose> |
|---|
| 371 | </xsl:variable> |
|---|
| 372 | |
|---|
| 373 | <xsl:call-template name="reflow-paragraph"> |
|---|
| 374 | <xsl:with-param name="indent" select="$next-indent"/> |
|---|
| 375 | <xsl:with-param name="text" select="$rest"/> |
|---|
| 376 | </xsl:call-template> |
|---|
| 377 | </xsl:if> |
|---|
| 378 | </xsl:otherwise> |
|---|
| 379 | </xsl:choose> |
|---|
| 380 | </xsl:template> |
|---|
| 381 | |
|---|
| 382 | <xsl:template match="ENTRY" mode="calc-prefix"> |
|---|
| 383 | <xsl:choose> |
|---|
| 384 | <xsl:when test="name(..)='ENUM'"> |
|---|
| 385 | <xsl:value-of select="@enumerated"/> |
|---|
| 386 | <xsl:text>. </xsl:text> |
|---|
| 387 | </xsl:when> |
|---|
| 388 | <xsl:when test="name(..)='LIST'"><xsl:text>* </xsl:text></xsl:when> |
|---|
| 389 | <xsl:otherwise></xsl:otherwise> |
|---|
| 390 | </xsl:choose> |
|---|
| 391 | </xsl:template> |
|---|
| 392 | |
|---|
| 393 | <xsl:template match="ENUM|LIST" mode="calc-prefix"> |
|---|
| 394 | <xsl:call-template name="error"><xsl:with-param name="text">Illegal ENUM or LIST in calc-prefix-mode</xsl:with-param></xsl:call-template> |
|---|
| 395 | </xsl:template> |
|---|
| 396 | <xsl:template match="*|text()" mode="calc-prefix"> |
|---|
| 397 | </xsl:template> |
|---|
| 398 | |
|---|
| 399 | <xsl:template match="text()" mode="reflow"> |
|---|
| 400 | <xsl:call-template name="error"><xsl:with-param name="text">Illegal text in reflow-mode</xsl:with-param></xsl:call-template> |
|---|
| 401 | </xsl:template> |
|---|
| 402 | |
|---|
| 403 | <xsl:template match="text()" mode="preformatted"> |
|---|
| 404 | <xsl:call-template name="error"><xsl:with-param name="text">Illegal text in preformatted-mode</xsl:with-param></xsl:call-template> |
|---|
| 405 | </xsl:template> |
|---|
| 406 | |
|---|
| 407 | <xsl:template match="LINK" mode="count-ticket-links"> |
|---|
| 408 | <xsl:if test="@type='ticket'">1</xsl:if> |
|---|
| 409 | </xsl:template> |
|---|
| 410 | <xsl:template match="*" mode="count-ticket-links"> |
|---|
| 411 | <xsl:apply-templates mode="count-ticket-links"/> |
|---|
| 412 | </xsl:template> |
|---|
| 413 | <xsl:template match="text()" mode="count-ticket-links"> |
|---|
| 414 | </xsl:template> |
|---|
| 415 | |
|---|
| 416 | <xsl:template match="LINK" mode="expand-links"> |
|---|
| 417 | <xsl:choose> |
|---|
| 418 | <xsl:when test="@type='hlp' or @type='ps' or @type='pdf'"> |
|---|
| 419 | <xsl:call-template name="link-to-document"> |
|---|
| 420 | <xsl:with-param name="doc" select="@dest"/> |
|---|
| 421 | <xsl:with-param name="missing" select="@missing"/> |
|---|
| 422 | <xsl:with-param name="type" select="@type"/> |
|---|
| 423 | </xsl:call-template> |
|---|
| 424 | </xsl:when> |
|---|
| 425 | <xsl:when test="@type='www'"> |
|---|
| 426 | <xsl:call-template name="insert-link"> |
|---|
| 427 | <xsl:with-param name="linktext"><xsl:value-of select="@dest"/></xsl:with-param> |
|---|
| 428 | <xsl:with-param name="address"><xsl:value-of select="@dest"/></xsl:with-param> |
|---|
| 429 | </xsl:call-template> |
|---|
| 430 | </xsl:when> |
|---|
| 431 | <xsl:when test="@type='ticket'"> |
|---|
| 432 | <xsl:value-of select="@dest"/> <!-- simply insert ticketnumber--> |
|---|
| 433 | </xsl:when> |
|---|
| 434 | <xsl:when test="@type='email'"> |
|---|
| 435 | <xsl:call-template name="insert-email-link"> |
|---|
| 436 | <xsl:with-param name="linktext"><xsl:value-of select="@dest"/></xsl:with-param> |
|---|
| 437 | <xsl:with-param name="address"><xsl:value-of select="@dest"/></xsl:with-param> |
|---|
| 438 | <xsl:with-param name="subject" select="concat('Concerning helppage ',$myname)"/> |
|---|
| 439 | </xsl:call-template> |
|---|
| 440 | </xsl:when> |
|---|
| 441 | <xsl:otherwise> |
|---|
| 442 | <xsl:call-template name="error"><xsl:with-param name="text">Unknown link type '<xsl:value-of select="@type"/>'</xsl:with-param></xsl:call-template> |
|---|
| 443 | </xsl:otherwise> |
|---|
| 444 | </xsl:choose> |
|---|
| 445 | </xsl:template> |
|---|
| 446 | |
|---|
| 447 | <xsl:template match="text()" mode="expand-links"> |
|---|
| 448 | <xsl:value-of select="."/> |
|---|
| 449 | </xsl:template> |
|---|
| 450 | |
|---|
| 451 | <xsl:template match="*" mode="expand-links"> |
|---|
| 452 | <xsl:call-template name="error"><xsl:with-param name="text">Illegal content for expand-links</xsl:with-param></xsl:call-template> |
|---|
| 453 | </xsl:template> |
|---|
| 454 | |
|---|
| 455 | <xsl:template match="T"> |
|---|
| 456 | <xsl:variable name="indent"><xsl:apply-templates mode="calc-indent" select=".."/></xsl:variable> |
|---|
| 457 | <xsl:variable name="prefix"><xsl:apply-templates mode="calc-prefix" select=".."/></xsl:variable> |
|---|
| 458 | <xsl:variable name="text"><xsl:apply-templates mode="expand-links"/></xsl:variable> |
|---|
| 459 | |
|---|
| 460 | <xsl:choose> |
|---|
| 461 | <xsl:when test="@reflow='1'"> |
|---|
| 462 | <xsl:call-template name="reflow-paragraph"> |
|---|
| 463 | <xsl:with-param name="indent" select="$indent"/> |
|---|
| 464 | <xsl:with-param name="text" select="normalize-space($text)"/> |
|---|
| 465 | <xsl:with-param name="prefix" select="$prefix"/> |
|---|
| 466 | </xsl:call-template> |
|---|
| 467 | <xsl:text>&br;</xsl:text> |
|---|
| 468 | </xsl:when> |
|---|
| 469 | <xsl:otherwise> |
|---|
| 470 | <xsl:call-template name="indent-preformatted"> |
|---|
| 471 | <xsl:with-param name="indent" select="$indent"/> |
|---|
| 472 | <xsl:with-param name="text" select="$text"/> |
|---|
| 473 | <xsl:with-param name="prefix" select="$prefix"/> |
|---|
| 474 | <xsl:with-param name="preformatted-width"> |
|---|
| 475 | <xsl:choose> |
|---|
| 476 | <xsl:when test="@width"><xsl:value-of select="@width"/></xsl:when> |
|---|
| 477 | <xsl:otherwise><xsl:value-of select="$preformatted-default-width"/></xsl:otherwise> |
|---|
| 478 | </xsl:choose> |
|---|
| 479 | </xsl:with-param> |
|---|
| 480 | </xsl:call-template> |
|---|
| 481 | <xsl:text>&br;</xsl:text> |
|---|
| 482 | </xsl:otherwise> |
|---|
| 483 | </xsl:choose> |
|---|
| 484 | </xsl:template> |
|---|
| 485 | |
|---|
| 486 | <xsl:template match="ENTRY"><xsl:apply-templates/></xsl:template> |
|---|
| 487 | |
|---|
| 488 | <xsl:template match="P"><xsl:apply-templates/></xsl:template> |
|---|
| 489 | |
|---|
| 490 | <xsl:template match="ENUM"><xsl:apply-templates/></xsl:template> |
|---|
| 491 | <xsl:template match="LIST"><xsl:apply-templates/></xsl:template> |
|---|
| 492 | |
|---|
| 493 | <xsl:template match="SECTION" mode="main"> |
|---|
| 494 | <xsl:text>&br;&br;</xsl:text> |
|---|
| 495 | <xsl:value-of select="@name"/> |
|---|
| 496 | <xsl:text>&br;&br;</xsl:text> |
|---|
| 497 | <xsl:apply-templates/> |
|---|
| 498 | </xsl:template> |
|---|
| 499 | |
|---|
| 500 | <!-- ================================ --> |
|---|
| 501 | <!-- PAGE document wide layout --> |
|---|
| 502 | <!-- ================================ --> |
|---|
| 503 | |
|---|
| 504 | <!-- ============================== --> |
|---|
| 505 | <!-- insert document header --> |
|---|
| 506 | <!-- ============================== --> |
|---|
| 507 | <xsl:template name="header"> |
|---|
| 508 | <xsl:param name="title" select="'Untitled'"/> |
|---|
| 509 | <xsl:param name="for"/> |
|---|
| 510 | <xsl:text xml:space="preserve"># Generated from XML with xsltproc -- Stylesheet by Ralf Westram (ralf@arb-home.de)</xsl:text> |
|---|
| 511 | <xsl:choose> |
|---|
| 512 | <xsl:when test="$for='release'"> |
|---|
| 513 | <!-- this section and ... --> |
|---|
| 514 | <xsl:text xml:space="preserve"> |
|---|
| 515 | # **** You may edit this file, but the next ARB update will overwrite your changes **** |
|---|
| 516 | # **** When editing from inside ARB, your changes will be archived. Feel free to send these to us. **** |
|---|
| 517 | </xsl:text> |
|---|
| 518 | </xsl:when> |
|---|
| 519 | <xsl:when test="$for='devel'"> |
|---|
| 520 | <!-- ... this section HAVE TO generate the same amount of output-lines! --> |
|---|
| 521 | <!-- OTHERWISE unit tests will fail! --> |
|---|
| 522 | <xsl:text xml:space="preserve"> |
|---|
| 523 | # |
|---|
| 524 | # **** DO NOT EDIT (edit in $(ARBHOME)/HELP_SOURCE/source instead) **** |
|---|
| 525 | </xsl:text> |
|---|
| 526 | </xsl:when> |
|---|
| 527 | <xsl:otherwise> |
|---|
| 528 | <xsl:call-template name="error"><xsl:with-param name="text">Illegal content in edit_warning</xsl:with-param></xsl:call-template> |
|---|
| 529 | </xsl:otherwise> |
|---|
| 530 | </xsl:choose> |
|---|
| 531 | </xsl:template> |
|---|
| 532 | |
|---|
| 533 | <xsl:template match="PAGE"> |
|---|
| 534 | <xsl:variable name="title"> |
|---|
| 535 | <xsl:for-each select="TITLE"><xsl:value-of select="text()"/></xsl:for-each> |
|---|
| 536 | </xsl:variable> |
|---|
| 537 | <xsl:variable name="subtitle"> |
|---|
| 538 | <xsl:for-each select="SUBTITLE"><xsl:value-of select="text()"/></xsl:for-each> |
|---|
| 539 | </xsl:variable> |
|---|
| 540 | <xsl:variable name="bugsTracked"><xsl:apply-templates mode="count-ticket-links"/></xsl:variable> |
|---|
| 541 | <xsl:call-template name="header"> |
|---|
| 542 | <xsl:with-param name="title" select="$title"/> |
|---|
| 543 | <xsl:with-param name="for" select="@edit_warning"/> |
|---|
| 544 | </xsl:call-template># |
|---|
| 545 | # This page was converted by arb_help2xml and may look strange. |
|---|
| 546 | # If you think it's really bad, please send a |
|---|
| 547 | # <xsl:call-template name="insert-email-link"> |
|---|
| 548 | <xsl:with-param name="linktext">mail</xsl:with-param> |
|---|
| 549 | <xsl:with-param name="address">helpfeedback</xsl:with-param> |
|---|
| 550 | <xsl:with-param name="subject" select="concat('Helppage ',$myname,' looks weird')"/> |
|---|
| 551 | </xsl:call-template> |
|---|
| 552 | # to our help keeper. |
|---|
| 553 | |
|---|
| 554 | # UP references: |
|---|
| 555 | <xsl:apply-templates mode="uplinks"/> |
|---|
| 556 | # SUB references: |
|---|
| 557 | <xsl:apply-templates mode="sublinks"/> |
|---|
| 558 | <xsl:if test="string-length($bugsTracked) > 0"> |
|---|
| 559 | <!-- insert link to page describing arb-bugtracker --> |
|---|
| 560 | <xsl:call-template name="insert-topic"> |
|---|
| 561 | <xsl:with-param name="type" select="'SUB'"/> |
|---|
| 562 | <xsl:with-param name="dest" select="'bugtracker.hlp'"/> |
|---|
| 563 | </xsl:call-template> |
|---|
| 564 | </xsl:if> |
|---|
| 565 | # ------------------------------------------------------------ |
|---|
| 566 | # Start of real helpfile: |
|---|
| 567 | TITLE&tab;<xsl:value-of select="normalize-space($title)"/> |
|---|
| 568 | <xsl:if test="string-length($subtitle) > 0"> |
|---|
| 569 | <xsl:text>&br;</xsl:text> |
|---|
| 570 | <xsl:text>&br; </xsl:text><xsl:value-of select="normalize-space($subtitle)"/> |
|---|
| 571 | </xsl:if> |
|---|
| 572 | <xsl:apply-templates select="SECTION" mode="main"/> |
|---|
| 573 | </xsl:template> |
|---|
| 574 | |
|---|
| 575 | <!-- ============ --> |
|---|
| 576 | <!-- text() (should be last template) --> |
|---|
| 577 | <!-- ============ --> |
|---|
| 578 | <xsl:template match="text()|*"> |
|---|
| 579 | <xsl:choose> |
|---|
| 580 | <xsl:when test="string-length(name())>0"> |
|---|
| 581 | <xsl:call-template name="error"><xsl:with-param name="text">Unknown TAG <xsl:value-of select="name()"/></xsl:with-param></xsl:call-template> |
|---|
| 582 | </xsl:when> |
|---|
| 583 | <xsl:otherwise> |
|---|
| 584 | <!-- <xsl:value-of select="."/>--> |
|---|
| 585 | <!-- <xsl:call-template name="error"><xsl:with-param name="text">Unexpected text</xsl:with-param></xsl:call-template>--> |
|---|
| 586 | </xsl:otherwise> |
|---|
| 587 | </xsl:choose> |
|---|
| 588 | </xsl:template> |
|---|
| 589 | |
|---|
| 590 | |
|---|
| 591 | </xsl:transform> |
|---|
| 592 | |
|---|