1 <?xml version="1.0" encoding="utf-8"?>
2 <!DOCTYPE stylesheet SYSTEM "dactyl://content/dtd">
5 <xsl:stylesheet version="1.0"
6 xmlns="http://www.w3.org/1999/xhtml"
7 xmlns:html="http://www.w3.org/1999/xhtml"
8 xmlns:dactyl="http://vimperator.org/namespaces/liberator"
9 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
10 xmlns:exsl="http://exslt.org/common"
11 xmlns:regexp="http://exslt.org/regular-expressions"
12 xmlns:str="http://exslt.org/strings"
13 extension-element-prefixes="exsl regexp str">
15 <xsl:output method="xml" indent="no"/>
17 <!-- Variable Definitions {{{1 -->
20 <!-- Process Overlays {{{1 -->
22 <xsl:template name="splice-overlays">
23 <xsl:param name="elem"/>
24 <xsl:param name="tag"/>
25 <xsl:for-each select="ancestor::*/dactyl:overlay/*[@insertbefore=$tag]">
26 <xsl:apply-templates select="." mode="overlay"/>
29 <xsl:when test="ancestor::*/dactyl:overlay/*[@replace=$tag] and not($elem[@replace])">
30 <xsl:for-each select="ancestor::*/dactyl:overlay/*[@replace=$tag]">
31 <xsl:apply-templates select="." mode="overlay-2"/>
35 <xsl:for-each select="$elem">
36 <xsl:apply-templates select="." mode="overlay-2"/>
40 <xsl:for-each select="ancestor::*/dactyl:overlay/*[@insertafter=$tag]">
41 <xsl:apply-templates select="." mode="overlay"/>
45 <xsl:template match="dactyl:tags[parent::dactyl:document]|dactyl:tag" mode="overlay">
46 <xsl:call-template name="splice-overlays">
47 <xsl:with-param name="tag" select="substring-before(concat(., ' '), ' ')"/>
48 <xsl:with-param name="elem" select="self::node()"/>
51 <xsl:template match="*[dactyl:tags]" mode="overlay">
52 <xsl:call-template name="splice-overlays">
53 <xsl:with-param name="tag" select="substring-before(concat(dactyl:tags, ' '), ' ')"/>
54 <xsl:with-param name="elem" select="self::node()"/>
57 <xsl:template match="dactyl:*[@tag and not(@replace)]" mode="overlay">
58 <xsl:call-template name="splice-overlays">
59 <xsl:with-param name="tag" select="substring-before(concat(@tag, ' '), ' ')"/>
60 <xsl:with-param name="elem" select="self::node()"/>
64 <!-- Process Inclusions {{{1 -->
66 <xsl:template name="include">
67 <xsl:param name="root-node" select="."/>
68 <xsl:param name="overlay" select="concat('dactyl://help-overlay/', $root-node/@name)"/>
70 <!-- Ridiculous three-pass processing is needed to deal with
71 - lack of dynamic variable scope in XSL 1.0. -->
73 <!-- Store a copy of the overlay for the current document. -->
74 <xsl:variable name="doc">
76 <xsl:copy-of select="document($overlay)/dactyl:overlay"/>
77 <xsl:copy-of select="$root-node/node()"/>
81 <xsl:call-template name="parse-tags">
82 <xsl:with-param name="text" select="concat($root-node/@name, '.xml')"/>
84 <xsl:apply-templates select="exsl:node-set($doc)/dactyl:document/node()[position() != 1]" mode="overlay"/>
87 <xsl:template match="dactyl:include" mode="overlay-2">
88 <div dactyl:highlight="HelpInclude">
89 <xsl:call-template name="include">
90 <xsl:with-param name="root-node" select="document(@href)/dactyl:document"/>
95 <xsl:template match="@*|node()" mode="overlay">
96 <xsl:apply-templates select="." mode="overlay-2"/>
98 <xsl:template match="@*[starts-with(local-name(), 'on')]|*[local-name() = 'script']" mode="overlay-2"/>
99 <xsl:template match="@*|node()" mode="overlay-2">
101 <xsl:apply-templates select="@*|node()" mode="overlay"/>
107 <xsl:template match="/">
109 <!-- Ridiculous three-pass processing is needed to deal with
110 - lack of dynamic variable scope in XSL 1.0. -->
112 <xsl:variable name="doc1">
113 <xsl:call-template name="include">
114 <xsl:with-param name="root-node" select="dactyl:document"/>
117 <xsl:variable name="root" select="exsl:node-set($doc1)"/>
119 <!-- Store a cache of all tags defined -->
120 <xsl:variable name="doc2">
122 <xsl:attribute name="document-tags">
123 <xsl:text> </xsl:text>
124 <xsl:for-each select="$root//@tag|$root//dactyl:tags/text()|$root//dactyl:tag/text()">
125 <xsl:value-of select="concat(., ' ')"/>
128 <xsl:copy-of select="$root/node()"/>
131 <xsl:variable name="root2" select="exsl:node-set($doc2)/dactyl:document"/>
133 <html dactyl:highlight="Help">
135 <title><xsl:value-of select="/dactyl:document/@title"/></title>
136 <script type="text/javascript" src="resource://dactyl-content/help.js"/>
138 <body dactyl:highlight="HelpBody">
139 <xsl:apply-templates select="$root2/node()|$root2/@*" mode="help-1"/>
144 <!-- Table of Contents {{{1 -->
146 <xsl:template name="toc">
147 <xsl:param name="level" select="1"/>
148 <xsl:param name="context"/>
149 <xsl:param name="toc"/>
151 <xsl:variable name="tag" select="concat('h', $level)"/>
152 <xsl:variable name="lasttag" select="concat('h', $level - 1)"/>
154 <xsl:variable name="nodes" select="$toc/*[
155 local-name() = $tag and not(preceding::*[local-name() = $lasttag][position() = 1 and not(.=$context)])]"/>
157 <xsl:if test="$nodes">
158 <ol level="{$level}" dactyl:highlight="HelpOrderedList">
159 <xsl:for-each select="$nodes">
163 <xsl:attribute name="href"><xsl:value-of select="concat('#', substring-before(concat(@tag, ' '), ' '))"/></xsl:attribute>
165 <xsl:apply-templates select="node()[not(self::dactyl:strut)]" mode="help-1"/>
167 <xsl:call-template name="toc">
168 <xsl:with-param name="level" select="$level + 1"/>
169 <xsl:with-param name="context" select="."/>
170 <xsl:with-param name="toc" select="$toc"/>
177 <xsl:template match="dactyl:toc" mode="help-2">
178 <xsl:variable name="TOC">
181 select="following::dactyl:h1|following::dactyl:h2|following::dactyl:h3|following::dactyl:h4|following::dactyl:h5">
182 <xsl:copy-of select="."/>
185 <xsl:variable name="toc" select="exsl:node-set($TOC)"/>
187 <xsl:if test="//dactyl:toc[1 and self::*]">
188 <div dactyl:highlight="HelpTOC">
189 <h2><!--L-->Contents</h2>
190 <xsl:if test="@start">
191 <xsl:call-template name="toc">
192 <xsl:with-param name="level" select="number(@start)"/>
193 <xsl:with-param name="toc" select="$toc"/>
196 <xsl:if test="not(@start)">
197 <xsl:call-template name="toc">
198 <xsl:with-param name="toc" select="$toc"/>
207 <xsl:template match="dactyl:strut" mode="help-2">
208 <div style="clear: both"/>
210 <xsl:template match="dactyl:item" mode="help-2">
211 <div dactyl:highlight="HelpItem">
212 <xsl:apply-templates select="dactyl:tags|dactyl:spec|dactyl:strut" mode="help-1"/>
213 <xsl:if test="not(dactyl:description/@short)">
214 <hr style="border: 0; height: 0; margin: 0; width: 100%; float: right;"/>
215 <xsl:if test="dactyl:type|dactyl:default">
216 <div dactyl:highlight="HelpOptInfo">
217 <xsl:apply-templates select="dactyl:type|dactyl:default" mode="help-1"/>
218 <div style="clear: both;"/>
222 <xsl:apply-templates select="dactyl:description" mode="help-1"/>
223 <div style="clear: both;"/>
227 <xsl:template match="dactyl:item/dactyl:spec[position() = last()]" mode="help-2">
228 <div style="clear: both;"/>
229 <div dactyl:highlight="HelpSpec"><xsl:apply-templates mode="help-1"/></div>
233 <xsl:template match="dactyl:default[not(@type='plain')]" mode="help-2">
234 <xsl:variable name="type" select="preceding-sibling::dactyl:type[1] | following-sibling::dactyl:type[1]"/>
235 <span dactyl:highlight="HelpDefault">
236 <xsl:copy-of select="@*[not(starts-with(local-name(), 'on'))]"/>
237 <xsl:text>(default: </xsl:text>
239 <xsl:when test="$type = 'string'">
240 <span dactyl:highlight="HelpString" delim="'"><xsl:apply-templates mode="help-1"/></span>
242 <xsl:when test="contains($type, 'list') or contains($type, 'map')">
243 <span dactyl:highlight="HelpString" delim=""><xsl:apply-templates mode="help-1"/></span>
244 <xsl:if test=". = ''"><!--L-->(empty)</xsl:if>
248 <xsl:attribute name="dactyl:highlight">
250 <xsl:when test="$type = 'boolean'">Boolean</xsl:when>
251 <xsl:when test="$type = 'number'">Number</xsl:when>
252 <xsl:when test="$type = 'charlist'">String</xsl:when>
255 <xsl:apply-templates select="node()" mode="help-1"/>
258 </xsl:choose>)</span>
261 <!-- Tag Definitions {{{1 -->
263 <xsl:template match="dactyl:item/dactyl:tags[position() = last()]" mode="help-2">
264 <div style="clear: right"/>
265 <xsl:call-template name="parse-tags">
266 <xsl:with-param name="text" select="."/>
269 <xsl:template match="dactyl:tags" mode="help-2">
270 <xsl:call-template name="parse-tags">
271 <xsl:with-param name="text" select="."/>
274 <xsl:template match="@tag[parent::dactyl:p]" mode="help-2">
275 <xsl:call-template name="parse-tags">
276 <xsl:with-param name="text" select="."/>
278 <div style="clear: right"/>
280 <xsl:template match="dactyl:tag|@tag" mode="help-2">
281 <xsl:call-template name="parse-tags">
282 <xsl:with-param name="text" select="."/>
285 <xsl:template name="parse-tags">
286 <xsl:param name="text"/>
287 <div dactyl:highlight="HelpTags">
288 <xsl:for-each select="str:tokenize($text)">
289 <a id="{.}" dactyl:highlight="HelpTag"><xsl:value-of select="."/></a>
294 <!-- Tag Links {{{1 -->
296 <xsl:template name="linkify-tag">
297 <xsl:param name="contents" select="text()"/>
298 <xsl:variable name="tag" select="$contents"/>
299 <xsl:variable name="tag-url" select="
300 regexp:replace(regexp:replace($tag, '%', 'g', '%25'),
303 <a style="color: inherit;">
304 <xsl:if test="not(@link) or @link != 'false'">
306 <xsl:when test="@link and @link != 'false'">
307 <xsl:attribute name="href">dactyl://help-tag/<xsl:value-of select="@link"/></xsl:attribute>
309 <xsl:when test="contains(ancestor::*/@document-tags, concat(' ', $tag, ' '))">
310 <xsl:attribute name="href">#<xsl:value-of select="$tag-url"/></xsl:attribute>
313 <xsl:attribute name="href">dactyl://help-tag/<xsl:value-of select="$tag-url"/></xsl:attribute>
317 <xsl:value-of select="$contents"/>
321 <xsl:template match="dactyl:o" mode="help-2">
322 <span dactyl:highlight="HelpOpt">
323 <xsl:call-template name="linkify-tag">
324 <xsl:with-param name="contents" select='concat("'", text(), "'")'/>
328 <xsl:template match="dactyl:pref" mode="help-2">
329 <a href="http://kb.mozillazine.org/{text()}" dactyl:highlight="HelpOpt"
330 >'<xsl:apply-templates select="@*|node()" mode="help-1"/>'</a>
332 <xsl:template match="dactyl:t" mode="help-2">
333 <span dactyl:highlight="HelpTopic">
334 <xsl:call-template name="linkify-tag"/>
337 <xsl:template match="dactyl:k" mode="help-2">
338 <span dactyl:highlight="HelpKey">
339 <xsl:call-template name="linkify-tag"/>
342 <xsl:template match="dactyl:kwd" mode="help-2">
343 <span dactyl:highlight="HelpKeyword">
344 <xsl:apply-templates select="@*|node()" mode="help-1"/>
347 <xsl:template match="dactyl:k[@name]" mode="help-2">
348 <span dactyl:highlight="HelpKey">
349 <xsl:call-template name="linkify-tag">
350 <xsl:with-param name="contents" select="concat('<', @name, '>', .)"/>
354 <xsl:template match="dactyl:k[@mode]" mode="help-2">
355 <span dactyl:highlight="HelpKey">
356 <xsl:call-template name="linkify-tag">
357 <xsl:with-param name="contents" select="concat(@mode, '_', text())"/>
361 <xsl:template match="dactyl:k[@mode and @name]" mode="help-2">
362 <span dactyl:highlight="HelpKey">
363 <xsl:call-template name="linkify-tag">
364 <xsl:with-param name="contents" select="concat(@mode, '_', '<', @name, '>', .)"/>
369 <!-- HTML-ish elements {{{1 -->
371 <xsl:template match="dactyl:dl" mode="help-2">
372 <xsl:apply-templates select="@tag" mode="help-1"/>
374 <column style="{@dt}"/>
375 <column style="{@dd}"/>
376 <xsl:for-each select="dactyl:dt">
378 <xsl:apply-templates select="." mode="help-1"/>
379 <xsl:apply-templates select="following-sibling::dactyl:dd[1]" mode="help-1"/>
385 <xsl:template match="dactyl:link" mode="help-2">
388 <xsl:when test="not(@topic)"/>
389 <xsl:when test="regexp:match(@topic, '^([a-zA-Z]+:|[^/]*#|/)', '')">
390 <xsl:attribute name="href"><xsl:value-of select="@topic"/></xsl:attribute>
393 <xsl:attribute name="href"><xsl:value-of select="concat('dactyl://help-tag/', @topic)"/></xsl:attribute>
396 <xsl:if test="regexp:match(@topic, '^[a-zA-Z]+:', '')
397 and not(starts-with(@topic, 'mailto:') or
398 starts-with(@topic, 'chrome:') or
399 starts-with(@topic, 'resource:') or
400 starts-with(@topic, 'dactyl:'))">
401 <!-- A regexp does not work for the second test here ↑. :( -->
402 <xsl:attribute name="rel">external</xsl:attribute>
404 <xsl:apply-templates select="@*|node()" mode="help-1"/>
408 <xsl:template match="dactyl:hl" mode="help-2">
409 <span dactyl:highlight="{@key}"><xsl:apply-templates select="@*|node()" mode="help-1"/></span>
411 <xsl:template match="dactyl:h" mode="help-2">
412 <em><xsl:apply-templates select="@*|node()" mode="help-1"/></em>
414 <xsl:template match="dactyl:em | dactyl:tt | dactyl:p |
415 dactyl:dt | dactyl:dd |
416 dactyl:ol | dactyl:ul | dactyl:li |
417 dactyl:h1 | dactyl:h2 | dactyl:h3 |
420 <xsl:element name="{local-name()}">
421 <xsl:apply-templates select="@*|node()" mode="help-1"/>
425 <xsl:template match="dactyl:code" mode="help-2">
426 <pre dactyl:highlight="HelpCode"><xsl:apply-templates select="@*|node()" mode="help-1"/></pre>
429 <!-- Help elements {{{1 -->
431 <xsl:template match="dactyl:a" mode="help-2">
432 <span dactyl:highlight="HelpArg">{<xsl:apply-templates select="@*|node()" mode="help-1"/>}</span>
434 <xsl:template match="dactyl:oa" mode="help-2">
435 <span dactyl:highlight="HelpOptionalArg">[<xsl:apply-templates select="@*|node()" mode="help-1"/>]</span>
438 <xsl:template match="dactyl:deprecated" mode="help-2">
439 <p style="clear: both;">
440 <xsl:apply-templates select="@*" mode="help-1"/>
441 <span dactyl:highlight="HelpWarning"><!--L-->Deprecated:</span>
442 <xsl:text> </xsl:text>
443 <xsl:apply-templates select="node()" mode="help-1"/>
446 <xsl:template match="dactyl:note" mode="help-2">
447 <p style="clear: both;">
448 <xsl:apply-templates select="@*" mode="help-1"/>
449 <div style="clear: both;"/>
450 <span dactyl:highlight="HelpNote"><!--L-->Note:</span>
451 <xsl:text> </xsl:text>
452 <xsl:apply-templates select="node()" mode="help-1"/>
455 <xsl:template match="dactyl:warning" mode="help-2">
456 <p style="clear: both;">
457 <xsl:apply-templates select="@*" mode="help-1"/>
458 <div style="clear: both;"/>
459 <span dactyl:highlight="HelpWarning"><!--L-->Warning:</span>
460 <xsl:text> </xsl:text>
461 <xsl:apply-templates select="node()" mode="help-1"/>
464 <xsl:template match="dactyl:default" mode="help-2">
465 <span dactyl:highlight="HelpDefault">(default:<xsl:text> </xsl:text><xsl:apply-templates select="@*|node()" mode="help-1"/>)</span>
468 <!-- HTML-ify other elements {{{1 -->
470 <xsl:template match="dactyl:ex" mode="help-2">
471 <span dactyl:highlight="HelpEx">
472 <xsl:variable name="tag" select="str:tokenize(text(), ' [!')[1]"/>
473 <a href="dactyl://help-tag/{$tag}" style="color: inherit;">
474 <xsl:if test="contains(ancestor::*/@document-tags, concat(' ', $tag, ' '))">
475 <xsl:attribute name="href">#<xsl:value-of select="$tag"/></xsl:attribute>
477 <xsl:apply-templates mode="help-1"/>
482 <xsl:template match="dactyl:se" mode="help-2">
483 <xsl:variable name="nodes" xmlns="&xmlns.dactyl;">
484 <html:span style="display: inline-block;">
486 <xsl:text> </xsl:text>
488 <xsl:if test="@link != 'false'">
489 <xsl:attribute name="topic">'<xsl:value-of select="@opt"/>'</xsl:attribute>
491 <hl key="HelpOpt"><xsl:value-of select="@opt"/></hl>
494 <xsl:when test="@op and @op != ''"><xsl:value-of select="@op"/></xsl:when>
495 <xsl:otherwise>=</xsl:otherwise>
497 <xsl:copy-of select="@*[not(starts-with(local-name(), 'on'))]|node()[local-name() != 'script']"/>
500 <xsl:apply-templates select="exsl:node-set($nodes)" mode="help-1"/>
503 <xsl:template match="dactyl:set" mode="help-2">
504 <xsl:variable name="nodes">
505 <code xmlns="&xmlns.dactyl;">
506 <se opt="{@opt}" op="{@op}" link="{@link}">
507 <xsl:copy-of select="@*[not(starts-with(local-name(), 'on'))]|node()[local-name() != 'script']"/>
511 <xsl:apply-templates select="exsl:node-set($nodes)" mode="help-1"/>
514 <xsl:template match="dactyl:description | dactyl:example | dactyl:spec" mode="help-2">
516 <xsl:if test="self::dactyl:description"><xsl:attribute name="dactyl:highlight">HelpDescription</xsl:attribute></xsl:if>
517 <xsl:if test="self::dactyl:example"><xsl:attribute name="dactyl:highlight">HelpExample</xsl:attribute></xsl:if>
518 <xsl:if test="self::dactyl:spec"><xsl:attribute name="dactyl:highlight">HelpSpec</xsl:attribute></xsl:if>
519 <xsl:apply-templates select="@*|node()" mode="help-1"/>
522 <xsl:template match="dactyl:type" mode="help-2">
523 <a dactyl:highlight="HelpType">
525 <xsl:when test="contains(ancestor::*/@document-tags, concat(' ', ., ' '))">
526 <xsl:attribute name="href">#<xsl:value-of select="."/></xsl:attribute>
528 <xsl:when test="not(. = 'boolean' or . = 'number' or . = 'string')">
529 <xsl:attribute name="href">dactyl://help-tag/<xsl:value-of select="."/></xsl:attribute>
532 <xsl:apply-templates select="@*|node()" mode="help-1"/>
535 <xsl:template match="dactyl:str" mode="help-2">
536 <span dactyl:highlight="HelpString">
537 <xsl:apply-templates select="@*|node()" mode="help-1"/>
540 <xsl:template match="dactyl:xml-block" mode="help-2">
541 <div dactyl:highlight="HelpXMLBlock">
542 <xsl:apply-templates mode="xml-highlight"/>
545 <xsl:template match="dactyl:xml-highlight" mode="help-2">
546 <div dactyl:highlight="HelpXMLBlock">
547 <xsl:apply-templates mode="xml-highlight"/>
552 <!-- Plugins {{{1 -->
554 <xsl:template name="info">
555 <xsl:param name="label"/>
556 <xsl:param name="link" select="@href"/>
557 <xsl:param name="nodes" select="node()"/>
558 <xsl:param name="extra"/>
559 <div dactyl:highlight="HelpInfo">
560 <div dactyl:highlight="HelpInfoLabel">
561 <xsl:value-of select="$label"/>:
563 <span dactyl:highlight="HelpInfoValue">
565 <xsl:if test="$link">
566 <xsl:attribute name="href"><xsl:value-of select="$link"/></xsl:attribute>
568 <xsl:copy-of select="exsl:node-set($nodes)"/>
570 <xsl:copy-of select="exsl:node-set($extra)"/>
574 <xsl:template match="dactyl:author[@email]" mode="help-2">
575 <xsl:call-template name="info">
576 <xsl:with-param name="label" select="'Author'"/>
577 <xsl:with-param name="extra">
578 <xsl:text> </xsl:text><a href="mailto:{@email}"></a>
582 <xsl:template match="dactyl:author" mode="help-2">
583 <xsl:call-template name="info">
584 <xsl:with-param name="label" select="'Author'"/>
587 <xsl:template match="dactyl:license" mode="help-2">
588 <xsl:call-template name="info">
589 <xsl:with-param name="label" select="'License'"/>
592 <xsl:template match="dactyl:plugin" mode="help-2">
593 <xsl:call-template name="info">
594 <xsl:with-param name="label" select="'Plugin'"/>
595 <xsl:with-param name="nodes">
596 <span><xsl:value-of select="@name"/></span>
599 <xsl:if test="@version">
600 <xsl:call-template name="info">
601 <xsl:with-param name="label" select="'Version'"/>
602 <xsl:with-param name="link" select="''"/>
603 <xsl:with-param name="nodes">
604 <span><xsl:value-of select="@version"/></span>
608 <xsl:apply-templates mode="help-1"/>
611 <!-- Special Element Templates {{{1 -->
613 <xsl:template match="dactyl:logo" mode="help-1">
614 <span dactyl:highlight="Logo"/>
617 <!-- Process Tree {{{1 -->
619 <xsl:template match="@*[starts-with(local-name(), 'on')]|*[local-name() = 'script']" mode="help-2"/>
620 <xsl:template match="@*|node()" mode="help-2">
622 <xsl:apply-templates select="@*|node()" mode="help-1"/>
625 <xsl:template match="@*|node()" mode="help-1">
626 <xsl:apply-templates select="." mode="help-2"/>
629 <!-- XML Highlighting (xsl:import doesn't work in Firefox 3.x) {{{1 -->
630 <xsl:template name="xml-namespace">
631 <xsl:param name="node" select="."/>
632 <xsl:if test="name($node) != local-name($node)">
633 <span dactyl:highlight="HelpXMLNamespace">
634 <xsl:value-of select="substring-before(name($node), ':')"/>
637 <xsl:value-of select="local-name($node)"/>
640 <xsl:template match="*" mode="xml-highlight">
641 <span dactyl:highlight="HelpXMLTagStart">
642 <xsl:text><</xsl:text>
643 <xsl:call-template name="xml-namespace"/>
644 <xsl:apply-templates select="@*" mode="xml-highlight"/>
645 <xsl:text>/></xsl:text>
649 <xsl:template match="*[node()]" mode="xml-highlight">
650 <span dactyl:highlight="HelpXMLTagStart">
651 <xsl:text><</xsl:text>
652 <xsl:call-template name="xml-namespace"/>
653 <xsl:apply-templates select="@*" mode="xml-highlight"/>
654 <xsl:text>></xsl:text>
656 <xsl:apply-templates select="node()" mode="xml-highlight"/>
657 <span dactyl:highlight="HelpXMLTagEnd">
658 <xsl:text></</xsl:text>
659 <xsl:call-template name="xml-namespace"/>
660 <xsl:text>></xsl:text>
664 <xsl:template match="dactyl:escape | dactyl:escape[node()]" mode="xml-highlight">
665 <span dactyl:highlight="HelpXMLText">
666 <xsl:apply-templates mode="help-1"/>
670 <xsl:template match="@*" mode="xml-highlight">
671 <xsl:text> </xsl:text>
672 <span dactyl:highlight="HelpXMLAttribute">
673 <xsl:call-template name="xml-namespace"/>
675 <span dactyl:highlight="HelpXMLString">
676 <xsl:value-of select="regexp:replace(., '"', 'g', '&quot;')"/>
680 <xsl:template match="comment()" mode="xml-highlight">
681 <span dactyl:highlight="HelpXMLComment">
682 <xsl:value-of select="."/>
686 <xsl:template match="processing-instruction()" mode="xml-highlight">
687 <span dactyl:highlight="HelpXMLProcessing">
688 <xsl:value-of select="."/>
692 <xsl:template match="text()" mode="xml-highlight">
693 <span dactyl:highlight="HelpXMLText">
694 <xsl:value-of select="regexp:replace(., '<', 'g', '&lt;')"/>
699 <!-- vim:se ft=xslt sts=4 sw=4 et fdm=marker: -->