mml 2.3.0 → 2.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitmodules +9 -0
- data/.rubocop.yml +4 -0
- data/.rubocop_todo.yml +83 -18
- data/Gemfile +0 -2
- data/README.adoc +176 -47
- data/Rakefile +16 -1
- data/lib/mml/base/common_attributes.rb +44 -0
- data/lib/mml/base/content/annotation.rb +28 -0
- data/lib/mml/base/content/annotation_xml.rb +31 -0
- data/lib/mml/base/content/apply.rb +27 -0
- data/lib/mml/base/content/arith.rb +243 -0
- data/lib/mml/base/content/bind.rb +27 -0
- data/lib/mml/base/content/bvar.rb +20 -0
- data/lib/mml/base/content/calculus.rb +103 -0
- data/lib/mml/base/content/cbytes.rb +24 -0
- data/lib/mml/base/content/cerror.rb +24 -0
- data/lib/mml/base/content/ci.rb +77 -0
- data/lib/mml/base/content/cn.rb +33 -0
- data/lib/mml/base/content/condition.rb +20 -0
- data/lib/mml/base/content/constants.rb +173 -0
- data/lib/mml/base/content/cs.rb +22 -0
- data/lib/mml/base/content/csymbol.rb +79 -0
- data/lib/mml/base/content/declare.rb +34 -0
- data/lib/mml/base/content/degree.rb +20 -0
- data/lib/mml/base/content/elementary_functions.rb +309 -0
- data/lib/mml/base/content/fn.rb +25 -0
- data/lib/mml/base/content/functions.rb +85 -0
- data/lib/mml/base/content/interval.rb +24 -0
- data/lib/mml/base/content/inverse.rb +25 -0
- data/lib/mml/base/content/lambda.rb +20 -0
- data/lib/mml/base/content/linear_algebra.rb +122 -0
- data/lib/mml/base/content/logic.rb +93 -0
- data/lib/mml/base/content/otherwise.rb +20 -0
- data/lib/mml/base/content/piece.rb +20 -0
- data/lib/mml/base/content/piecewise.rb +20 -0
- data/lib/mml/base/content/relations.rb +113 -0
- data/lib/mml/base/content/reln.rb +19 -0
- data/lib/mml/base/content/semantics.rb +27 -0
- data/lib/mml/base/content/sep.rb +19 -0
- data/lib/mml/base/content/sets.rb +163 -0
- data/lib/mml/base/content/share.rb +22 -0
- data/lib/mml/base/content/statistics.rb +95 -0
- data/lib/mml/base/content/vector_calculus.rb +63 -0
- data/lib/mml/base/content_loader.rb +195 -0
- data/lib/mml/base/maction.rb +1 -0
- data/lib/mml/base/math.rb +47 -0
- data/lib/mml/base/menclose.rb +1 -1
- data/lib/mml/base/mfenced.rb +2 -2
- data/lib/mml/base/mglyph.rb +2 -2
- data/lib/mml/base/mi.rb +9 -6
- data/lib/mml/base/mlabeledtr.rb +2 -6
- data/lib/mml/base/mn.rb +3 -2
- data/lib/mml/base/mo.rb +3 -3
- data/lib/mml/base/mrow.rb +0 -2
- data/lib/mml/base/ms.rb +4 -6
- data/lib/mml/base/mscarries.rb +1 -1
- data/lib/mml/base/mspace.rb +0 -2
- data/lib/mml/base/mstyle.rb +4 -8
- data/lib/mml/base/mtable.rb +8 -0
- data/lib/mml/base/mtd.rb +6 -0
- data/lib/mml/base/mtext.rb +0 -2
- data/lib/mml/base/semantics.rb +4 -2
- data/lib/mml/base/universal_presentation_attributes.rb +46 -0
- data/lib/mml/base/v3_common.rb +16 -0
- data/lib/mml/base/v3_presentation_attributes.rb +15 -0
- data/lib/mml/base/v4_attributes.rb +4 -18
- data/lib/mml/base.rb +11 -0
- data/lib/mml/common_elements.rb +336 -0
- data/lib/mml/context_configuration.rb +29 -0
- data/lib/mml/v2/annotation.rb +9 -0
- data/lib/mml/v2/annotation_xml.rb +9 -0
- data/lib/mml/v2/apply.rb +9 -0
- data/lib/mml/v2/arith.rb +93 -0
- data/lib/mml/v2/bind.rb +9 -0
- data/lib/mml/v2/bvar.rb +9 -0
- data/lib/mml/v2/calculus.rb +33 -0
- data/lib/mml/v2/ci.rb +9 -0
- data/lib/mml/v2/cn.rb +9 -0
- data/lib/mml/v2/common_elements.rb +34 -0
- data/lib/mml/v2/condition.rb +9 -0
- data/lib/mml/v2/configuration.rb +13 -0
- data/lib/mml/v2/constants.rb +65 -0
- data/lib/mml/v2/csymbol.rb +9 -0
- data/lib/mml/v2/degree.rb +9 -0
- data/lib/mml/v2/elementary_functions.rb +121 -0
- data/lib/mml/v2/fn.rb +9 -0
- data/lib/mml/v2/functions.rb +29 -0
- data/lib/mml/v2/interval.rb +9 -0
- data/lib/mml/v2/inverse.rb +9 -0
- data/lib/mml/v2/lambda.rb +9 -0
- data/lib/mml/v2/linear_algebra.rb +41 -0
- data/lib/mml/v2/logic.rb +33 -0
- data/lib/mml/v2/maction.rb +9 -0
- data/lib/mml/v2/maligngroup.rb +9 -0
- data/lib/mml/v2/malignmark.rb +9 -0
- data/lib/mml/v2/math.rb +11 -0
- data/lib/mml/v2/menclose.rb +9 -0
- data/lib/mml/v2/merror.rb +9 -0
- data/lib/mml/v2/mfenced.rb +9 -0
- data/lib/mml/v2/mfrac.rb +9 -0
- data/lib/mml/v2/mfraction.rb +9 -0
- data/lib/mml/v2/mglyph.rb +9 -0
- data/lib/mml/v2/mi.rb +9 -0
- data/lib/mml/v2/mlabeledtr.rb +9 -0
- data/lib/mml/v2/mlongdiv.rb +9 -0
- data/lib/mml/v2/mmultiscripts.rb +9 -0
- data/lib/mml/v2/mn.rb +9 -0
- data/lib/mml/v2/mo.rb +10 -0
- data/lib/mml/v2/mover.rb +9 -0
- data/lib/mml/v2/mpadded.rb +9 -0
- data/lib/mml/v2/mphantom.rb +9 -0
- data/lib/mml/v2/mprescripts.rb +9 -0
- data/lib/mml/v2/mroot.rb +9 -0
- data/lib/mml/v2/mrow.rb +9 -0
- data/lib/mml/v2/ms.rb +9 -0
- data/lib/mml/v2/mscarries.rb +9 -0
- data/lib/mml/v2/mscarry.rb +9 -0
- data/lib/mml/v2/msgroup.rb +9 -0
- data/lib/mml/v2/msline.rb +9 -0
- data/lib/mml/v2/mspace.rb +9 -0
- data/lib/mml/v2/msqrt.rb +9 -0
- data/lib/mml/v2/msrow.rb +9 -0
- data/lib/mml/v2/mstack.rb +9 -0
- data/lib/mml/v2/mstyle.rb +10 -0
- data/lib/mml/v2/msub.rb +9 -0
- data/lib/mml/v2/msubsup.rb +9 -0
- data/lib/mml/v2/msup.rb +9 -0
- data/lib/mml/v2/mtable.rb +9 -0
- data/lib/mml/v2/mtd.rb +9 -0
- data/lib/mml/v2/mtext.rb +9 -0
- data/lib/mml/v2/mtr.rb +9 -0
- data/lib/mml/v2/munder.rb +9 -0
- data/lib/mml/v2/munderover.rb +9 -0
- data/lib/mml/v2/namespace.rb +7 -0
- data/lib/mml/v2/none.rb +9 -0
- data/lib/mml/v2/otherwise.rb +9 -0
- data/lib/mml/v2/piece.rb +9 -0
- data/lib/mml/v2/piecewise.rb +9 -0
- data/lib/mml/v2/relations.rb +41 -0
- data/lib/mml/v2/reln.rb +13 -0
- data/lib/mml/v2/semantics.rb +9 -0
- data/lib/mml/v2/sep.rb +9 -0
- data/lib/mml/v2/sets.rb +57 -0
- data/lib/mml/v2/statistics.rb +33 -0
- data/lib/mml/v2/vector_calculus.rb +21 -0
- data/lib/mml/v2.rb +311 -0
- data/lib/mml/v3/annotation.rb +10 -0
- data/lib/mml/v3/annotation_xml.rb +10 -0
- data/lib/mml/v3/apply.rb +10 -0
- data/lib/mml/v3/arith.rb +115 -0
- data/lib/mml/v3/bind.rb +10 -0
- data/lib/mml/v3/calculus.rb +40 -0
- data/lib/mml/v3/cbytes.rb +10 -0
- data/lib/mml/v3/cerror.rb +10 -0
- data/lib/mml/v3/ci.rb +10 -0
- data/lib/mml/v3/cn.rb +10 -0
- data/lib/mml/v3/common_elements.rb +34 -0
- data/lib/mml/v3/constants.rb +80 -0
- data/lib/mml/v3/constructs.rb +55 -0
- data/lib/mml/v3/cs.rb +10 -0
- data/lib/mml/v3/csymbol.rb +10 -0
- data/lib/mml/v3/deprecated_content.rb +29 -0
- data/lib/mml/v3/elementary_functions.rb +145 -0
- data/lib/mml/v3/functions.rb +35 -0
- data/lib/mml/v3/linear_algebra.rb +50 -0
- data/lib/mml/v3/logic.rb +40 -0
- data/lib/mml/v3/maction.rb +1 -1
- data/lib/mml/v3/math.rb +7 -1
- data/lib/mml/v3/mi.rb +1 -0
- data/lib/mml/v3/mn.rb +1 -0
- data/lib/mml/v3/mo.rb +1 -0
- data/lib/mml/v3/mrow.rb +1 -0
- data/lib/mml/v3/ms.rb +1 -0
- data/lib/mml/v3/mstyle.rb +1 -0
- data/lib/mml/v3/mtext.rb +1 -0
- data/lib/mml/v3/relations.rb +50 -0
- data/lib/mml/v3/sets.rb +70 -0
- data/lib/mml/v3/statistics.rb +40 -0
- data/lib/mml/v3/vector_calculus.rb +25 -0
- data/lib/mml/v3.rb +25 -0
- data/lib/mml/v4/a.rb +4 -3
- data/lib/mml/v4/annotation.rb +10 -0
- data/lib/mml/v4/annotation_xml.rb +14 -0
- data/lib/mml/v4/apply.rb +9 -0
- data/lib/mml/v4/arith.rb +93 -0
- data/lib/mml/v4/calculus.rb +25 -0
- data/lib/mml/v4/cbytes.rb +9 -0
- data/lib/mml/v4/cerror.rb +9 -0
- data/lib/mml/v4/ci.rb +9 -0
- data/lib/mml/v4/cn.rb +9 -0
- data/lib/mml/v4/common_elements.rb +33 -0
- data/lib/mml/v4/constants.rb +65 -0
- data/lib/mml/v4/constructs.rb +49 -0
- data/lib/mml/v4/cs.rb +9 -0
- data/lib/mml/v4/csymbol.rb +9 -0
- data/lib/mml/v4/deprecated_content.rb +25 -0
- data/lib/mml/v4/elementary_functions.rb +118 -0
- data/lib/mml/v4/factorof.rb +9 -0
- data/lib/mml/v4/functions.rb +30 -0
- data/lib/mml/v4/limit.rb +9 -0
- data/lib/mml/v4/linear_algebra.rb +41 -0
- data/lib/mml/v4/logic.rb +33 -0
- data/lib/mml/v4/maction.rb +1 -2
- data/lib/mml/v4/maligngroup.rb +0 -1
- data/lib/mml/v4/malignmark.rb +0 -1
- data/lib/mml/v4/math.rb +1 -1
- data/lib/mml/v4/menclose.rb +0 -1
- data/lib/mml/v4/merror.rb +0 -1
- data/lib/mml/v4/mfenced.rb +0 -1
- data/lib/mml/v4/mfrac.rb +0 -1
- data/lib/mml/v4/mfraction.rb +0 -1
- data/lib/mml/v4/mglyph.rb +0 -1
- data/lib/mml/v4/mi.rb +1 -1
- data/lib/mml/v4/mlabeledtr.rb +0 -1
- data/lib/mml/v4/mlongdiv.rb +0 -1
- data/lib/mml/v4/mmultiscripts.rb +0 -1
- data/lib/mml/v4/mn.rb +1 -1
- data/lib/mml/v4/mo.rb +1 -1
- data/lib/mml/v4/mover.rb +0 -1
- data/lib/mml/v4/mpadded.rb +0 -1
- data/lib/mml/v4/mphantom.rb +0 -1
- data/lib/mml/v4/mprescripts.rb +0 -1
- data/lib/mml/v4/mroot.rb +0 -1
- data/lib/mml/v4/mrow.rb +1 -1
- data/lib/mml/v4/ms.rb +1 -1
- data/lib/mml/v4/mscarries.rb +0 -1
- data/lib/mml/v4/mscarry.rb +0 -1
- data/lib/mml/v4/msgroup.rb +0 -1
- data/lib/mml/v4/msline.rb +0 -1
- data/lib/mml/v4/mspace.rb +0 -1
- data/lib/mml/v4/msqrt.rb +0 -1
- data/lib/mml/v4/msrow.rb +0 -1
- data/lib/mml/v4/mstack.rb +0 -1
- data/lib/mml/v4/mstyle.rb +1 -1
- data/lib/mml/v4/msub.rb +0 -1
- data/lib/mml/v4/msubsup.rb +0 -1
- data/lib/mml/v4/msup.rb +0 -1
- data/lib/mml/v4/mtable.rb +0 -1
- data/lib/mml/v4/mtd.rb +0 -1
- data/lib/mml/v4/mtext.rb +1 -1
- data/lib/mml/v4/mtr.rb +0 -1
- data/lib/mml/v4/munder.rb +0 -1
- data/lib/mml/v4/munderover.rb +0 -1
- data/lib/mml/v4/none.rb +0 -1
- data/lib/mml/v4/relations.rb +37 -0
- data/lib/mml/v4/semantics.rb +0 -1
- data/lib/mml/v4/sets.rb +57 -0
- data/lib/mml/v4/statistics.rb +33 -0
- data/lib/mml/v4/tendsto.rb +9 -0
- data/lib/mml/v4/vector_calculus.rb +21 -0
- data/lib/mml/v4.rb +421 -44
- data/lib/mml/version.rb +1 -1
- data/lib/mml/versioned_parser.rb +1 -1
- data/lib/mml.rb +3 -1
- data/reference-docs/mathml-source/pubtext/mathmlspec.dtd +150 -0
- data/reference-docs/mathml-source/pubtext/xmlspec.dtd +2649 -0
- data/reference-docs/mathml-source/readme.txt +40 -0
- data/reference-docs/mathml-source/run +296 -0
- data/reference-docs/mathml-source/style/html/html2xhtml.xsl +216 -0
- data/reference-docs/mathml-source/style/html/images.xsl +98 -0
- data/reference-docs/mathml-source/style/html/mml6.xsl +1156 -0
- data/reference-docs/mathml-source/style/html/mmldiff.xsl +566 -0
- data/reference-docs/mathml-source/style/html/mmlspec.xsl +2531 -0
- data/reference-docs/mathml-source/style/html/slices-common.xsl +312 -0
- data/reference-docs/mathml-source/style/html/slices.xsl +48 -0
- data/reference-docs/mathml-source/style/html/xmlspec.xsl +2542 -0
- data/reference-docs/mathml-source/style/pdf/mathmlspec.xsl +2510 -0
- data/reference-docs/mathml-source/xml/changes.xml +773 -0
- data/reference-docs/mathml-source/xml/character-set.xml +1011 -0
- data/reference-docs/mathml-source/xml/content-element-def.xml +6143 -0
- data/reference-docs/mathml-source/xml/content-markup.xml +8178 -0
- data/reference-docs/mathml-source/xml/contributors.xml +425 -0
- data/reference-docs/mathml-source/xml/dom-bindings.xml +20 -0
- data/reference-docs/mathml-source/xml/dom-intro.xml +114 -0
- data/reference-docs/mathml-source/xml/fundamentals.xml +1646 -0
- data/reference-docs/mathml-source/xml/glossary.xml +519 -0
- data/reference-docs/mathml-source/xml/interface.xml +1096 -0
- data/reference-docs/mathml-source/xml/introduction.xml +724 -0
- data/reference-docs/mathml-source/xml/mathml-css-sample.xml +304 -0
- data/reference-docs/mathml-source/xml/mathml-dom.xml +3813 -0
- data/reference-docs/mathml-source/xml/mathml-spec.xml +356 -0
- data/reference-docs/mathml-source/xml/mixing.xml +982 -0
- data/reference-docs/mathml-source/xml/operator-dict.xml +551 -0
- data/reference-docs/mathml-source/xml/parsing.xml +2565 -0
- data/reference-docs/mathml-source/xml/presentation-markup.xml +6834 -0
- data/reference-docs/mathml-source/xml/references.xml +323 -0
- data/reference-docs/mathml-source/xml/validation-grammar.xml +877 -0
- data/schemas/README.adoc +17 -0
- data/schemas/mathml2/common/common-attribs.xsd +41 -0
- data/schemas/mathml2/common/math.xsd +126 -0
- data/schemas/mathml2/common/xlink-href.xsd +20 -0
- data/schemas/mathml2/content/CVS/Entries +16 -0
- data/schemas/mathml2/content/CVS/Repository +1 -0
- data/schemas/mathml2/content/CVS/Root +1 -0
- data/schemas/mathml2/content/arith.xsd +90 -0
- data/schemas/mathml2/content/calculus.xsd +146 -0
- data/schemas/mathml2/content/common-attrib.xsd +30 -0
- data/schemas/mathml2/content/constants.xsd +83 -0
- data/schemas/mathml2/content/constructs.xsd +260 -0
- data/schemas/mathml2/content/elementary-functions.xsd +117 -0
- data/schemas/mathml2/content/functions.xsd +73 -0
- data/schemas/mathml2/content/linear-algebra.xsd +173 -0
- data/schemas/mathml2/content/logic.xsd +53 -0
- data/schemas/mathml2/content/relations.xsd +55 -0
- data/schemas/mathml2/content/semantics.xsd +85 -0
- data/schemas/mathml2/content/sets.xsd +236 -0
- data/schemas/mathml2/content/statistics.xsd +136 -0
- data/schemas/mathml2/content/tokens.xsd +120 -0
- data/schemas/mathml2/content/tokens.xsd.~1.3.~ +119 -0
- data/schemas/mathml2/content/vector-calculus.xsd +88 -0
- data/schemas/mathml2/mathml2.xsd +59 -0
- data/schemas/mathml2/presentation/action.xsd +44 -0
- data/schemas/mathml2/presentation/characters.xsd +37 -0
- data/schemas/mathml2/presentation/common-attribs.xsd +113 -0
- data/schemas/mathml2/presentation/common-types.xsd +103 -0
- data/schemas/mathml2/presentation/error.xsd +40 -0
- data/schemas/mathml2/presentation/layout.xsd +195 -0
- data/schemas/mathml2/presentation/scripts.xsd +186 -0
- data/schemas/mathml2/presentation/space.xsd +52 -0
- data/schemas/mathml2/presentation/style.xsd +69 -0
- data/schemas/mathml2/presentation/table.xsd +216 -0
- data/schemas/mathml2/presentation/tokens.xsd +124 -0
- data/schemas/mathml3/mathml3-common.xsd +99 -0
- data/schemas/mathml3/mathml3-content.xsd +684 -0
- data/schemas/mathml3/mathml3-presentation.xsd +2151 -0
- data/schemas/mathml3/mathml3-strict-content.xsd +186 -0
- data/schemas/mathml3/mathml3.xsd +9 -0
- data/schemas/mathml4/mathml4-content.rnc +382 -0
- data/schemas/mathml4/mathml4-core.rnc +361 -0
- data/schemas/mathml4/mathml4-presentation.rnc +358 -0
- data/schemas/mathml4/mathml4-strict-content.rnc +86 -0
- data/schemas/mathml4/mathml4.rnc +21 -0
- data/schemas/mathml4/mathml4.rnc.1 +21 -0
- data/schemas/mathml4/mathml4.rng +37 -0
- metadata +249 -2
|
@@ -0,0 +1,2531 @@
|
|
|
1
|
+
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
|
2
|
+
version="1.0">
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
<xsl:import href="slices.xsl"/>
|
|
6
|
+
<xsl:output method="html"
|
|
7
|
+
encoding="ISO-8859-1"
|
|
8
|
+
doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"
|
|
9
|
+
doctype-system="http://www.w3.org/TR/html4/loose.dtd"
|
|
10
|
+
indent="no"/>
|
|
11
|
+
|
|
12
|
+
<xsl:param name="toc.level" select="3"/>
|
|
13
|
+
|
|
14
|
+
<!-- Extensions and parameterisation of xmlspec
|
|
15
|
+
These templates produce the same output as the standard xmlspec
|
|
16
|
+
templates (and could be incorporated into later versions of
|
|
17
|
+
xmlspec.xsl) but include extra parameterisation possibilities.
|
|
18
|
+
-->
|
|
19
|
+
|
|
20
|
+
<!-- for parameters, xmlspec defaults are commented out, mmlspec choices
|
|
21
|
+
are used, if these parameters were in xmlspec/slices, then only these
|
|
22
|
+
parameters would be needed here and the templates wouldnt need to be
|
|
23
|
+
copied -->
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
<!--
|
|
27
|
+
<xsl:param name="body.filename.base" select="'slice'"/>
|
|
28
|
+
<xsl:param name="back.filename.base" select="'slice'"/>
|
|
29
|
+
<xsl:param name="back.filename.format" select="'A'"/>
|
|
30
|
+
<xsl:param name="front.filename.base" select="'index'"/>
|
|
31
|
+
<xsl:param name="filename.extension" select="'.html'"/>
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
<xsl:param name="slice.depth" select="0"/>
|
|
35
|
+
|
|
36
|
+
<xsl:param name="title.before.navigation" select="0"/>
|
|
37
|
+
|
|
38
|
+
<xsl:param name="css.base.uri" select="'http://www.w3.org/StyleSheets/TR/'"/>
|
|
39
|
+
-->
|
|
40
|
+
<xsl:param name="body.filename.base" select="'chapter'"/>
|
|
41
|
+
<xsl:param name="back.filename.base" select="'appendix'"/>
|
|
42
|
+
<xsl:param name="back.filename.format" select="'a'"/>
|
|
43
|
+
<xsl:param name="front.filename.base" select="'overview'"/>
|
|
44
|
+
<xsl:param name="filename.extension" select="'.html'"/>
|
|
45
|
+
<xsl:param name="validity.hacks" select="0"/><!--!!!!!!-->
|
|
46
|
+
|
|
47
|
+
<xsl:param name="slice.depth" select="1"/>
|
|
48
|
+
|
|
49
|
+
<xsl:param name="title.before.navigation" select="1"/>
|
|
50
|
+
|
|
51
|
+
<xsl:param name="css.base.uri" select="'http://www.w3.org/StyleSheets/TR/'"/>
|
|
52
|
+
|
|
53
|
+
<!-- FILENAMES -->
|
|
54
|
+
|
|
55
|
+
<xsl:template match="body/div1" mode="slice-filename">
|
|
56
|
+
<xsl:variable name="docnumber">
|
|
57
|
+
<xsl:number count="div1" level="multiple" format="1"/>
|
|
58
|
+
</xsl:variable>
|
|
59
|
+
<xsl:value-of select="$body.filename.base"/>
|
|
60
|
+
<xsl:value-of select="$docnumber"/>
|
|
61
|
+
<xsl:value-of select="$filename.extension"/>
|
|
62
|
+
</xsl:template>
|
|
63
|
+
|
|
64
|
+
<xsl:template match="back/div1 | inform-div1" mode="slice-filename">
|
|
65
|
+
<xsl:variable name="docnumber">
|
|
66
|
+
<xsl:number count="div1|inform-div1" level="multiple" format="{$back.filename.format}"/>
|
|
67
|
+
</xsl:variable>
|
|
68
|
+
<xsl:value-of select="$back.filename.base"/>
|
|
69
|
+
<xsl:value-of select="$docnumber"/>
|
|
70
|
+
<xsl:value-of select="$filename.extension"/>
|
|
71
|
+
</xsl:template>
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
<xsl:template match="spec" mode="slice-filename">
|
|
76
|
+
<xsl:value-of select="$front.filename.base"/>
|
|
77
|
+
<xsl:value-of select="$filename.extension"/>
|
|
78
|
+
</xsl:template>
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
<!-- mmlspec customisation later
|
|
82
|
+
|
|
83
|
+
<xsl:template name="navigation.top">
|
|
84
|
+
<xsl:param name="prev" select="''"/>
|
|
85
|
+
<xsl:param name="next" select="''"/>
|
|
86
|
+
|
|
87
|
+
<a name="Top"/>
|
|
88
|
+
<xsl:comment> TOP NAVIGATION BAR </xsl:comment>
|
|
89
|
+
<table border="0" width="90%"
|
|
90
|
+
cellpadding="4" cellspacing="0"
|
|
91
|
+
bgcolor="#eeeeff"
|
|
92
|
+
class="navigation"
|
|
93
|
+
summary="Navigation Bar">
|
|
94
|
+
<col width="25%"/>
|
|
95
|
+
<col width="25%"/>
|
|
96
|
+
<col width="25%"/>
|
|
97
|
+
<col width="25%"/>
|
|
98
|
+
<tr>
|
|
99
|
+
<td> </td>
|
|
100
|
+
<td> </td>
|
|
101
|
+
<td> </td>
|
|
102
|
+
<td> </td>
|
|
103
|
+
</tr>
|
|
104
|
+
<tr>
|
|
105
|
+
<td align="left">
|
|
106
|
+
<a href="{$front.filename.base}{$filename.extension}#contents">Table of Contents</a>
|
|
107
|
+
</td>
|
|
108
|
+
<td align="left">
|
|
109
|
+
<xsl:choose>
|
|
110
|
+
<xsl:when test="$prev">
|
|
111
|
+
<a>
|
|
112
|
+
<xsl:attribute name="href">
|
|
113
|
+
<xsl:call-template name="href.target">
|
|
114
|
+
<xsl:with-param name="target" select="$prev"/>
|
|
115
|
+
<xsl:with-param name="just.filename" select="1"/>
|
|
116
|
+
</xsl:call-template>
|
|
117
|
+
</xsl:attribute>
|
|
118
|
+
<xsl:text>Prev</xsl:text>
|
|
119
|
+
</a>
|
|
120
|
+
</xsl:when>
|
|
121
|
+
<xsl:otherwise> </xsl:otherwise>
|
|
122
|
+
</xsl:choose>
|
|
123
|
+
</td>
|
|
124
|
+
<td align="left">
|
|
125
|
+
<xsl:choose>
|
|
126
|
+
<xsl:when test="$next">
|
|
127
|
+
<a>
|
|
128
|
+
<xsl:attribute name="href">
|
|
129
|
+
<xsl:call-template name="href.target">
|
|
130
|
+
<xsl:with-param name="target" select="$next"/>
|
|
131
|
+
<xsl:with-param name="just.filename" select="1"/>
|
|
132
|
+
</xsl:call-template>
|
|
133
|
+
</xsl:attribute>
|
|
134
|
+
<xsl:text>Next</xsl:text>
|
|
135
|
+
</a>
|
|
136
|
+
</xsl:when>
|
|
137
|
+
<xsl:otherwise> </xsl:otherwise>
|
|
138
|
+
</xsl:choose>
|
|
139
|
+
</td>
|
|
140
|
+
<td align="left">
|
|
141
|
+
<a href="#Bottom">Bottom</a>
|
|
142
|
+
</td>
|
|
143
|
+
</tr>
|
|
144
|
+
</table>
|
|
145
|
+
|
|
146
|
+
!- - quick table of contents - ->
|
|
147
|
+
<table border="0" width="90%"
|
|
148
|
+
cellpadding="4" cellspacing="0"
|
|
149
|
+
bgcolor="#eeeeff"
|
|
150
|
+
class="navigation-toc"
|
|
151
|
+
summary="Navigation TOC"
|
|
152
|
+
>
|
|
153
|
+
<col width="100%"/>
|
|
154
|
+
<tr align="left"><th><hr/>Quick Table of Contents<hr/></th></tr>
|
|
155
|
+
<tr>
|
|
156
|
+
<td>
|
|
157
|
+
<xsl:apply-templates mode="toc" select=".">
|
|
158
|
+
<xsl:with-param name="just.filename" select="'0'"/>
|
|
159
|
+
</xsl:apply-templates>
|
|
160
|
+
</td>
|
|
161
|
+
</tr>
|
|
162
|
+
</table>
|
|
163
|
+
</xsl:template>
|
|
164
|
+
|
|
165
|
+
-->
|
|
166
|
+
|
|
167
|
+
<!-- END OF FILENAMES -->
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
<!-- HTML HEADING DEPTH -->
|
|
172
|
+
|
|
173
|
+
<xsl:template match="example/head">
|
|
174
|
+
<xsl:text> </xsl:text>
|
|
175
|
+
<xsl:choose>
|
|
176
|
+
<xsl:when test="$tabular.examples = 0">
|
|
177
|
+
<div class="exampleHead">
|
|
178
|
+
<xsl:text>Example: </xsl:text>
|
|
179
|
+
<xsl:apply-templates/>
|
|
180
|
+
</div>
|
|
181
|
+
</xsl:when>
|
|
182
|
+
<xsl:otherwise>
|
|
183
|
+
<xsl:variable name="depth" select="count(ancestor::*[contains(name(),'div')])"/>
|
|
184
|
+
<xsl:variable name="h">
|
|
185
|
+
<xsl:choose>
|
|
186
|
+
<xsl:when test="$depth > $slice.depth">
|
|
187
|
+
<xsl:value-of select="1 + $depth - $slice.depth"/>
|
|
188
|
+
</xsl:when>
|
|
189
|
+
<xsl:otherwise>
|
|
190
|
+
<xsl:value-of select="1 + $depth"/>
|
|
191
|
+
</xsl:otherwise>
|
|
192
|
+
</xsl:choose>
|
|
193
|
+
</xsl:variable>
|
|
194
|
+
<xsl:element name="h{$h+1}">
|
|
195
|
+
<xsl:call-template name="anchor">
|
|
196
|
+
<xsl:with-param name="node" select=".."/>
|
|
197
|
+
<xsl:with-param name="conditional" select="0"/>
|
|
198
|
+
</xsl:call-template>
|
|
199
|
+
|
|
200
|
+
<xsl:text>Example: </xsl:text>
|
|
201
|
+
<xsl:apply-templates/>
|
|
202
|
+
</xsl:element>
|
|
203
|
+
</xsl:otherwise>
|
|
204
|
+
</xsl:choose>
|
|
205
|
+
</xsl:template>
|
|
206
|
+
|
|
207
|
+
<xsl:template match="*[contains(name(),'div')]/head">
|
|
208
|
+
<xsl:text> </xsl:text>
|
|
209
|
+
<xsl:variable name="depth"
|
|
210
|
+
select="count(ancestor::*[contains(name(),'div')])"/>
|
|
211
|
+
<xsl:variable name="num">
|
|
212
|
+
<xsl:apply-templates select=".." mode="divnum"/>
|
|
213
|
+
</xsl:variable>
|
|
214
|
+
<xsl:variable name="h">
|
|
215
|
+
<xsl:choose>
|
|
216
|
+
<xsl:when test="$depth > $slice.depth">
|
|
217
|
+
<xsl:value-of select="1+ $depth - $slice.depth"/>
|
|
218
|
+
</xsl:when>
|
|
219
|
+
<xsl:otherwise>
|
|
220
|
+
<xsl:value-of select="1"/>
|
|
221
|
+
</xsl:otherwise>
|
|
222
|
+
</xsl:choose>
|
|
223
|
+
</xsl:variable>
|
|
224
|
+
<xsl:element name="h{$h}">
|
|
225
|
+
<xsl:call-template name="anchor">
|
|
226
|
+
<xsl:with-param name="conditional" select="0"/>
|
|
227
|
+
<xsl:with-param name="node" select=".."/>
|
|
228
|
+
<xsl:with-param name="default.id" select="translate(concat('id.',$num),' ','')"/>
|
|
229
|
+
</xsl:call-template>
|
|
230
|
+
<xsl:copy-of select="$num"/>
|
|
231
|
+
<xsl:apply-templates/>
|
|
232
|
+
<xsl:if test="parent::inform-div1"> (Non-Normative)</xsl:if>
|
|
233
|
+
</xsl:element>
|
|
234
|
+
</xsl:template>
|
|
235
|
+
|
|
236
|
+
|
|
237
|
+
<!-- Combined toc template for all the div elements.
|
|
238
|
+
This has toc.level as a _local_ parameter rather than global
|
|
239
|
+
so main document toc and per-chapter tocs can be different
|
|
240
|
+
depths.
|
|
241
|
+
-->
|
|
242
|
+
<xsl:template match="*[contains(name(),'div')]|MMLdefinition" mode="toc">
|
|
243
|
+
<xsl:param name="indent" select="''"/>
|
|
244
|
+
<xsl:param name="toc.level" select="$toc.level"/>
|
|
245
|
+
<xsl:variable name="depth"
|
|
246
|
+
select="count(ancestor::*[contains(name(),'div')])"/>
|
|
247
|
+
<xsl:variable name="num">
|
|
248
|
+
<xsl:apply-templates select="." mode="divnum"/>
|
|
249
|
+
</xsl:variable>
|
|
250
|
+
<xsl:value-of select="$indent"/>
|
|
251
|
+
<xsl:copy-of select="$num"/>
|
|
252
|
+
<a>
|
|
253
|
+
<xsl:attribute name="href">
|
|
254
|
+
<xsl:call-template name="href.target">
|
|
255
|
+
<xsl:with-param name="target" select="."/>
|
|
256
|
+
<xsl:with-param name="default.id" select="translate(concat('id.',$num),' ','')"/>
|
|
257
|
+
</xsl:call-template>
|
|
258
|
+
</xsl:attribute>
|
|
259
|
+
<xsl:apply-templates select="head|name" mode="text"/>
|
|
260
|
+
<xsl:if test="self::inform-div1"> (Non-Normative)</xsl:if>
|
|
261
|
+
</a>
|
|
262
|
+
<br/>
|
|
263
|
+
<xsl:if test="$depth +1 < $toc.level">
|
|
264
|
+
<xsl:apply-templates select="*[contains(name(),'div')]|MMLdefinition" mode="toc">
|
|
265
|
+
<xsl:with-param name="indent" select="concat($indent,'    ')"/>
|
|
266
|
+
<xsl:with-param name="toc.level" select="$toc.level"/>
|
|
267
|
+
</xsl:apply-templates>
|
|
268
|
+
</xsl:if>
|
|
269
|
+
</xsl:template>
|
|
270
|
+
|
|
271
|
+
|
|
272
|
+
<!-- END OF HTML HEADING DEPTH -->
|
|
273
|
+
|
|
274
|
+
|
|
275
|
+
<!-- OBJECT ID -->
|
|
276
|
+
<!-- use @id in preference to default.id and use this to generate
|
|
277
|
+
references as well as anchors so as to get #id.1.2 rather than
|
|
278
|
+
#lscdkalc
|
|
279
|
+
-->
|
|
280
|
+
<xsl:template name="object.id">
|
|
281
|
+
<xsl:param name="node" select="."/>
|
|
282
|
+
<xsl:param name="default.id" select="''"/>
|
|
283
|
+
|
|
284
|
+
<xsl:choose>
|
|
285
|
+
<xsl:when test="$node/@id">
|
|
286
|
+
<xsl:value-of select="translate($node/@id,'_','.')"/>
|
|
287
|
+
</xsl:when>
|
|
288
|
+
<!-- can't use the default ID if it's used somewhere else in the document! -->
|
|
289
|
+
<xsl:when test="$default.id != '' and not(key('ids', $default.id))">
|
|
290
|
+
<xsl:value-of select="$default.id"/>
|
|
291
|
+
</xsl:when>
|
|
292
|
+
<xsl:otherwise>
|
|
293
|
+
<xsl:value-of select="generate-id($node)"/>
|
|
294
|
+
</xsl:otherwise>
|
|
295
|
+
</xsl:choose>
|
|
296
|
+
</xsl:template>
|
|
297
|
+
|
|
298
|
+
<!-- END OF OBJECT ID -->
|
|
299
|
+
|
|
300
|
+
|
|
301
|
+
<!-- QUICK TOC LOCATION -->
|
|
302
|
+
|
|
303
|
+
<xsl:template match="body/div1">
|
|
304
|
+
<xsl:variable name="prev"
|
|
305
|
+
select="(preceding::div1|preceding::inform-div1)[last()]"/>
|
|
306
|
+
<xsl:variable name="next"
|
|
307
|
+
select="(following::div1|following::inform-div1)[1]"/>
|
|
308
|
+
|
|
309
|
+
<xsl:call-template name="write.chunk">
|
|
310
|
+
<xsl:with-param name="filename">
|
|
311
|
+
<xsl:apply-templates select="." mode="slice-filename"/>
|
|
312
|
+
</xsl:with-param>
|
|
313
|
+
<xsl:with-param name="content">
|
|
314
|
+
<html>
|
|
315
|
+
<xsl:if test="header/langusage/language">
|
|
316
|
+
<xsl:attribute name="lang">
|
|
317
|
+
<xsl:value-of select="header/langusage/language/@id"/>
|
|
318
|
+
</xsl:attribute>
|
|
319
|
+
</xsl:if>
|
|
320
|
+
<head>
|
|
321
|
+
<title><xsl:value-of select="head"/></title>
|
|
322
|
+
<xsl:call-template name="css"/>
|
|
323
|
+
</head>
|
|
324
|
+
<body>
|
|
325
|
+
<xsl:apply-templates select="head[$title.before.navigation]"/>
|
|
326
|
+
<xsl:call-template name="navigation.top">
|
|
327
|
+
<xsl:with-param name="prev" select="$prev"/>
|
|
328
|
+
<xsl:with-param name="next" select="$next"/>
|
|
329
|
+
</xsl:call-template>
|
|
330
|
+
|
|
331
|
+
<div class="div1">
|
|
332
|
+
<xsl:apply-templates select="node()[not(self::head[$title.before.navigation])]"/>
|
|
333
|
+
</div>
|
|
334
|
+
|
|
335
|
+
<xsl:call-template name="navigation.bottom">
|
|
336
|
+
<xsl:with-param name="prev" select="$prev"/>
|
|
337
|
+
<xsl:with-param name="next" select="$next"/>
|
|
338
|
+
</xsl:call-template>
|
|
339
|
+
</body>
|
|
340
|
+
</html>
|
|
341
|
+
</xsl:with-param>
|
|
342
|
+
</xsl:call-template>
|
|
343
|
+
</xsl:template>
|
|
344
|
+
|
|
345
|
+
<xsl:template match="back/div1 | back/inform-div1">
|
|
346
|
+
<xsl:variable name="prev"
|
|
347
|
+
select="(preceding::div1|preceding::inform-div1)[last()]"/>
|
|
348
|
+
<xsl:variable name="next"
|
|
349
|
+
select="(following::div1|following::inform-div1)[1]"/>
|
|
350
|
+
|
|
351
|
+
<xsl:call-template name="write.chunk">
|
|
352
|
+
<xsl:with-param name="filename">
|
|
353
|
+
<xsl:apply-templates select="." mode="slice-filename"/>
|
|
354
|
+
</xsl:with-param>
|
|
355
|
+
<xsl:with-param name="content">
|
|
356
|
+
<html>
|
|
357
|
+
<head>
|
|
358
|
+
<title><xsl:value-of select="head"/></title>
|
|
359
|
+
<xsl:call-template name="css"/>
|
|
360
|
+
</head>
|
|
361
|
+
<body>
|
|
362
|
+
<xsl:apply-templates select="head[$title.before.navigation]"/>
|
|
363
|
+
<xsl:call-template name="navigation.top">
|
|
364
|
+
<xsl:with-param name="prev" select="$prev"/>
|
|
365
|
+
<xsl:with-param name="next" select="$next"/>
|
|
366
|
+
</xsl:call-template>
|
|
367
|
+
|
|
368
|
+
<div class="div1">
|
|
369
|
+
<xsl:apply-templates select="node()[not(self::head[$title.before.navigation])]"/>
|
|
370
|
+
</div>
|
|
371
|
+
|
|
372
|
+
<xsl:call-template name="navigation.bottom">
|
|
373
|
+
<xsl:with-param name="prev" select="$prev"/>
|
|
374
|
+
<xsl:with-param name="next" select="$next"/>
|
|
375
|
+
</xsl:call-template>
|
|
376
|
+
</body>
|
|
377
|
+
</html>
|
|
378
|
+
</xsl:with-param>
|
|
379
|
+
</xsl:call-template>
|
|
380
|
+
</xsl:template>
|
|
381
|
+
|
|
382
|
+
<xsl:template match="inform-div1">
|
|
383
|
+
<xsl:variable name="prev"
|
|
384
|
+
select="(preceding::div1|preceding::inform-div1)[last()]"/>
|
|
385
|
+
<xsl:variable name="next"
|
|
386
|
+
select="(following::div1|following::inform-div1)[1]"/>
|
|
387
|
+
|
|
388
|
+
<xsl:call-template name="write.chunk">
|
|
389
|
+
<xsl:with-param name="filename">
|
|
390
|
+
<xsl:apply-templates select="." mode="slice-filename"/>
|
|
391
|
+
</xsl:with-param>
|
|
392
|
+
<xsl:with-param name="content">
|
|
393
|
+
<html>
|
|
394
|
+
<head>
|
|
395
|
+
<title><xsl:value-of select="head"/></title>
|
|
396
|
+
<xsl:call-template name="css"/>
|
|
397
|
+
</head>
|
|
398
|
+
<body>
|
|
399
|
+
<xsl:apply-templates select="head[$title.before.navigation]"/>
|
|
400
|
+
<xsl:call-template name="navigation.top">
|
|
401
|
+
<xsl:with-param name="prev" select="$prev"/>
|
|
402
|
+
<xsl:with-param name="next" select="$next"/>
|
|
403
|
+
</xsl:call-template>
|
|
404
|
+
|
|
405
|
+
<div class="div1">
|
|
406
|
+
<xsl:apply-templates select="node()[not(self::head[$title.before.navigation])]"/>
|
|
407
|
+
</div>
|
|
408
|
+
|
|
409
|
+
<xsl:call-template name="navigation.bottom">
|
|
410
|
+
<xsl:with-param name="prev" select="$prev"/>
|
|
411
|
+
<xsl:with-param name="next" select="$next"/>
|
|
412
|
+
</xsl:call-template>
|
|
413
|
+
</body>
|
|
414
|
+
</html>
|
|
415
|
+
</xsl:with-param>
|
|
416
|
+
</xsl:call-template>
|
|
417
|
+
</xsl:template>
|
|
418
|
+
|
|
419
|
+
<!-- END OF QUICK TOC LOCATION -->
|
|
420
|
+
|
|
421
|
+
|
|
422
|
+
|
|
423
|
+
|
|
424
|
+
|
|
425
|
+
|
|
426
|
+
|
|
427
|
+
<!-- SLIST -->
|
|
428
|
+
<xsl:template match="slist">
|
|
429
|
+
<ul>
|
|
430
|
+
<xsl:apply-templates/>
|
|
431
|
+
</ul>
|
|
432
|
+
</xsl:template>
|
|
433
|
+
|
|
434
|
+
<xsl:template match="sitem">
|
|
435
|
+
<li class="sitem"><xsl:apply-templates/></li>
|
|
436
|
+
</xsl:template>
|
|
437
|
+
|
|
438
|
+
<xsl:template match="item">
|
|
439
|
+
<xsl:if test="$show.diff.markup='1' or not(@diff='del')">
|
|
440
|
+
<li>
|
|
441
|
+
<xsl:if test="@diff and $show.diff.markup='1'">
|
|
442
|
+
<xsl:attribute name="class">
|
|
443
|
+
<xsl:text>diff-</xsl:text>
|
|
444
|
+
<xsl:value-of select="@diff"/>
|
|
445
|
+
</xsl:attribute>
|
|
446
|
+
</xsl:if>
|
|
447
|
+
<xsl:apply-templates/>
|
|
448
|
+
<xsl:if test="@diff and $show.diff.markup='1'">
|
|
449
|
+
<xsl:call-template name="diff-back-link"/>
|
|
450
|
+
</xsl:if>
|
|
451
|
+
</li>
|
|
452
|
+
</xsl:if>
|
|
453
|
+
</xsl:template>
|
|
454
|
+
|
|
455
|
+
<!-- NESTED PARAGRAPHAS -->
|
|
456
|
+
|
|
457
|
+
<!-- xmlspec, like most document formats other than html, allows
|
|
458
|
+
block level elements in paragraphs. For hTML need to
|
|
459
|
+
separately wrap each conecutive run of inline elements in <p>
|
|
460
|
+
and leave block level elements outside the p.
|
|
461
|
+
|
|
462
|
+
xmlspec.xsl has some code using disable-output-escaping to
|
|
463
|
+
attempt to do this, but it doesn't really work, evn with processors
|
|
464
|
+
taht support d-o-e. The original mathml stylesheet as used for
|
|
465
|
+
mathml 1.01 had code to deal with this, but this is a more
|
|
466
|
+
efficient implementation using the grouping technique using keys.
|
|
467
|
+
-->
|
|
468
|
+
|
|
469
|
+
|
|
470
|
+
<xsl:key name="pnodes" match="p/node()"
|
|
471
|
+
use="generate-id((..|
|
|
472
|
+
(preceding-sibling::*|.)[
|
|
473
|
+
self::eg
|
|
474
|
+
or self::glist
|
|
475
|
+
or self::olist
|
|
476
|
+
or self::ulist
|
|
477
|
+
or self::slist
|
|
478
|
+
or self::orglist
|
|
479
|
+
or self::table
|
|
480
|
+
or self::issue
|
|
481
|
+
or self::note
|
|
482
|
+
or self::processing-instruction()
|
|
483
|
+
or self::graphic[not(@role='inline')]
|
|
484
|
+
])[last()])"/>
|
|
485
|
+
|
|
486
|
+
<xsl:template match="p">
|
|
487
|
+
<xsl:variable name="p1">
|
|
488
|
+
<p>
|
|
489
|
+
<xsl:if test="@id">
|
|
490
|
+
<xsl:attribute name="id"><xsl:value-of
|
|
491
|
+
select="translate(@id,'_','.')"/></xsl:attribute>
|
|
492
|
+
</xsl:if>
|
|
493
|
+
<xsl:if test="@role">
|
|
494
|
+
<xsl:attribute name="class">
|
|
495
|
+
<xsl:value-of select="@role"/>
|
|
496
|
+
</xsl:attribute>
|
|
497
|
+
</xsl:if>
|
|
498
|
+
<xsl:apply-templates select="key('pnodes',generate-id(.))"/>
|
|
499
|
+
</p>
|
|
500
|
+
</xsl:variable>
|
|
501
|
+
<xsl:if test="key('pnodes',generate-id(.))/self::* or normalize-space($p1)">
|
|
502
|
+
<xsl:copy-of select="$p1"/>
|
|
503
|
+
</xsl:if>
|
|
504
|
+
<xsl:for-each select="eg|glist|olist|ulist|slist|orglist|
|
|
505
|
+
table|issue|note|processing-instruction()|
|
|
506
|
+
graphic[not(@role='inline')]">
|
|
507
|
+
<xsl:apply-templates select="."/>
|
|
508
|
+
<xsl:variable name="p" select="key('pnodes',generate-id(.))[position() > 1]"/>
|
|
509
|
+
<xsl:if test="$p[self::* or normalize-space(.)]">
|
|
510
|
+
<p>
|
|
511
|
+
<xsl:apply-templates select="$p"/>
|
|
512
|
+
</p>
|
|
513
|
+
</xsl:if>
|
|
514
|
+
</xsl:for-each>
|
|
515
|
+
</xsl:template>
|
|
516
|
+
|
|
517
|
+
|
|
518
|
+
<!-- END OF NESTED PARAGRAPHAS -->
|
|
519
|
+
|
|
520
|
+
|
|
521
|
+
<!-- RHS DIFF MARKUP (del) -->
|
|
522
|
+
<xsl:template mode="number" match="prod">
|
|
523
|
+
<xsl:text>[</xsl:text>
|
|
524
|
+
<xsl:apply-templates select="." mode="number-simple"/>
|
|
525
|
+
<xsl:text>]</xsl:text>
|
|
526
|
+
</xsl:template>
|
|
527
|
+
|
|
528
|
+
<xsl:template mode="number-simple" match="prod">
|
|
529
|
+
<xsl:number level="any" count="prod[not(@diff='del' or ../@diff='del')]"/>
|
|
530
|
+
</xsl:template>
|
|
531
|
+
|
|
532
|
+
<xsl:template mode="number" match="prod[@diff='del'or ../@diff='del']">
|
|
533
|
+
<xsl:text>[</xsl:text>
|
|
534
|
+
<xsl:apply-templates select="preceding::prod[not(@diff='del' or ../@diff='del')][1]"
|
|
535
|
+
mode="number-simple"/>
|
|
536
|
+
<!--
|
|
537
|
+
Once again, this could be done right here, but XT won't hear of it.
|
|
538
|
+
<xsl:number level="any" count="prod[not(@diff='del' or ../@diff='del')]"/>
|
|
539
|
+
-->
|
|
540
|
+
<xsl:number level="any" count="prod[@diff='del' or ../@diff='del']"
|
|
541
|
+
from="prod[not(@diff= 'del' or ../@diff='del')]" format="a"/>
|
|
542
|
+
<xsl:text>]</xsl:text>
|
|
543
|
+
</xsl:template>
|
|
544
|
+
|
|
545
|
+
|
|
546
|
+
<xsl:template match="prod">
|
|
547
|
+
<tbody>
|
|
548
|
+
<xsl:apply-templates
|
|
549
|
+
select="lhs[not(@diff='del' and $show.diff.markup='0')][not(@diff='del' and $show.diff.markup='0')] |
|
|
550
|
+
rhs[not(@diff='del' and $show.diff.markup='0')][preceding-sibling::*[not(@diff='del' and $show.diff.markup='0')][1][name()!='lhs']] |
|
|
551
|
+
com[not(@diff='del' and $show.diff.markup='0')][preceding-sibling::*[not(@diff='del' and $show.diff.markup='0')][1][name()!='rhs']] |
|
|
552
|
+
constraint[not(@diff='del' and $show.diff.markup='0')][preceding-sibling::*[not(@diff='del' and $show.diff.markup='0')][1][name()!='rhs']] |
|
|
553
|
+
vc[not(@diff='del' and $show.diff.markup='0')][preceding-sibling::*[not(@diff='del' and $show.diff.markup='0')][1][name()!='rhs']] |
|
|
554
|
+
wfc[preceding-sibling::*[1][name()!='rhs']]"/>
|
|
555
|
+
</tbody>
|
|
556
|
+
</xsl:template>
|
|
557
|
+
|
|
558
|
+
<xsl:template match="lhs">
|
|
559
|
+
<tr valign="baseline">
|
|
560
|
+
<td>
|
|
561
|
+
<xsl:if test="ancestor-or-self::*/@diff and $show.diff.markup='1'">
|
|
562
|
+
<xsl:attribute name="class">
|
|
563
|
+
<xsl:text>diff-</xsl:text>
|
|
564
|
+
<xsl:value-of select="ancestor-or-self::*/@diff"/>
|
|
565
|
+
</xsl:attribute>
|
|
566
|
+
</xsl:if>
|
|
567
|
+
<xsl:if test="../@id">
|
|
568
|
+
<a name="{../@id}" id="{../@id}"/>
|
|
569
|
+
</xsl:if>
|
|
570
|
+
<xsl:apply-templates select="ancestor::prod" mode="number"/>
|
|
571
|
+
<!--
|
|
572
|
+
This could be done right here, but XT goes into deep space when the
|
|
573
|
+
node to be numbered isn't the current node and level="any":
|
|
574
|
+
<xsl:number count="prod" level="any" from="spec"
|
|
575
|
+
format="[1]"/>
|
|
576
|
+
-->
|
|
577
|
+
<xsl:text>   </xsl:text>
|
|
578
|
+
</td>
|
|
579
|
+
<td>
|
|
580
|
+
<xsl:if test="ancestor-or-self::*/@diff and $show.diff.markup='1'">
|
|
581
|
+
<xsl:attribute name="class">
|
|
582
|
+
<xsl:text>diff-</xsl:text>
|
|
583
|
+
<xsl:value-of select="ancestor-or-self::*/@diff"/>
|
|
584
|
+
</xsl:attribute>
|
|
585
|
+
</xsl:if>
|
|
586
|
+
<code><xsl:apply-templates/></code>
|
|
587
|
+
</td>
|
|
588
|
+
<td>
|
|
589
|
+
<xsl:if test="ancestor-or-self::*/@diff and $show.diff.markup='1'">
|
|
590
|
+
<xsl:attribute name="class">
|
|
591
|
+
<xsl:text>diff-</xsl:text>
|
|
592
|
+
<xsl:value-of select="ancestor-or-self::*/@diff"/>
|
|
593
|
+
</xsl:attribute>
|
|
594
|
+
</xsl:if>
|
|
595
|
+
<xsl:text>   ::=   </xsl:text>
|
|
596
|
+
</td>
|
|
597
|
+
<xsl:apply-templates
|
|
598
|
+
select="following-sibling::*[not(@diff='del' and $show.diff.markup='0')][1][name()='rhs']"/>
|
|
599
|
+
</tr>
|
|
600
|
+
</xsl:template>
|
|
601
|
+
|
|
602
|
+
|
|
603
|
+
<xsl:template match="rhs">
|
|
604
|
+
<xsl:choose>
|
|
605
|
+
<xsl:when test="preceding-sibling::*[not(@diff='del' and $show.diff.markup='0')][1][name()='lhs']">
|
|
606
|
+
<td>
|
|
607
|
+
<xsl:if test="ancestor-or-self::*/@diff and $show.diff.markup='1'">
|
|
608
|
+
<xsl:attribute name="class">
|
|
609
|
+
<xsl:text>diff-</xsl:text>
|
|
610
|
+
<xsl:value-of select="ancestor-or-self::*[1]/@diff"/>
|
|
611
|
+
</xsl:attribute>
|
|
612
|
+
</xsl:if>
|
|
613
|
+
<code><xsl:apply-templates/></code>
|
|
614
|
+
</td>
|
|
615
|
+
<xsl:apply-templates
|
|
616
|
+
select="following-sibling::*[not(@diff='del' and $show.diff.markup='0')][1][name()='com' or
|
|
617
|
+
name()='constraint' or
|
|
618
|
+
name()='vc' or
|
|
619
|
+
name()='wfc']"/>
|
|
620
|
+
</xsl:when>
|
|
621
|
+
<xsl:otherwise>
|
|
622
|
+
<tr valign="baseline">
|
|
623
|
+
<td/><td/><td/>
|
|
624
|
+
<td>
|
|
625
|
+
<xsl:if test="ancestor-or-self::*/@diff and $show.diff.markup='1'">
|
|
626
|
+
<xsl:attribute name="class">
|
|
627
|
+
<xsl:text>diff-</xsl:text>
|
|
628
|
+
<xsl:value-of select="ancestor-or-self::*/@diff"/>
|
|
629
|
+
</xsl:attribute>
|
|
630
|
+
</xsl:if>
|
|
631
|
+
<code><xsl:apply-templates/></code>
|
|
632
|
+
</td>
|
|
633
|
+
<xsl:apply-templates
|
|
634
|
+
select="following-sibling::*[not(@diff='del' and $show.diff.markup='0')][1][name()='com' or
|
|
635
|
+
name()='constraint' or
|
|
636
|
+
name()='vc' or
|
|
637
|
+
name()='wfc']"/>
|
|
638
|
+
</tr>
|
|
639
|
+
</xsl:otherwise>
|
|
640
|
+
</xsl:choose>
|
|
641
|
+
</xsl:template>
|
|
642
|
+
<!-- END OF RHS DIFF MARKUP (del) -->
|
|
643
|
+
|
|
644
|
+
<!-- SLICE CHECKING -->
|
|
645
|
+
<!--
|
|
646
|
+
slices-common has
|
|
647
|
+
<xsl:if test="$target != $slice">
|
|
648
|
+
which repeatedly produces the string value of an entire chapter, or the entire
|
|
649
|
+
spec for every internal reference. saxon produces the mathml spec in
|
|
650
|
+
a third of the time on my machine if this is changed to
|
|
651
|
+
<xsl:if test="generate-id($target) != generate-id($slice)">
|
|
652
|
+
|
|
653
|
+
In addition add the test for "this slice" so references in chapter 3
|
|
654
|
+
to other parts of the same file are of the form #foo rather than
|
|
655
|
+
chapter3.html#foo (don't do this if target = . as in that case
|
|
656
|
+
you have travelled to the target first (as in toc processing).
|
|
657
|
+
-->
|
|
658
|
+
|
|
659
|
+
<xsl:template name="href.target">
|
|
660
|
+
<xsl:param name="target" select="."/>
|
|
661
|
+
<xsl:param name="default.id" select="''"/>
|
|
662
|
+
|
|
663
|
+
<xsl:variable name="slice"
|
|
664
|
+
select="($target/ancestor-or-self::div1
|
|
665
|
+
|$target/ancestor-or-self::inform-div1
|
|
666
|
+
|$target/ancestor-or-self::spec)[last()]"/>
|
|
667
|
+
|
|
668
|
+
|
|
669
|
+
<xsl:variable name="thisslice"
|
|
670
|
+
select="(ancestor-or-self::div1
|
|
671
|
+
|ancestor-or-self::inform-div1
|
|
672
|
+
|ancestor-or-self::spec)[last()]"/>
|
|
673
|
+
|
|
674
|
+
<xsl:if test="(generate-id($slice) != generate-id($thisslice)) or
|
|
675
|
+
(generate-id($target) = generate-id(.))">
|
|
676
|
+
<xsl:apply-templates select="$slice" mode="slice-filename"/>
|
|
677
|
+
</xsl:if>
|
|
678
|
+
<xsl:if test="generate-id($target) != generate-id($slice)">
|
|
679
|
+
<xsl:text>#</xsl:text>
|
|
680
|
+
<xsl:call-template name="object.id">
|
|
681
|
+
<xsl:with-param name="node" select="$target"/>
|
|
682
|
+
<xsl:with-param name="default.id" select="$default.id"/>
|
|
683
|
+
</xsl:call-template>
|
|
684
|
+
</xsl:if>
|
|
685
|
+
</xsl:template>
|
|
686
|
+
|
|
687
|
+
<!-- END OF SLICE CHECKING -->
|
|
688
|
+
|
|
689
|
+
|
|
690
|
+
<xsl:template match="intref">
|
|
691
|
+
<xsl:variable name="target" select="key('ids', @ref)[1]"/>
|
|
692
|
+
<a>
|
|
693
|
+
<xsl:attribute name="href">
|
|
694
|
+
<xsl:call-template name="href.target">
|
|
695
|
+
<xsl:with-param name="target" select="key('ids', @ref)"/>
|
|
696
|
+
</xsl:call-template>
|
|
697
|
+
</xsl:attribute>
|
|
698
|
+
<xsl:apply-templates/>
|
|
699
|
+
</a>
|
|
700
|
+
</xsl:template>
|
|
701
|
+
|
|
702
|
+
|
|
703
|
+
<!-- Add MMLDefinition to target types and special case ref="status"
|
|
704
|
+
prefix reference with Chapter Section or Appendix for div*
|
|
705
|
+
targets (and make it not bold)
|
|
706
|
+
-->
|
|
707
|
+
<!-- specref: reference to another part of the current specification -->
|
|
708
|
+
|
|
709
|
+
<xsl:template match="specref[@ref='status']">
|
|
710
|
+
<a>
|
|
711
|
+
<xsl:attribute name="href">
|
|
712
|
+
<xsl:call-template name="href.target">
|
|
713
|
+
<xsl:with-param name="target" select="key('ids', @ref)"/>
|
|
714
|
+
</xsl:call-template>
|
|
715
|
+
</xsl:attribute>
|
|
716
|
+
<b>Status</b>
|
|
717
|
+
</a>
|
|
718
|
+
</xsl:template>
|
|
719
|
+
|
|
720
|
+
<xsl:template match="specref[@ref='abstract']">
|
|
721
|
+
<a>
|
|
722
|
+
<xsl:attribute name="href">
|
|
723
|
+
<xsl:call-template name="href.target">
|
|
724
|
+
<xsl:with-param name="target" select="key('ids', @ref)"/>
|
|
725
|
+
</xsl:call-template>
|
|
726
|
+
</xsl:attribute>
|
|
727
|
+
<b>Abstract</b>
|
|
728
|
+
</a>
|
|
729
|
+
</xsl:template>
|
|
730
|
+
|
|
731
|
+
<xsl:template match="specref">
|
|
732
|
+
<xsl:variable name="target" select="key('ids', @ref)[1]"/>
|
|
733
|
+
|
|
734
|
+
<xsl:choose>
|
|
735
|
+
<xsl:when test="local-name($target)='issue'">
|
|
736
|
+
<xsl:text>[</xsl:text>
|
|
737
|
+
<a>
|
|
738
|
+
<xsl:attribute name="href">
|
|
739
|
+
<xsl:call-template name="href.target">
|
|
740
|
+
<xsl:with-param name="target" select="key('ids', @ref)"/>
|
|
741
|
+
</xsl:call-template>
|
|
742
|
+
</xsl:attribute>
|
|
743
|
+
<b>
|
|
744
|
+
<xsl:text>Issue </xsl:text>
|
|
745
|
+
<xsl:apply-templates select="key('ids', @ref)" mode="number"/>
|
|
746
|
+
<xsl:text>: </xsl:text>
|
|
747
|
+
<xsl:for-each select="key('ids', @ref)/head">
|
|
748
|
+
<xsl:apply-templates/>
|
|
749
|
+
</xsl:for-each>
|
|
750
|
+
</b>
|
|
751
|
+
</a>
|
|
752
|
+
<xsl:text>]</xsl:text>
|
|
753
|
+
</xsl:when>
|
|
754
|
+
<xsl:when test="starts-with(local-name($target), 'div')">
|
|
755
|
+
<a>
|
|
756
|
+
<xsl:attribute name="href">
|
|
757
|
+
<xsl:call-template name="href.target">
|
|
758
|
+
<xsl:with-param name="target" select="key('ids', @ref)"/>
|
|
759
|
+
</xsl:call-template>
|
|
760
|
+
</xsl:attribute>
|
|
761
|
+
<xsl:for-each select="$target">
|
|
762
|
+
<xsl:choose>
|
|
763
|
+
<xsl:when test="(self::div1) and parent::body">Chapter </xsl:when>
|
|
764
|
+
<xsl:when test="(self::div1 or self::inform-div1) and
|
|
765
|
+
parent::back">Appendix </xsl:when>
|
|
766
|
+
<xsl:otherwise>Section </xsl:otherwise>
|
|
767
|
+
</xsl:choose>
|
|
768
|
+
</xsl:for-each>
|
|
769
|
+
<xsl:apply-templates select="key('ids', @ref)" mode="divnum"/>
|
|
770
|
+
<xsl:apply-templates select="key('ids', @ref)/head" mode="text"/>
|
|
771
|
+
</a>
|
|
772
|
+
</xsl:when>
|
|
773
|
+
<xsl:when test="starts-with(local-name($target), 'inform-div')">
|
|
774
|
+
<a>
|
|
775
|
+
<xsl:attribute name="href">
|
|
776
|
+
<xsl:call-template name="href.target">
|
|
777
|
+
<xsl:with-param name="target" select="key('ids', @ref)"/>
|
|
778
|
+
</xsl:call-template>
|
|
779
|
+
</xsl:attribute>
|
|
780
|
+
<xsl:text>Appendix </xsl:text>
|
|
781
|
+
<xsl:apply-templates select="key('ids', @ref)" mode="divnum"/>
|
|
782
|
+
<xsl:apply-templates select="key('ids', @ref)/head" mode="text"/>
|
|
783
|
+
</a>
|
|
784
|
+
</xsl:when>
|
|
785
|
+
<xsl:when test="local-name($target) = 'vcnote'">
|
|
786
|
+
<b>
|
|
787
|
+
<xsl:text>[VC: </xsl:text>
|
|
788
|
+
<a>
|
|
789
|
+
<xsl:attribute name="href">
|
|
790
|
+
<xsl:call-template name="href.target">
|
|
791
|
+
<xsl:with-param name="target" select="key('ids', @ref)"/>
|
|
792
|
+
</xsl:call-template>
|
|
793
|
+
</xsl:attribute>
|
|
794
|
+
<xsl:apply-templates select="key('ids', @ref)/head" mode="text"/>
|
|
795
|
+
</a>
|
|
796
|
+
<xsl:text>]</xsl:text>
|
|
797
|
+
</b>
|
|
798
|
+
</xsl:when>
|
|
799
|
+
<xsl:when test="local-name($target) = 'prod'">
|
|
800
|
+
<b>
|
|
801
|
+
<xsl:text>[PROD: </xsl:text>
|
|
802
|
+
<a>
|
|
803
|
+
<xsl:attribute name="href">
|
|
804
|
+
<xsl:call-template name="href.target">
|
|
805
|
+
<xsl:with-param name="target" select="key('ids', @ref)"/>
|
|
806
|
+
</xsl:call-template>
|
|
807
|
+
</xsl:attribute>
|
|
808
|
+
<xsl:apply-templates select="$target" mode="number-simple"/>
|
|
809
|
+
</a>
|
|
810
|
+
<xsl:text>]</xsl:text>
|
|
811
|
+
</b>
|
|
812
|
+
</xsl:when>
|
|
813
|
+
<xsl:when test="local-name($target) = 'label'">
|
|
814
|
+
<b>
|
|
815
|
+
<xsl:text>[</xsl:text>
|
|
816
|
+
<a>
|
|
817
|
+
<xsl:attribute name="href">
|
|
818
|
+
<xsl:call-template name="href.target">
|
|
819
|
+
<xsl:with-param name="target" select="key('ids', @ref)"/>
|
|
820
|
+
</xsl:call-template>
|
|
821
|
+
</xsl:attribute>
|
|
822
|
+
<xsl:value-of select="$target"/>
|
|
823
|
+
</a>
|
|
824
|
+
<xsl:text>]</xsl:text>
|
|
825
|
+
</b>
|
|
826
|
+
</xsl:when>
|
|
827
|
+
<xsl:when test="local-name($target)='MMLdefinition'">
|
|
828
|
+
<a>
|
|
829
|
+
<xsl:attribute name="href">
|
|
830
|
+
<xsl:call-template name="href.target">
|
|
831
|
+
<xsl:with-param name="target" select="key('ids', @ref)"/>
|
|
832
|
+
</xsl:call-template>
|
|
833
|
+
</xsl:attribute>
|
|
834
|
+
<b>
|
|
835
|
+
<xsl:value-of select="key('ids', @ref)/name"/>
|
|
836
|
+
</b>
|
|
837
|
+
</a>
|
|
838
|
+
</xsl:when>
|
|
839
|
+
<xsl:otherwise>
|
|
840
|
+
<xsl:message>
|
|
841
|
+
<xsl:text>Unsupported specref to </xsl:text>
|
|
842
|
+
<xsl:value-of select="local-name($target)"/>
|
|
843
|
+
<xsl:text> [</xsl:text>
|
|
844
|
+
<xsl:value-of select="@ref"/>
|
|
845
|
+
<xsl:text>] </xsl:text>
|
|
846
|
+
<xsl:text> (Contact stylesheet maintainer).</xsl:text>
|
|
847
|
+
</xsl:message>
|
|
848
|
+
<b>
|
|
849
|
+
<a>
|
|
850
|
+
<xsl:attribute name="href">
|
|
851
|
+
<xsl:call-template name="href.target">
|
|
852
|
+
<xsl:with-param name="target" select="key('ids', @ref)"/>
|
|
853
|
+
</xsl:call-template>
|
|
854
|
+
</xsl:attribute>
|
|
855
|
+
<xsl:text>???</xsl:text>
|
|
856
|
+
</a>
|
|
857
|
+
</b>
|
|
858
|
+
</xsl:otherwise>
|
|
859
|
+
</xsl:choose>
|
|
860
|
+
</xsl:template>
|
|
861
|
+
|
|
862
|
+
|
|
863
|
+
|
|
864
|
+
|
|
865
|
+
|
|
866
|
+
<xsl:template match="graphic">
|
|
867
|
+
<xsl:choose>
|
|
868
|
+
<xsl:when test="@role='inline'">
|
|
869
|
+
<xsl:choose>
|
|
870
|
+
<xsl:when test="@valign='bottom'">
|
|
871
|
+
<img src="{@source}" alt="{@alt}" align="bottom"></img>
|
|
872
|
+
</xsl:when>
|
|
873
|
+
<xsl:otherwise>
|
|
874
|
+
<img src="{@source}" alt="{@alt}" align="middle"></img>
|
|
875
|
+
</xsl:otherwise>
|
|
876
|
+
</xsl:choose>
|
|
877
|
+
</xsl:when>
|
|
878
|
+
<xsl:otherwise>
|
|
879
|
+
<blockquote>
|
|
880
|
+
<p><img src="{@source}" alt="{@alt}"></img></p>
|
|
881
|
+
</blockquote>
|
|
882
|
+
</xsl:otherwise>
|
|
883
|
+
</xsl:choose>
|
|
884
|
+
</xsl:template>
|
|
885
|
+
|
|
886
|
+
|
|
887
|
+
<!-- CSS STYLESHEET LOCATION -->
|
|
888
|
+
<!-- W3C publication rules insist of absolute URI to these CSS
|
|
889
|
+
files. This is an annoyance to users, but is a major pain while
|
|
890
|
+
developing drafts of the spec. Make the base URI for the CSS
|
|
891
|
+
directory a parameter so it only needs to be
|
|
892
|
+
http://www.w3.org/StyleSheets/TR/
|
|
893
|
+
for the final version to be published in TR space.
|
|
894
|
+
-->
|
|
895
|
+
|
|
896
|
+
<xsl:template name="css">
|
|
897
|
+
<style type="text/css">
|
|
898
|
+
<xsl:text>
|
|
899
|
+
code { font-family: monospace; }
|
|
900
|
+
|
|
901
|
+
div.constraint,
|
|
902
|
+
div.issue,
|
|
903
|
+
div.note,
|
|
904
|
+
div.notice { margin-left: 2em; }
|
|
905
|
+
|
|
906
|
+
li p { margin-top: 0.3em;
|
|
907
|
+
margin-bottom: 0.3em; }
|
|
908
|
+
</xsl:text>
|
|
909
|
+
<xsl:if test="$tabular.examples = 0">
|
|
910
|
+
<xsl:text>
|
|
911
|
+
div.exampleInner pre { margin-left: 1em;
|
|
912
|
+
margin-top: 0em; margin-bottom: 0em}
|
|
913
|
+
div.exampleOuter {border: 4px double gray;
|
|
914
|
+
margin: 0em; padding: 0em}
|
|
915
|
+
div.exampleInner { background-color: #d5dee3;
|
|
916
|
+
border-top-width: 4px;
|
|
917
|
+
border-top-style: double;
|
|
918
|
+
border-top-color: #d3d3d3;
|
|
919
|
+
border-bottom-width: 4px;
|
|
920
|
+
border-bottom-style: double;
|
|
921
|
+
border-bottom-color: #d3d3d3;
|
|
922
|
+
padding: 4px; margin: 0em }
|
|
923
|
+
div.exampleWrapper { margin: 4px }
|
|
924
|
+
div.exampleHeader { font-weight: bold;
|
|
925
|
+
margin: 4px}
|
|
926
|
+
a.mainindex {font-weight: bold;}
|
|
927
|
+
li.sitem {list-style-type: none;}
|
|
928
|
+
</xsl:text>
|
|
929
|
+
</xsl:if>
|
|
930
|
+
<xsl:value-of select="$additional.css"/>
|
|
931
|
+
</style>
|
|
932
|
+
<link rel="stylesheet" type="text/css">
|
|
933
|
+
<xsl:attribute name="href">
|
|
934
|
+
<xsl:copy-of select="$css.base.uri"/>
|
|
935
|
+
<xsl:choose>
|
|
936
|
+
<xsl:when test="/spec/@role='editors-copy'">base</xsl:when>
|
|
937
|
+
<xsl:otherwise>
|
|
938
|
+
<xsl:choose>
|
|
939
|
+
<xsl:when test="/spec/@w3c-doctype='wd'">W3C-WD</xsl:when>
|
|
940
|
+
<xsl:when test="/spec/@w3c-doctype='rec'">W3C-REC</xsl:when>
|
|
941
|
+
<xsl:when test="/spec/@w3c-doctype='pr'">W3C-PR</xsl:when>
|
|
942
|
+
<xsl:when test="/spec/@w3c-doctype='per'">W3C-PER</xsl:when>
|
|
943
|
+
<xsl:when test="/spec/@w3c-doctype='cr'">W3C-CR</xsl:when>
|
|
944
|
+
<xsl:when test="/spec/@w3c-doctype='note'">W3C-NOTE</xsl:when>
|
|
945
|
+
<xsl:otherwise>base</xsl:otherwise>
|
|
946
|
+
</xsl:choose>
|
|
947
|
+
</xsl:otherwise>
|
|
948
|
+
</xsl:choose>
|
|
949
|
+
<xsl:text>.css</xsl:text>
|
|
950
|
+
</xsl:attribute>
|
|
951
|
+
</link>
|
|
952
|
+
</xsl:template>
|
|
953
|
+
|
|
954
|
+
<!-- END CSS STYLESHEET LOCATION -->
|
|
955
|
+
|
|
956
|
+
|
|
957
|
+
|
|
958
|
+
|
|
959
|
+
|
|
960
|
+
<!-- local locs get multiple extensions -->
|
|
961
|
+
<xsl:template match="loc">
|
|
962
|
+
<a href="{@href}">
|
|
963
|
+
<xsl:if test="contains(@href,'.html') and not(contains(@href,'/'))">
|
|
964
|
+
<xsl:attribute name="href">
|
|
965
|
+
<xsl:value-of select="substring-before(@href,'.html')"/>
|
|
966
|
+
<xsl:value-of select="$filename.extension"/>
|
|
967
|
+
</xsl:attribute>
|
|
968
|
+
</xsl:if>
|
|
969
|
+
<xsl:apply-templates/>
|
|
970
|
+
</a>
|
|
971
|
+
<xsl:if test="parent::prevlocs and following-sibling::loc"><br/></xsl:if>
|
|
972
|
+
</xsl:template>
|
|
973
|
+
|
|
974
|
+
|
|
975
|
+
|
|
976
|
+
|
|
977
|
+
|
|
978
|
+
<!-- Templates for DOM-style interface definitions -->
|
|
979
|
+
<xsl:template match="interface">
|
|
980
|
+
<xsl:element name="h{5 -$slice.depth}">
|
|
981
|
+
<xsl:call-template name="anchor"/>
|
|
982
|
+
Interface <xsl:value-of select="@name"/>
|
|
983
|
+
</xsl:element>
|
|
984
|
+
<xsl:if test="normalize-space(@inherits)">
|
|
985
|
+
<p><b>Extends:
|
|
986
|
+
<xsl:call-template name="dom-type-inherits">
|
|
987
|
+
<xsl:with-param name="typestring" select="@inherits"/>
|
|
988
|
+
</xsl:call-template>
|
|
989
|
+
</b></p>
|
|
990
|
+
</xsl:if>
|
|
991
|
+
<xsl:apply-templates select="descr"/>
|
|
992
|
+
<xsl:if test="count(attribute) > 0">
|
|
993
|
+
<p><b>Attributes</b></p>
|
|
994
|
+
<dl>
|
|
995
|
+
<xsl:apply-templates select="attribute"/>
|
|
996
|
+
</dl>
|
|
997
|
+
</xsl:if>
|
|
998
|
+
<xsl:if test="count(method) > 0">
|
|
999
|
+
<p><b>Methods</b></p>
|
|
1000
|
+
<dl>
|
|
1001
|
+
<xsl:apply-templates select="method"/>
|
|
1002
|
+
</dl>
|
|
1003
|
+
</xsl:if>
|
|
1004
|
+
</xsl:template>
|
|
1005
|
+
|
|
1006
|
+
<xsl:template match="attribute">
|
|
1007
|
+
<xsl:if test="not(@diff='del' and $show.diff.markup='0')">
|
|
1008
|
+
<dt>
|
|
1009
|
+
<xsl:if test="@diff and $show.diff.markup='1'">
|
|
1010
|
+
<xsl:attribute name="class">
|
|
1011
|
+
<xsl:text>diff-</xsl:text>
|
|
1012
|
+
<xsl:value-of select="@diff"/>
|
|
1013
|
+
</xsl:attribute>
|
|
1014
|
+
</xsl:if>
|
|
1015
|
+
<code class="attribute-Name"><xsl:value-of
|
|
1016
|
+
select="@name"/></code> of type
|
|
1017
|
+
<xsl:call-template name="dom-type"/>
|
|
1018
|
+
<xsl:if test="@readonly='yes'">
|
|
1019
|
+
<xsl:text>, readonly</xsl:text>
|
|
1020
|
+
</xsl:if>
|
|
1021
|
+
</dt>
|
|
1022
|
+
<dd><xsl:apply-templates select="descr"/>
|
|
1023
|
+
<xsl:apply-templates select="setraises"/>
|
|
1024
|
+
<xsl:apply-templates select="getraises"/>
|
|
1025
|
+
</dd>
|
|
1026
|
+
</xsl:if>
|
|
1027
|
+
</xsl:template>
|
|
1028
|
+
|
|
1029
|
+
<xsl:template match="descr">
|
|
1030
|
+
<xsl:apply-templates/>
|
|
1031
|
+
</xsl:template>
|
|
1032
|
+
|
|
1033
|
+
<xsl:template match="definitions">
|
|
1034
|
+
<xsl:apply-templates/>
|
|
1035
|
+
</xsl:template>
|
|
1036
|
+
|
|
1037
|
+
|
|
1038
|
+
<xsl:template match="exception">
|
|
1039
|
+
<xsl:if test="not(@diff='del' and $show.diff.markup='0')">
|
|
1040
|
+
<dt>
|
|
1041
|
+
<xsl:if test="@diff and $show.diff.markup='1'">
|
|
1042
|
+
<xsl:attribute name="class">
|
|
1043
|
+
<xsl:text>diff-</xsl:text>
|
|
1044
|
+
<xsl:value-of select="@diff"/>
|
|
1045
|
+
</xsl:attribute>
|
|
1046
|
+
</xsl:if>
|
|
1047
|
+
<code><xsl:value-of select="@name"/></code></dt>
|
|
1048
|
+
<dd>
|
|
1049
|
+
<xsl:if test="@diff and $show.diff.markup='1'">
|
|
1050
|
+
<xsl:attribute name="class">
|
|
1051
|
+
<xsl:text>diff-</xsl:text>
|
|
1052
|
+
<xsl:value-of select="@diff"/>
|
|
1053
|
+
</xsl:attribute>
|
|
1054
|
+
</xsl:if>
|
|
1055
|
+
<xsl:apply-templates/></dd>
|
|
1056
|
+
</xsl:if>
|
|
1057
|
+
</xsl:template>
|
|
1058
|
+
|
|
1059
|
+
<xsl:template match="method">
|
|
1060
|
+
<dt><code class="method-Name"><xsl:value-of
|
|
1061
|
+
select="@name"/></code></dt>
|
|
1062
|
+
<dd><xsl:apply-templates select="descr"/>
|
|
1063
|
+
<xsl:if test="count(parameters/param) > 0">
|
|
1064
|
+
<p><b>Parameters</b></p>
|
|
1065
|
+
<table>
|
|
1066
|
+
<xsl:apply-templates select="parameters/param"/>
|
|
1067
|
+
</table>
|
|
1068
|
+
</xsl:if>
|
|
1069
|
+
<xsl:apply-templates select="returns"/>
|
|
1070
|
+
<xsl:apply-templates select="raises"/>
|
|
1071
|
+
</dd>
|
|
1072
|
+
</xsl:template>
|
|
1073
|
+
|
|
1074
|
+
|
|
1075
|
+
<xsl:template match="param">
|
|
1076
|
+
<xsl:if test="not(@diff='del' and $show.diff.markup='0')">
|
|
1077
|
+
<tr>
|
|
1078
|
+
<xsl:if test="@diff and $show.diff.markup='1'">
|
|
1079
|
+
<xsl:attribute name="class">
|
|
1080
|
+
<xsl:text>diff-</xsl:text>
|
|
1081
|
+
<xsl:value-of select="@diff"/>
|
|
1082
|
+
</xsl:attribute>
|
|
1083
|
+
</xsl:if>
|
|
1084
|
+
<td class="baseline"><xsl:call-template name="dom-type"/></td>
|
|
1085
|
+
<td class="baseline"><code><xsl:value-of select="@name"/></code></td>
|
|
1086
|
+
<td class="baseline"><xsl:apply-templates select="descr"/></td>
|
|
1087
|
+
</tr>
|
|
1088
|
+
</xsl:if>
|
|
1089
|
+
</xsl:template>
|
|
1090
|
+
|
|
1091
|
+
<xsl:template match="returns">
|
|
1092
|
+
<p><b>Return value</b></p>
|
|
1093
|
+
<table>
|
|
1094
|
+
<tr>
|
|
1095
|
+
<td class="baseline"><xsl:call-template name="dom-type"/></td>
|
|
1096
|
+
<td class="baseline"><xsl:apply-templates select="descr"/></td>
|
|
1097
|
+
</tr>
|
|
1098
|
+
</table>
|
|
1099
|
+
</xsl:template>
|
|
1100
|
+
|
|
1101
|
+
<xsl:template name="dom-type-inherits">
|
|
1102
|
+
<xsl:param name="typestring"/>
|
|
1103
|
+
<xsl:choose>
|
|
1104
|
+
<xsl:when test="contains($typestring,',')">
|
|
1105
|
+
<xsl:call-template name="dom-type">
|
|
1106
|
+
<xsl:with-param name="type" select="normalize-space(substring-before($typestring,','))"/>
|
|
1107
|
+
</xsl:call-template>
|
|
1108
|
+
<xsl:text xml:space="preserve">, </xsl:text>
|
|
1109
|
+
<xsl:call-template name="dom-type-inherits">
|
|
1110
|
+
<xsl:with-param name="typestring" select="normalize-space(substring-after($typestring,','))"/>
|
|
1111
|
+
</xsl:call-template>
|
|
1112
|
+
</xsl:when>
|
|
1113
|
+
<xsl:otherwise>
|
|
1114
|
+
<xsl:call-template name="dom-type">
|
|
1115
|
+
<xsl:with-param name="type" select="$typestring"/>
|
|
1116
|
+
</xsl:call-template>
|
|
1117
|
+
</xsl:otherwise>
|
|
1118
|
+
</xsl:choose>
|
|
1119
|
+
</xsl:template>
|
|
1120
|
+
|
|
1121
|
+
<xsl:template name="dom-type">
|
|
1122
|
+
<xsl:param name="type" select="@type"/>
|
|
1123
|
+
<code>
|
|
1124
|
+
<xsl:choose>
|
|
1125
|
+
<xsl:when test="not($type = 'void' or $type = 'long' or $type = 'unsigned long' or $type = 'short' or $type = 'unsigned short')">
|
|
1126
|
+
<a>
|
|
1127
|
+
<xsl:attribute name="href">
|
|
1128
|
+
<xsl:choose>
|
|
1129
|
+
<xsl:when test="starts-with($type, 'MathML')">
|
|
1130
|
+
<xsl:if test="ancestor::div1|inform-div1[not(@id='mathml-dom')]">
|
|
1131
|
+
<xsl:value-of select="id('mathml-dom')/@role"/>
|
|
1132
|
+
<xsl:value-of select="$filename.extension"/>
|
|
1133
|
+
</xsl:if
|
|
1134
|
+
>#dom.<xsl:value-of select="substring-after($type, 'MathML')"/>
|
|
1135
|
+
</xsl:when>
|
|
1136
|
+
<xsl:when test="$type = 'DOMString'"
|
|
1137
|
+
>http://www.w3.org/TR/DOM-Level-2-Core/core.html#DOMString</xsl:when>
|
|
1138
|
+
<xsl:when test="$type = 'Document'"
|
|
1139
|
+
>http://www.w3.org/TR/DOM-Level-2-Core/core.html#i-Document</xsl:when>
|
|
1140
|
+
<xsl:otherwise>http://www.w3.org/TR/DOM-Level-2-Core/core.html</xsl:otherwise>
|
|
1141
|
+
</xsl:choose>
|
|
1142
|
+
</xsl:attribute>
|
|
1143
|
+
<xsl:value-of select="$type"/>
|
|
1144
|
+
</a>
|
|
1145
|
+
</xsl:when>
|
|
1146
|
+
<xsl:otherwise>
|
|
1147
|
+
<xsl:value-of select="$type"/>
|
|
1148
|
+
</xsl:otherwise>
|
|
1149
|
+
</xsl:choose>
|
|
1150
|
+
</code>
|
|
1151
|
+
</xsl:template>
|
|
1152
|
+
|
|
1153
|
+
<xsl:template match="setraises">
|
|
1154
|
+
<xsl:choose>
|
|
1155
|
+
<xsl:when test="count(exception)>0">
|
|
1156
|
+
<p><b>Exceptions on Setting</b></p>
|
|
1157
|
+
<dl>
|
|
1158
|
+
<xsl:apply-templates select="exception"/>
|
|
1159
|
+
</dl>
|
|
1160
|
+
</xsl:when>
|
|
1161
|
+
</xsl:choose>
|
|
1162
|
+
</xsl:template>
|
|
1163
|
+
|
|
1164
|
+
<xsl:template match="getraises">
|
|
1165
|
+
<xsl:choose>
|
|
1166
|
+
<xsl:when test="count(exception)>0">
|
|
1167
|
+
<p><b>Exceptions on Getting</b></p>
|
|
1168
|
+
<dl>
|
|
1169
|
+
<xsl:apply-templates select="exception"/>
|
|
1170
|
+
</dl>
|
|
1171
|
+
</xsl:when>
|
|
1172
|
+
</xsl:choose>
|
|
1173
|
+
</xsl:template>
|
|
1174
|
+
|
|
1175
|
+
<xsl:template match="raises">
|
|
1176
|
+
<xsl:choose>
|
|
1177
|
+
<xsl:when test="count(exception) > 0">
|
|
1178
|
+
<p><b>Exceptions</b></p>
|
|
1179
|
+
<dl>
|
|
1180
|
+
<xsl:apply-templates select="exception"/>
|
|
1181
|
+
</dl>
|
|
1182
|
+
</xsl:when>
|
|
1183
|
+
<xsl:otherwise>
|
|
1184
|
+
<p>This method raises no exceptions.</p>
|
|
1185
|
+
</xsl:otherwise>
|
|
1186
|
+
</xsl:choose>
|
|
1187
|
+
</xsl:template>
|
|
1188
|
+
|
|
1189
|
+
|
|
1190
|
+
<xsl:key name="elem" match="el[not(@namespace) or @namespace='mathml']" use="."/>
|
|
1191
|
+
<xsl:key name="att" match="att[not(@namespace) or @namespace='mathml']" use="."/>
|
|
1192
|
+
|
|
1193
|
+
<xsl:template match="processing-instruction()">
|
|
1194
|
+
<xsl:choose>
|
|
1195
|
+
<xsl:when test="name(.)='generate-idl'">
|
|
1196
|
+
<p><b>IDL Definition</b></p>
|
|
1197
|
+
<div class="IDL-definition"><pre>
|
|
1198
|
+
<xsl:apply-templates select="ancestor::interface" mode="idl"/>
|
|
1199
|
+
<xsl:apply-templates select="ancestor::interface/attribute" mode="idl"/>
|
|
1200
|
+
<xsl:apply-templates select="ancestor::interface/method" mode="idl"/>
|
|
1201
|
+
<xsl:text>};</xsl:text>
|
|
1202
|
+
</pre></div>
|
|
1203
|
+
</xsl:when>
|
|
1204
|
+
<xsl:when test="name(.)='include-dtd'">
|
|
1205
|
+
<xsl:processing-instruction name="include">mathml.dtd.html</xsl:processing-instruction>
|
|
1206
|
+
</xsl:when>
|
|
1207
|
+
<xsl:when test="name(.)='generate-binding'">
|
|
1208
|
+
<xsl:choose>
|
|
1209
|
+
<xsl:when test="parent::div2/@id='dom-bindings_IDLBinding'">
|
|
1210
|
+
<xsl:apply-templates select="id('mathml-dom')" mode="IDLInterfaces"/>
|
|
1211
|
+
</xsl:when>
|
|
1212
|
+
<xsl:when test="parent::div2/@id='dom-bindings_JavaBindings'">
|
|
1213
|
+
<xsl:apply-templates select="id('mathml-dom')" mode="javaInterfaces"/>
|
|
1214
|
+
</xsl:when>
|
|
1215
|
+
<xsl:when test="parent::div2/@id='dom-bindings_ECMABinding'">
|
|
1216
|
+
<xsl:apply-templates select="id('mathml-dom')" mode="ecmaInterfaces"/>
|
|
1217
|
+
</xsl:when>
|
|
1218
|
+
<xsl:otherwise>
|
|
1219
|
+
<p class="error">generate-binding processing instruction for unrecognized ID
|
|
1220
|
+
<xsl:value-of select="parent::div2/@id"/></p>
|
|
1221
|
+
</xsl:otherwise>
|
|
1222
|
+
</xsl:choose>
|
|
1223
|
+
</xsl:when>
|
|
1224
|
+
<xsl:when test="name(.)='generate-domInheritance'">
|
|
1225
|
+
<dl>
|
|
1226
|
+
<xsl:apply-templates select="id('mathml-dom')//interface[not(starts-with(normalize-space(@inherits),'MathML'))]" mode="showInheritance"/>
|
|
1227
|
+
</dl>
|
|
1228
|
+
</xsl:when>
|
|
1229
|
+
<xsl:when test="name(.)='generate-elements-index'">
|
|
1230
|
+
<xsl:call-template name="index">
|
|
1231
|
+
<xsl:with-param name="a"
|
|
1232
|
+
select="//el[generate-id()=generate-id(key('elem',.))]"/>
|
|
1233
|
+
<xsl:with-param name="key" select="'elem'"/>
|
|
1234
|
+
</xsl:call-template>
|
|
1235
|
+
</xsl:when>
|
|
1236
|
+
<xsl:when test="name(.)='generate-attributes-index'">
|
|
1237
|
+
<xsl:call-template name="index">
|
|
1238
|
+
<xsl:with-param name="a"
|
|
1239
|
+
select="//att[generate-id()=generate-id(key('att',.))]"/>
|
|
1240
|
+
<xsl:with-param name="key" select="'att'"/>
|
|
1241
|
+
</xsl:call-template>
|
|
1242
|
+
</xsl:when>
|
|
1243
|
+
<xsl:otherwise>
|
|
1244
|
+
<p class="error">Unrecognised processing instruction
|
|
1245
|
+
<xsl:value-of select="name(.)"/></p>
|
|
1246
|
+
</xsl:otherwise>
|
|
1247
|
+
</xsl:choose>
|
|
1248
|
+
</xsl:template>
|
|
1249
|
+
|
|
1250
|
+
<xsl:template name="index">
|
|
1251
|
+
<xsl:param name="a"/>
|
|
1252
|
+
<xsl:param name="key"/>
|
|
1253
|
+
<dl>
|
|
1254
|
+
<xsl:for-each select="$a">
|
|
1255
|
+
<xsl:sort select="."/>
|
|
1256
|
+
<xsl:variable name="this" select="."/>
|
|
1257
|
+
<dt><xsl:value-of select="."/></dt>
|
|
1258
|
+
<dd>
|
|
1259
|
+
<xsl:for-each select="key($key,.)/ancestor::*[self::div1 or
|
|
1260
|
+
self::div2 or self::div3 or self::div4 or self::MMLdefinition][1]">
|
|
1261
|
+
<xsl:variable name="num">
|
|
1262
|
+
<xsl:apply-templates select="." mode="divnum"/>
|
|
1263
|
+
</xsl:variable>
|
|
1264
|
+
<a>
|
|
1265
|
+
<xsl:attribute name="href">
|
|
1266
|
+
<xsl:call-template name="href.target">
|
|
1267
|
+
<xsl:with-param name="target" select="."/>
|
|
1268
|
+
<xsl:with-param name="default.id" select="translate(concat('id.',$num),' ','')"/>
|
|
1269
|
+
</xsl:call-template>
|
|
1270
|
+
</xsl:attribute>
|
|
1271
|
+
<xsl:if test="head/el=$this
|
|
1272
|
+
or self::div4[@id='contm_trig']/p[1]/table/tbody/tr/td/el=$this
|
|
1273
|
+
or ($num='3.4.7.1 ' and ($this='none' or $this='mprescripts'))">
|
|
1274
|
+
<xsl:attribute name="class">mainindex</xsl:attribute>
|
|
1275
|
+
</xsl:if>
|
|
1276
|
+
<xsl:variable name="n">
|
|
1277
|
+
<xsl:apply-templates mode="divnum" select="."/>
|
|
1278
|
+
</xsl:variable>
|
|
1279
|
+
<xsl:value-of select="normalize-space($n)"/>
|
|
1280
|
+
</a>
|
|
1281
|
+
<xsl:if test="position() != last()"><xsl:text>, </xsl:text></xsl:if>
|
|
1282
|
+
</xsl:for-each>
|
|
1283
|
+
</dd>
|
|
1284
|
+
|
|
1285
|
+
</xsl:for-each>
|
|
1286
|
+
</dl>
|
|
1287
|
+
</xsl:template>
|
|
1288
|
+
|
|
1289
|
+
|
|
1290
|
+
<xsl:template match="interface" mode="idl">
|
|
1291
|
+
<xsl:text>interface </xsl:text>
|
|
1292
|
+
<xsl:value-of select="@name"/>
|
|
1293
|
+
<xsl:if test="@inherits">: <xsl:value-of select="@inherits"/></xsl:if>
|
|
1294
|
+
<xsl:text> {
|
|
1295
|
+
</xsl:text>
|
|
1296
|
+
</xsl:template>
|
|
1297
|
+
|
|
1298
|
+
<xsl:template match="attribute" mode="idl">
|
|
1299
|
+
<xsl:text xml:space="preserve"> </xsl:text>
|
|
1300
|
+
<xsl:if test="@readonly='yes'">
|
|
1301
|
+
<xsl:text>readonly </xsl:text>
|
|
1302
|
+
</xsl:if>
|
|
1303
|
+
<xsl:text>attribute </xsl:text>
|
|
1304
|
+
<xsl:value-of select="@type"/>
|
|
1305
|
+
<xsl:text xml:space="preserve"> </xsl:text>
|
|
1306
|
+
<xsl:value-of select="@name"/>
|
|
1307
|
+
<xsl:text>;
|
|
1308
|
+
</xsl:text>
|
|
1309
|
+
</xsl:template>
|
|
1310
|
+
|
|
1311
|
+
<xsl:template match="method" mode="idl">
|
|
1312
|
+
<xsl:text xml:space="preserve"> </xsl:text>
|
|
1313
|
+
<xsl:value-of select="returns/@type"/>
|
|
1314
|
+
<xsl:text xml:space="preserve"> </xsl:text>
|
|
1315
|
+
<xsl:value-of select="@name"/>
|
|
1316
|
+
<xsl:text>(</xsl:text>
|
|
1317
|
+
<xsl:apply-templates select="parameters/param" mode="idl"/>
|
|
1318
|
+
<xsl:text>);
|
|
1319
|
+
</xsl:text>
|
|
1320
|
+
</xsl:template>
|
|
1321
|
+
|
|
1322
|
+
<xsl:template match="param" mode="idl">
|
|
1323
|
+
<xsl:if test="position() > 1">
|
|
1324
|
+
<xsl:text>, </xsl:text>
|
|
1325
|
+
</xsl:if>
|
|
1326
|
+
<xsl:choose>
|
|
1327
|
+
<xsl:when test="@attr">
|
|
1328
|
+
<xsl:value-of select="@attr"/>
|
|
1329
|
+
<xsl:text xml:space="preserve"> </xsl:text>
|
|
1330
|
+
</xsl:when>
|
|
1331
|
+
<xsl:otherwise>
|
|
1332
|
+
<xsl:text>inout </xsl:text>
|
|
1333
|
+
</xsl:otherwise>
|
|
1334
|
+
</xsl:choose>
|
|
1335
|
+
<xsl:value-of select="@type"/>
|
|
1336
|
+
<xsl:text xml:space="preserve"> </xsl:text>
|
|
1337
|
+
<xsl:value-of select="@name"/>
|
|
1338
|
+
</xsl:template>
|
|
1339
|
+
|
|
1340
|
+
|
|
1341
|
+
<!-- IDL, Java, ECMAScript Bindings for DOM -->
|
|
1342
|
+
|
|
1343
|
+
<!-- Constant and Indentation String variables: -->
|
|
1344
|
+
|
|
1345
|
+
<xsl:variable name="lowerCaseString"><xsl:text>abcdefghijklmnopqrstuvwxyz</xsl:text></xsl:variable>
|
|
1346
|
+
<xsl:variable name="upperCaseString"><xsl:text>ABCDEFGHIJKLMNOPQRSTUVWXYZ</xsl:text></xsl:variable>
|
|
1347
|
+
|
|
1348
|
+
<xsl:variable name="IDLindent0"><xsl:text xml:space="preserve">
|
|
1349
|
+
</xsl:text>
|
|
1350
|
+
</xsl:variable>
|
|
1351
|
+
|
|
1352
|
+
<xsl:variable name="IDLindent1"><xsl:text xml:space="preserve">
|
|
1353
|
+
</xsl:text>
|
|
1354
|
+
</xsl:variable>
|
|
1355
|
+
|
|
1356
|
+
<xsl:variable name="IDLindent2"><xsl:text xml:space="preserve">
|
|
1357
|
+
</xsl:text>
|
|
1358
|
+
</xsl:variable>
|
|
1359
|
+
|
|
1360
|
+
<xsl:variable name="IDLindent3"><xsl:text xml:space="preserve">
|
|
1361
|
+
</xsl:text>
|
|
1362
|
+
</xsl:variable>
|
|
1363
|
+
|
|
1364
|
+
<xsl:variable name="IDLindent4"><xsl:text xml:space="preserve">
|
|
1365
|
+
</xsl:text>
|
|
1366
|
+
</xsl:variable>
|
|
1367
|
+
|
|
1368
|
+
<xsl:variable name="IDLindent5"><xsl:text xml:space="preserve">
|
|
1369
|
+
</xsl:text>
|
|
1370
|
+
</xsl:variable>
|
|
1371
|
+
|
|
1372
|
+
<xsl:variable name="raisesIndent"><xsl:text xml:space="preserve">
|
|
1373
|
+
</xsl:text>
|
|
1374
|
+
</xsl:variable>
|
|
1375
|
+
|
|
1376
|
+
<xsl:variable name="javaRaisesIndent"><xsl:text xml:space="preserve">
|
|
1377
|
+
</xsl:text>
|
|
1378
|
+
</xsl:variable>
|
|
1379
|
+
|
|
1380
|
+
<xsl:variable name="javaPackageDeclaration"><xsl:text xml:space="preserve">
|
|
1381
|
+
package org.w3c.dom.mathml;
|
|
1382
|
+
</xsl:text>
|
|
1383
|
+
</xsl:variable>
|
|
1384
|
+
|
|
1385
|
+
<xsl:variable name="idlFileHeader">
|
|
1386
|
+
<xsl:text xml:space="preserve">
|
|
1387
|
+
|
|
1388
|
+
// File: mathml-dom.idl
|
|
1389
|
+
#ifndef _MATHMLDOM_IDL_
|
|
1390
|
+
#define _MATHMLDOM_IDL_
|
|
1391
|
+
|
|
1392
|
+
#include "dom.idl"
|
|
1393
|
+
|
|
1394
|
+
#pragma prefix "w3c.org"
|
|
1395
|
+
|
|
1396
|
+
module mathml_dom
|
|
1397
|
+
{</xsl:text>
|
|
1398
|
+
</xsl:variable>
|
|
1399
|
+
|
|
1400
|
+
<xsl:variable name="idlFileFooter">
|
|
1401
|
+
<xsl:text xml:space="preserve">
|
|
1402
|
+
};
|
|
1403
|
+
|
|
1404
|
+
#endif
|
|
1405
|
+
</xsl:text>
|
|
1406
|
+
</xsl:variable>
|
|
1407
|
+
|
|
1408
|
+
<!-- IDL Binding -->
|
|
1409
|
+
|
|
1410
|
+
<xsl:template match="div1[@id='mathml-dom']" mode="IDLInterfaces">
|
|
1411
|
+
<div class="IDL-definition"><pre>
|
|
1412
|
+
<xsl:value-of select="$idlFileHeader"/>
|
|
1413
|
+
<xsl:apply-templates mode="IDLgetForwardDeclarations"/>
|
|
1414
|
+
<xsl:value-of select="$IDLindent1"/>
|
|
1415
|
+
<xsl:apply-templates mode="IDLInterfaces"/>
|
|
1416
|
+
<xsl:value-of select="$idlFileFooter"/>
|
|
1417
|
+
</pre></div>
|
|
1418
|
+
</xsl:template>
|
|
1419
|
+
|
|
1420
|
+
<!-- IDL GetForwardDeclarations templates -->
|
|
1421
|
+
|
|
1422
|
+
<xsl:template mode="IDLgetForwardDeclarations" match="interface|constant[not(ancestor::interface)]">
|
|
1423
|
+
<xsl:variable name="thisInterface" select="@name"/>
|
|
1424
|
+
<xsl:if test="count(ancestor-or-self::*[ancestor::div1[@id='mathml-dom']]/preceding-sibling::*/descendant-or-self::*[(interface[normalize-space(@inherits)=$thisInterface]) or (param|attribute|returns)[normalize-space(@type)=$thisInterface]])>0">
|
|
1425
|
+
<xsl:value-of select="$IDLindent1"/>
|
|
1426
|
+
<xsl:text xml:space="preserve">interface </xsl:text>
|
|
1427
|
+
<xsl:value-of select="@name"/>
|
|
1428
|
+
<xsl:text>;</xsl:text>
|
|
1429
|
+
</xsl:if>
|
|
1430
|
+
</xsl:template>
|
|
1431
|
+
|
|
1432
|
+
<xsl:template mode="IDLgetForwardDeclarations" match="*">
|
|
1433
|
+
<xsl:apply-templates mode="IDLgetForwardDeclarations"/>
|
|
1434
|
+
</xsl:template>
|
|
1435
|
+
|
|
1436
|
+
<xsl:template mode="IDLgetForwardDeclarations" match="text()">
|
|
1437
|
+
</xsl:template>
|
|
1438
|
+
|
|
1439
|
+
<!-- IDLInterfaces templates -->
|
|
1440
|
+
|
|
1441
|
+
<xsl:template match="interface" mode="IDLInterfaces">
|
|
1442
|
+
<xsl:value-of select="$IDLindent1"/>
|
|
1443
|
+
<xsl:text xml:space="preserve">interface </xsl:text>
|
|
1444
|
+
<xsl:value-of select="@name"/>
|
|
1445
|
+
<xsl:if test="normalize-space(@inherits)">
|
|
1446
|
+
<xsl:text xml:space="preserve"> : </xsl:text>
|
|
1447
|
+
<xsl:value-of select="@inherits"/>
|
|
1448
|
+
</xsl:if>
|
|
1449
|
+
<xsl:value-of select="$IDLindent1"/>
|
|
1450
|
+
<xsl:text>{</xsl:text>
|
|
1451
|
+
<xsl:apply-templates mode="IDLInterfaces"/>
|
|
1452
|
+
<xsl:value-of select="$IDLindent1"/>
|
|
1453
|
+
<xsl:text xml:space="preserve">};
|
|
1454
|
+
</xsl:text>
|
|
1455
|
+
</xsl:template>
|
|
1456
|
+
|
|
1457
|
+
<xsl:template match="constant" mode="IDLInterfaces">
|
|
1458
|
+
<xsl:value-of select="$IDLindent2"/>const <xsl:value-of select="@type"/>
|
|
1459
|
+
<xsl:value-of select="substring(' ',string-length(@type)+1)"/>
|
|
1460
|
+
<xsl:value-of select="@name"/>
|
|
1461
|
+
<xsl:value-of select="substring(' ',string-length(@name)+1)"/>
|
|
1462
|
+
<xsl:text xml:space="preserve">= </xsl:text><xsl:value-of select="@value"/><xsl:text>;</xsl:text>
|
|
1463
|
+
</xsl:template>
|
|
1464
|
+
|
|
1465
|
+
<xsl:template match="attribute" mode="IDLInterfaces">
|
|
1466
|
+
<xsl:value-of select="$IDLindent2"/>
|
|
1467
|
+
<xsl:choose>
|
|
1468
|
+
<xsl:when test="normalize-space(@readonly)='yes'"><xsl:text xml:space="preserve">readonly </xsl:text></xsl:when>
|
|
1469
|
+
<xsl:otherwise><xsl:text xml:space="preserve"> </xsl:text></xsl:otherwise>
|
|
1470
|
+
</xsl:choose>
|
|
1471
|
+
<xsl:text xml:space="preserve">attribute </xsl:text>
|
|
1472
|
+
<xsl:value-of select="@type"/>
|
|
1473
|
+
<xsl:value-of select="substring(' ',string-length(@type)+1)"/>
|
|
1474
|
+
<xsl:text xml:space="preserve"> </xsl:text><xsl:value-of select="@name"/><xsl:text>;</xsl:text>
|
|
1475
|
+
<xsl:apply-templates select="raises|setraises|getraises" mode="IDLInterfaces"/>
|
|
1476
|
+
</xsl:template>
|
|
1477
|
+
|
|
1478
|
+
<xsl:template match="method" mode="IDLInterfaces">
|
|
1479
|
+
<xsl:value-of select="$IDLindent2"/>
|
|
1480
|
+
<xsl:value-of select="returns/@type"/>
|
|
1481
|
+
<xsl:value-of select="substring(' ',string-length(returns/@type)+1)"/>
|
|
1482
|
+
<xsl:text xml:space="preserve"> </xsl:text>
|
|
1483
|
+
<xsl:value-of select="@name"/><xsl:text>(</xsl:text>
|
|
1484
|
+
<xsl:apply-templates select="parameters" mode="IDLInterfaces"/>
|
|
1485
|
+
<xsl:text>)</xsl:text>
|
|
1486
|
+
<xsl:apply-templates select="raises" mode="IDLInterfaces"/>
|
|
1487
|
+
<xsl:text>;</xsl:text>
|
|
1488
|
+
</xsl:template>
|
|
1489
|
+
|
|
1490
|
+
<xsl:template match="parameters" mode="IDLInterfaces">
|
|
1491
|
+
<xsl:variable name="localParent"><xsl:value-of select="ancestor::method/@name"/></xsl:variable>
|
|
1492
|
+
<xsl:variable name="localParamIndent"><xsl:value-of select="$IDLindent2"/>
|
|
1493
|
+
<xsl:text xml:space="preserve"> </xsl:text>
|
|
1494
|
+
<xsl:value-of select="substring(' ',1,string-length($localParent)+2)"/>
|
|
1495
|
+
</xsl:variable>
|
|
1496
|
+
<xsl:for-each select="param[not(@diff='del')]">
|
|
1497
|
+
<xsl:if test="count(preceding-sibling::param)>0">
|
|
1498
|
+
<xsl:text>,</xsl:text>
|
|
1499
|
+
<xsl:value-of select="$localParamIndent"/>
|
|
1500
|
+
</xsl:if>
|
|
1501
|
+
<xsl:value-of select="./@attr"/><xsl:text xml:space="preserve"> </xsl:text>
|
|
1502
|
+
<xsl:value-of select="./@type"/><xsl:text xml:space="preserve"> </xsl:text>
|
|
1503
|
+
<xsl:value-of select="./@name"/>
|
|
1504
|
+
</xsl:for-each>
|
|
1505
|
+
</xsl:template>
|
|
1506
|
+
|
|
1507
|
+
<xsl:template match="raises" mode="IDLInterfaces">
|
|
1508
|
+
<xsl:if test="count(exception)>0">
|
|
1509
|
+
<xsl:value-of select="$raisesIndent"/><xsl:text xml:space="preserve">raises(</xsl:text>
|
|
1510
|
+
<xsl:for-each select="exception">
|
|
1511
|
+
<xsl:variable name="localExceptionName" select="@name"/>
|
|
1512
|
+
<xsl:if test="count(preceding-sibling::exception[normalize-space(@name)=$localExceptionName])=0">
|
|
1513
|
+
<xsl:if test="count(preceding-sibling::exception[not(normalize-space(@name)=$localExceptionName)])!=0">
|
|
1514
|
+
<xsl:text>,</xsl:text>
|
|
1515
|
+
<xsl:value-of select="$raisesIndent"/>
|
|
1516
|
+
</xsl:if>
|
|
1517
|
+
<xsl:value-of select="$localExceptionName"/>
|
|
1518
|
+
</xsl:if>
|
|
1519
|
+
</xsl:for-each>
|
|
1520
|
+
<xsl:text>)</xsl:text>
|
|
1521
|
+
</xsl:if>
|
|
1522
|
+
</xsl:template>
|
|
1523
|
+
|
|
1524
|
+
<xsl:template match="setraises" mode="IDLInterfaces">
|
|
1525
|
+
<xsl:for-each select="exception">
|
|
1526
|
+
<xsl:variable name="localExceptionName" select="@name"/>
|
|
1527
|
+
<xsl:if test="count(preceding-sibling::exception[normalize-space(@name)=$localExceptionName])=0">
|
|
1528
|
+
<xsl:value-of select="$raisesIndent"/><xsl:text xml:space="preserve">// raises(</xsl:text>
|
|
1529
|
+
<xsl:value-of select="$localExceptionName"/><xsl:text xml:space="preserve">) on setting</xsl:text>
|
|
1530
|
+
</xsl:if>
|
|
1531
|
+
</xsl:for-each>
|
|
1532
|
+
</xsl:template>
|
|
1533
|
+
|
|
1534
|
+
<xsl:template match="getraises" mode="IDLInterfaces">
|
|
1535
|
+
<xsl:for-each select="exception">
|
|
1536
|
+
<xsl:variable name="localExceptionName" select="@name"/>
|
|
1537
|
+
<xsl:if test="count(preceding-sibling::exception[normalize-space(@name)=$localExceptionName])=0">
|
|
1538
|
+
<xsl:value-of select="$raisesIndent"/><xsl:text xml:space="preserve">// raises(</xsl:text>
|
|
1539
|
+
<xsl:value-of select="$localExceptionName"/><xsl:text xml:space="preserve">) on retrieval</xsl:text>
|
|
1540
|
+
</xsl:if>
|
|
1541
|
+
</xsl:for-each>
|
|
1542
|
+
</xsl:template>
|
|
1543
|
+
|
|
1544
|
+
<xsl:template match="text()" mode="IDLInterfaces">
|
|
1545
|
+
</xsl:template>
|
|
1546
|
+
|
|
1547
|
+
<xsl:template match="*" mode="IDLInterfaces">
|
|
1548
|
+
<xsl:apply-templates mode="IDLInterfaces"/>
|
|
1549
|
+
</xsl:template>
|
|
1550
|
+
|
|
1551
|
+
<!-- Java Binding -->
|
|
1552
|
+
|
|
1553
|
+
<xsl:template match="div1[@id='mathml-dom']" mode="javaInterfaces">
|
|
1554
|
+
<xsl:apply-templates mode="javaInterfaces" select=".//interface"/>
|
|
1555
|
+
</xsl:template>
|
|
1556
|
+
|
|
1557
|
+
<!-- JavaFileHeader -->
|
|
1558
|
+
|
|
1559
|
+
<xsl:template name="javaFileHeader">
|
|
1560
|
+
<xsl:value-of select="$javaPackageDeclaration"/>
|
|
1561
|
+
<xsl:for-each select=".//attribute/@type|.//param/@type|.//returns/@type|@inherits|.//exception/@name">
|
|
1562
|
+
<xsl:apply-templates mode="javaGetExternalDeclarations" select="."/>
|
|
1563
|
+
</xsl:for-each>
|
|
1564
|
+
</xsl:template>
|
|
1565
|
+
|
|
1566
|
+
<xsl:template mode="javaGetExternalDeclarations" match="text()">
|
|
1567
|
+
</xsl:template>
|
|
1568
|
+
|
|
1569
|
+
<xsl:template mode="javaGetExternalDeclarations" match="@*">
|
|
1570
|
+
<xsl:variable name="targetType" select="normalize-space(.)"/>
|
|
1571
|
+
<xsl:if test="not(starts-with($targetType,'MathML') or $targetType='void' or $targetType='long' or $targetType='unsigned long' or $targetType='short' or $targetType='unsigned short' or $targetType='DOMString' or $targetType='boolean')">
|
|
1572
|
+
<xsl:variable name="localInterfaceParent" select="normalize-space(ancestor::interface/@name)"/>
|
|
1573
|
+
<xsl:variable name="firstCount" select="count(ancestor-or-self::*[ancestor::interface[normalize-space(@name)=$localInterfaceParent]]/preceding-sibling::*/descendant-or-self::*[self::attribute|self::returns|self::constant|self::param][normalize-space(@type)=$targetType])"/>
|
|
1574
|
+
<xsl:variable name="secondCount" select="count(ancestor-or-self::*[ancestor::interface[normalize-space(@name)=$localInterfaceParent]]/preceding-sibling::*/descendant-or-self::exception[normalize-space(@name)=$targetType])"/>
|
|
1575
|
+
<xsl:if test="not(normalize-space(ancestor::interface[@inherits])=$targetType) and $firstCount=0 and $secondCount=0">
|
|
1576
|
+
<xsl:call-template name="javaImportExternal">
|
|
1577
|
+
<xsl:with-param name="theSource">dom</xsl:with-param>
|
|
1578
|
+
<xsl:with-param name="theEntity" select="$targetType"/>
|
|
1579
|
+
</xsl:call-template>
|
|
1580
|
+
</xsl:if>
|
|
1581
|
+
</xsl:if>
|
|
1582
|
+
</xsl:template>
|
|
1583
|
+
|
|
1584
|
+
<xsl:template name="javaImportExternal">
|
|
1585
|
+
<xsl:param name="theSource"/>
|
|
1586
|
+
<xsl:param name="theEntity"/>
|
|
1587
|
+
<xsl:if test="normalize-space($theEntity) and normalize-space($theSource)">
|
|
1588
|
+
<xsl:text xml:space="preserve">
|
|
1589
|
+
import org.w3c.</xsl:text><xsl:value-of select="$theSource"/>
|
|
1590
|
+
<xsl:text>.</xsl:text>
|
|
1591
|
+
<xsl:value-of select="$theEntity"/>
|
|
1592
|
+
<xsl:text>;</xsl:text>
|
|
1593
|
+
</xsl:if>
|
|
1594
|
+
</xsl:template>
|
|
1595
|
+
|
|
1596
|
+
<!-- javaInterfaces Templates -->
|
|
1597
|
+
|
|
1598
|
+
<xsl:template match="interface" mode="javaInterfaces">
|
|
1599
|
+
<h3><a name="{generate-id()}" id="{generate-id()}"/>
|
|
1600
|
+
<xsl:text>org/w3c/dom/mathml/</xsl:text><xsl:value-of select="@name"/><xsl:text>.java</xsl:text>
|
|
1601
|
+
</h3>
|
|
1602
|
+
<div class="IDL-definition"><pre>
|
|
1603
|
+
<xsl:call-template name="javaFileHeader" />
|
|
1604
|
+
<xsl:value-of select="$IDLindent0"/>
|
|
1605
|
+
<xsl:value-of select="$IDLindent0"/>
|
|
1606
|
+
<xsl:text xml:space="preserve">public interface </xsl:text>
|
|
1607
|
+
<xsl:value-of select="@name"/>
|
|
1608
|
+
<xsl:if test="normalize-space(@inherits)">
|
|
1609
|
+
<xsl:text xml:space="preserve"> extends </xsl:text>
|
|
1610
|
+
<xsl:value-of select="@inherits"/>
|
|
1611
|
+
</xsl:if>
|
|
1612
|
+
<xsl:value-of select="$IDLindent0"/>
|
|
1613
|
+
<xsl:text>{</xsl:text>
|
|
1614
|
+
<xsl:apply-templates mode="javaInterfaces"/>
|
|
1615
|
+
<xsl:value-of select="$IDLindent0"/>
|
|
1616
|
+
<xsl:text xml:space="preserve">};
|
|
1617
|
+
</xsl:text>
|
|
1618
|
+
</pre></div>
|
|
1619
|
+
</xsl:template>
|
|
1620
|
+
|
|
1621
|
+
<xsl:template name="javaTranslateTypeName">
|
|
1622
|
+
<xsl:param name="targetType" select="normalize-space(@type)"/>
|
|
1623
|
+
<xsl:choose>
|
|
1624
|
+
<xsl:when test="$targetType='DOMString'">
|
|
1625
|
+
<xsl:text>String</xsl:text>
|
|
1626
|
+
</xsl:when>
|
|
1627
|
+
<xsl:when test="$targetType='unsigned long' or $targetType='long'">
|
|
1628
|
+
<xsl:text>int</xsl:text>
|
|
1629
|
+
</xsl:when>
|
|
1630
|
+
<xsl:otherwise>
|
|
1631
|
+
<xsl:value-of select="$targetType"/>
|
|
1632
|
+
</xsl:otherwise>
|
|
1633
|
+
</xsl:choose>
|
|
1634
|
+
</xsl:template>
|
|
1635
|
+
|
|
1636
|
+
<xsl:template name="javaTranslateProcName">
|
|
1637
|
+
<xsl:param name="whichMode" select="get"/>
|
|
1638
|
+
<xsl:param name="attribName" select="normalize-space(@name)"/>
|
|
1639
|
+
<xsl:choose>
|
|
1640
|
+
<xsl:when test="$whichMode='set'">
|
|
1641
|
+
<xsl:text>set</xsl:text>
|
|
1642
|
+
</xsl:when>
|
|
1643
|
+
<xsl:otherwise>
|
|
1644
|
+
<xsl:text>get</xsl:text>
|
|
1645
|
+
</xsl:otherwise>
|
|
1646
|
+
</xsl:choose>
|
|
1647
|
+
<xsl:value-of select="translate(substring($attribName,1,1),$lowerCaseString,$upperCaseString)"/>
|
|
1648
|
+
<xsl:value-of select="substring($attribName,2)"/>
|
|
1649
|
+
</xsl:template>
|
|
1650
|
+
|
|
1651
|
+
<xsl:template match="constant" mode="javaInterfaces">
|
|
1652
|
+
<xsl:value-of select="$IDLindent2"/><xsl:text xml:space="preserve">public static final </xsl:text>
|
|
1653
|
+
<xsl:variable name="javaTypeName">
|
|
1654
|
+
<xsl:call-template name="javaTranslateTypeName">
|
|
1655
|
+
<xsl:with-param name="targetType" select="@type"/>
|
|
1656
|
+
</xsl:call-template>
|
|
1657
|
+
</xsl:variable>
|
|
1658
|
+
<xsl:value-of select="$javaTypeName"/>
|
|
1659
|
+
<xsl:value-of select="substring(' ',string-length($javaTypeName)+1)"/>
|
|
1660
|
+
<xsl:value-of select="@name"/>
|
|
1661
|
+
<xsl:value-of select="substring(' ',string-length(@name)+1)"/>
|
|
1662
|
+
<xsl:text xml:space="preserve">= </xsl:text><xsl:value-of select="@value"/><xsl:text>;</xsl:text>
|
|
1663
|
+
</xsl:template>
|
|
1664
|
+
|
|
1665
|
+
<xsl:template match="attribute" mode="javaInterfaces">
|
|
1666
|
+
<xsl:value-of select="$IDLindent2"/><xsl:text xml:space="preserve">public </xsl:text>
|
|
1667
|
+
<xsl:variable name="javaTypeName">
|
|
1668
|
+
<xsl:call-template name="javaTranslateTypeName">
|
|
1669
|
+
<xsl:with-param name="targetType" select="@type"/>
|
|
1670
|
+
</xsl:call-template>
|
|
1671
|
+
</xsl:variable>
|
|
1672
|
+
<xsl:value-of select="$javaTypeName"/>
|
|
1673
|
+
<xsl:value-of select="substring(' ',string-length($javaTypeName)+1)"/>
|
|
1674
|
+
<xsl:text xml:space="preserve"> </xsl:text>
|
|
1675
|
+
<xsl:call-template name="javaTranslateProcName">
|
|
1676
|
+
<xsl:with-param name="attribName" select="@name"/>
|
|
1677
|
+
<xsl:with-param name="whichMode" select="get"/>
|
|
1678
|
+
</xsl:call-template>
|
|
1679
|
+
<xsl:text>()</xsl:text>
|
|
1680
|
+
<xsl:for-each select="getraises">
|
|
1681
|
+
<xsl:apply-templates select="."/>
|
|
1682
|
+
</xsl:for-each>
|
|
1683
|
+
<xsl:text>;</xsl:text>
|
|
1684
|
+
<xsl:if test="not(normalize-space(@readonly)='yes')">
|
|
1685
|
+
<xsl:value-of select="$IDLindent2"/><xsl:text>public void</xsl:text>
|
|
1686
|
+
<xsl:value-of select="substring(' ',string-length('void')+1)"/>
|
|
1687
|
+
<xsl:text xml:space="preserve"> </xsl:text>
|
|
1688
|
+
<xsl:call-template name="javaTranslateProcName">
|
|
1689
|
+
<xsl:with-param name="attribName" select="@name"/>
|
|
1690
|
+
<xsl:with-param name="whichMode">set</xsl:with-param>
|
|
1691
|
+
</xsl:call-template>
|
|
1692
|
+
<xsl:text>(</xsl:text>
|
|
1693
|
+
<xsl:value-of select="$javaTypeName"/>
|
|
1694
|
+
<xsl:text xml:space="preserve"> </xsl:text><xsl:value-of select="normalize-space(@name)"/>
|
|
1695
|
+
<xsl:text>)</xsl:text>
|
|
1696
|
+
<xsl:for-each select="setraises">
|
|
1697
|
+
<xsl:apply-templates select="." mode="javaInterfaces"/>
|
|
1698
|
+
</xsl:for-each>
|
|
1699
|
+
<xsl:text>;</xsl:text>
|
|
1700
|
+
</xsl:if>
|
|
1701
|
+
</xsl:template>
|
|
1702
|
+
|
|
1703
|
+
<xsl:template match="setraises|getraises|raises" mode="javaInterfaces">
|
|
1704
|
+
<xsl:if test="count(exception[normalize-space(@name)])">
|
|
1705
|
+
<xsl:value-of select="$javaRaisesIndent"/><xsl:text xml:space="preserve">throws </xsl:text>
|
|
1706
|
+
<xsl:for-each select="exception">
|
|
1707
|
+
<xsl:variable name="localExceptionName" select="normalize-space(@name)"/>
|
|
1708
|
+
<xsl:if test="$localExceptionName and not(preceding-sibling::exception[normalize-space(@name)=$localExceptionName])">
|
|
1709
|
+
<xsl:if test="preceding-sibling::exception[not(normalize-space(@name)=$localExceptionName)]">
|
|
1710
|
+
<xsl:text>,</xsl:text>
|
|
1711
|
+
</xsl:if>
|
|
1712
|
+
<xsl:value-of select="$localExceptionName"/>
|
|
1713
|
+
</xsl:if>
|
|
1714
|
+
</xsl:for-each>
|
|
1715
|
+
</xsl:if>
|
|
1716
|
+
</xsl:template>
|
|
1717
|
+
|
|
1718
|
+
<xsl:template match="method" mode="javaInterfaces">
|
|
1719
|
+
<xsl:value-of select="$IDLindent2"/><xsl:text xml:space="preserve">public </xsl:text>
|
|
1720
|
+
<xsl:variable name="javaTypeName">
|
|
1721
|
+
<xsl:call-template name="javaTranslateTypeName">
|
|
1722
|
+
<xsl:with-param name="targetType" select="returns/@type"/>
|
|
1723
|
+
</xsl:call-template>
|
|
1724
|
+
</xsl:variable>
|
|
1725
|
+
<xsl:value-of select="$javaTypeName"/>
|
|
1726
|
+
<xsl:value-of select="substring(' ',string-length($javaTypeName)+1)"/>
|
|
1727
|
+
<xsl:text xml:space="preserve"> </xsl:text><xsl:value-of select="@name"/><xsl:text>(</xsl:text>
|
|
1728
|
+
<xsl:apply-templates select="parameters" mode="javaInterfaces"/>
|
|
1729
|
+
<xsl:text>)</xsl:text>
|
|
1730
|
+
<xsl:apply-templates select="raises" mode="javaInterfaces"/>
|
|
1731
|
+
<xsl:text>;</xsl:text>
|
|
1732
|
+
</xsl:template>
|
|
1733
|
+
|
|
1734
|
+
<xsl:template match="parameters" mode="javaInterfaces">
|
|
1735
|
+
<xsl:variable name="localParent"><xsl:value-of select="parent::method/@name"/></xsl:variable>
|
|
1736
|
+
<xsl:variable name="localParamIndent"><xsl:value-of select="$IDLindent2"/>
|
|
1737
|
+
<xsl:text xml:space="preserve"> </xsl:text>
|
|
1738
|
+
<xsl:value-of select="substring(' ',1,string-length($localParent) + string-length('public ( '))"/>
|
|
1739
|
+
</xsl:variable>
|
|
1740
|
+
<xsl:for-each select="param[not(@diff='del')]">
|
|
1741
|
+
<xsl:if test="count(preceding-sibling::param)>0">
|
|
1742
|
+
<xsl:text>,</xsl:text>
|
|
1743
|
+
<xsl:value-of select="$localParamIndent"/>
|
|
1744
|
+
</xsl:if>
|
|
1745
|
+
<xsl:call-template name="javaTranslateTypeName"/>
|
|
1746
|
+
<xsl:text xml:space="preserve"> </xsl:text>
|
|
1747
|
+
<xsl:value-of select="./@name"/>
|
|
1748
|
+
</xsl:for-each>
|
|
1749
|
+
</xsl:template>
|
|
1750
|
+
|
|
1751
|
+
<xsl:template match="text()" mode="javaInterfaces">
|
|
1752
|
+
</xsl:template>
|
|
1753
|
+
|
|
1754
|
+
<xsl:template match="*" mode="javaInterfaces">
|
|
1755
|
+
<!-- <xsl:apply-templates mode="javaInterfaces"/> -->
|
|
1756
|
+
</xsl:template>
|
|
1757
|
+
|
|
1758
|
+
|
|
1759
|
+
<!-- ECMAScript Binding -->
|
|
1760
|
+
|
|
1761
|
+
<xsl:template match="div1[@id='mathml-dom']" mode="ecmaInterfaces">
|
|
1762
|
+
<div class="IDL-definition">
|
|
1763
|
+
<xsl:apply-templates mode="ecmaInterfaces" select=".//interface"/>
|
|
1764
|
+
</div>
|
|
1765
|
+
</xsl:template>
|
|
1766
|
+
|
|
1767
|
+
<xsl:template match="interface" mode="ecmaInterfaces">
|
|
1768
|
+
<xsl:if test="count(constant) > 0">
|
|
1769
|
+
<dl>
|
|
1770
|
+
<dt class="h3style"><!--<h3>--><strong>
|
|
1771
|
+
<xsl:text xml:space="preserve">Class </xsl:text>
|
|
1772
|
+
<xsl:value-of select="@name"/>
|
|
1773
|
+
</strong><!--</h3>--></dt>
|
|
1774
|
+
<dd><xsl:text xml:space="preserve">The </xsl:text>
|
|
1775
|
+
<strong><xsl:value-of select="@name"/></strong>
|
|
1776
|
+
<xsl:text xml:space="preserve"> class has the following constants:</xsl:text>
|
|
1777
|
+
<dl>
|
|
1778
|
+
<xsl:apply-templates select="constant" mode="ecmaInterfaces"/>
|
|
1779
|
+
</dl></dd>
|
|
1780
|
+
</dl>
|
|
1781
|
+
</xsl:if>
|
|
1782
|
+
<dl><dt class="h3style">
|
|
1783
|
+
<xsl:text xml:space="preserve">Object </xsl:text>
|
|
1784
|
+
<xsl:value-of select="@name"/>
|
|
1785
|
+
</dt>
|
|
1786
|
+
<xsl:if test="normalize-space(@inherits)">
|
|
1787
|
+
<dd>
|
|
1788
|
+
<strong>
|
|
1789
|
+
<xsl:value-of select="@name"/></strong>
|
|
1790
|
+
<xsl:text xml:space="preserve"> has all the properties and methods of </xsl:text>
|
|
1791
|
+
<strong><xsl:value-of select="@inherits"/></strong>
|
|
1792
|
+
<xsl:text xml:space="preserve"> as well as the properties and methods defined below.</xsl:text>
|
|
1793
|
+
</dd>
|
|
1794
|
+
</xsl:if>
|
|
1795
|
+
<xsl:if test="count(attribute) > 0">
|
|
1796
|
+
<dd>
|
|
1797
|
+
<dl><dt>
|
|
1798
|
+
<xsl:text xml:space="preserve">The </xsl:text>
|
|
1799
|
+
<strong><xsl:value-of select="@name"/></strong>
|
|
1800
|
+
<xsl:text xml:space="preserve"> object has the following properties:</xsl:text></dt>
|
|
1801
|
+
<xsl:apply-templates select="attribute" mode="ecmaInterfaces"/>
|
|
1802
|
+
</dl>
|
|
1803
|
+
</dd>
|
|
1804
|
+
</xsl:if>
|
|
1805
|
+
<xsl:if test="count(method) > 0">
|
|
1806
|
+
<dd>
|
|
1807
|
+
<dl><dt>
|
|
1808
|
+
<xsl:text xml:space="preserve">The </xsl:text>
|
|
1809
|
+
<strong><xsl:value-of select="@name"/></strong>
|
|
1810
|
+
<xsl:text xml:space="preserve"> object has the following methods:</xsl:text>
|
|
1811
|
+
</dt>
|
|
1812
|
+
<xsl:apply-templates select="method" mode="ecmaInterfaces"/>
|
|
1813
|
+
</dl>
|
|
1814
|
+
</dd>
|
|
1815
|
+
</xsl:if>
|
|
1816
|
+
</dl>
|
|
1817
|
+
</xsl:template>
|
|
1818
|
+
|
|
1819
|
+
<xsl:template match="constant" mode="ecmaInterfaces">
|
|
1820
|
+
<dd>
|
|
1821
|
+
<dl><dt>
|
|
1822
|
+
<strong><xsl:value-of select="parent::interface/@name"/>
|
|
1823
|
+
<xsl:text>.</xsl:text>
|
|
1824
|
+
<xsl:value-of select="@name"/></strong></dt>
|
|
1825
|
+
<dd>
|
|
1826
|
+
<xsl:text xml:space="preserve">This constant is of type </xsl:text>
|
|
1827
|
+
<xsl:value-of select="@type"/>
|
|
1828
|
+
<xsl:text xml:space="preserve"> and its value is </xsl:text>
|
|
1829
|
+
<xsl:value-of select="@value"/>
|
|
1830
|
+
<xsl:text>.</xsl:text>
|
|
1831
|
+
</dd>
|
|
1832
|
+
</dl>
|
|
1833
|
+
</dd>
|
|
1834
|
+
</xsl:template>
|
|
1835
|
+
|
|
1836
|
+
<xsl:template match="attribute" mode="ecmaInterfaces">
|
|
1837
|
+
<xsl:if test="not(@diff='del' and $show.diff.markup='0')">
|
|
1838
|
+
<dd>
|
|
1839
|
+
<xsl:if test="@diff and $show.diff.markup='1'">
|
|
1840
|
+
<xsl:attribute name="class">
|
|
1841
|
+
<xsl:text>diff-</xsl:text>
|
|
1842
|
+
<xsl:value-of select="@diff"/>
|
|
1843
|
+
</xsl:attribute>
|
|
1844
|
+
</xsl:if>
|
|
1845
|
+
<dl><dt>
|
|
1846
|
+
<strong><xsl:value-of select="@name"/></strong></dt>
|
|
1847
|
+
<dd>
|
|
1848
|
+
<xsl:text xml:space="preserve">This property is of type </xsl:text>
|
|
1849
|
+
<strong><xsl:value-of select="@type"/></strong>
|
|
1850
|
+
<xsl:text>.</xsl:text>
|
|
1851
|
+
</dd>
|
|
1852
|
+
</dl></dd>
|
|
1853
|
+
</xsl:if>
|
|
1854
|
+
</xsl:template>
|
|
1855
|
+
|
|
1856
|
+
<xsl:template match="method" mode="ecmaInterfaces">
|
|
1857
|
+
<dd>
|
|
1858
|
+
<dl><dt>
|
|
1859
|
+
<strong><xsl:value-of select="@name"/><xsl:text>(</xsl:text>
|
|
1860
|
+
<xsl:for-each select="parameters/param">
|
|
1861
|
+
<xsl:if test="count(preceding-sibling::param) > 0">
|
|
1862
|
+
<xsl:text>,</xsl:text>
|
|
1863
|
+
</xsl:if>
|
|
1864
|
+
<xsl:value-of select="@name"/>
|
|
1865
|
+
</xsl:for-each>
|
|
1866
|
+
<xsl:text>)</xsl:text></strong>
|
|
1867
|
+
</dt>
|
|
1868
|
+
<dd>
|
|
1869
|
+
<xsl:variable name="returnType" select="normalize-space(returns/@type)"/>
|
|
1870
|
+
<xsl:choose>
|
|
1871
|
+
<xsl:when test="not($returnType)">
|
|
1872
|
+
<xsl:text xml:space="preserve">This method returns a </xsl:text>
|
|
1873
|
+
<strong><xsl:text>void</xsl:text></strong>
|
|
1874
|
+
</xsl:when>
|
|
1875
|
+
<xsl:when test="contains('aeiou',substring($returnType,1,1))">
|
|
1876
|
+
<xsl:text xml:space="preserve">This method returns an </xsl:text>
|
|
1877
|
+
</xsl:when>
|
|
1878
|
+
<xsl:otherwise>
|
|
1879
|
+
<xsl:text xml:space="preserve">This method returns a </xsl:text>
|
|
1880
|
+
</xsl:otherwise>
|
|
1881
|
+
</xsl:choose>
|
|
1882
|
+
<strong><xsl:value-of select="$returnType"/><xsl:text>.</xsl:text></strong>
|
|
1883
|
+
<xsl:apply-templates select="parameters" mode="ecmaInterfaces"/>
|
|
1884
|
+
</dd></dl>
|
|
1885
|
+
</dd>
|
|
1886
|
+
</xsl:template>
|
|
1887
|
+
|
|
1888
|
+
<xsl:template match="parameters" mode="ecmaInterfaces">
|
|
1889
|
+
<xsl:for-each select="param">
|
|
1890
|
+
<xsl:text xml:space="preserve"> The </xsl:text>
|
|
1891
|
+
<strong><xsl:value-of select="./@name"/></strong>
|
|
1892
|
+
<xsl:text xml:space="preserve"> parameter is of type </xsl:text>
|
|
1893
|
+
<strong><xsl:value-of select="./@type"/></strong><xsl:text>.</xsl:text>
|
|
1894
|
+
</xsl:for-each>
|
|
1895
|
+
</xsl:template>
|
|
1896
|
+
|
|
1897
|
+
<xsl:template match="raises|setraises|getraises" mode="ecmaInterfaces">
|
|
1898
|
+
</xsl:template>
|
|
1899
|
+
|
|
1900
|
+
<xsl:template match="text()" mode="ecmaInterfaces">
|
|
1901
|
+
</xsl:template>
|
|
1902
|
+
|
|
1903
|
+
<xsl:template match="*" mode="ecmaInterfaces">
|
|
1904
|
+
<xsl:apply-templates mode="ecmaInterfaces"/>
|
|
1905
|
+
</xsl:template>
|
|
1906
|
+
|
|
1907
|
+
<!-- Generating DOM Inheritance Chart -->
|
|
1908
|
+
<xsl:template match="interface" mode="showInheritance">
|
|
1909
|
+
<xsl:variable name="thisName" select="normalize-space(@name)"/>
|
|
1910
|
+
<dd>
|
|
1911
|
+
<xsl:variable name="theReference">
|
|
1912
|
+
<xsl:choose>
|
|
1913
|
+
<xsl:when test="starts-with($thisName,'MathML')">
|
|
1914
|
+
<a>
|
|
1915
|
+
<xsl:attribute name="href">
|
|
1916
|
+
<xsl:if test="ancestor::div1|inform-div1[not(@id='mathml-dom')]">
|
|
1917
|
+
<xsl:value-of select="id('mathml-dom')/@role"/>
|
|
1918
|
+
<xsl:value-of select="$filename.extension"/>
|
|
1919
|
+
</xsl:if>
|
|
1920
|
+
<xsl:text>#dom.</xsl:text>
|
|
1921
|
+
<xsl:value-of select="substring-after($thisName,'MathML')"/>
|
|
1922
|
+
</xsl:attribute>
|
|
1923
|
+
<xsl:value-of select="$thisName"/>
|
|
1924
|
+
</a>
|
|
1925
|
+
</xsl:when>
|
|
1926
|
+
<xsl:otherwise>
|
|
1927
|
+
<xsl:value-of select="$thisName"/>
|
|
1928
|
+
</xsl:otherwise>
|
|
1929
|
+
</xsl:choose>
|
|
1930
|
+
<xsl:if test="contains(@inherits,',')">
|
|
1931
|
+
<xsl:text xml:space="preserve"> [also inherits from: </xsl:text>
|
|
1932
|
+
<xsl:call-template name="dom-type-inherits">
|
|
1933
|
+
<xsl:with-param name="typestring" select="normalize-space(substring-after(@inherits,','))" />
|
|
1934
|
+
</xsl:call-template>
|
|
1935
|
+
<xsl:text>]</xsl:text>
|
|
1936
|
+
</xsl:if>
|
|
1937
|
+
</xsl:variable>
|
|
1938
|
+
<xsl:choose>
|
|
1939
|
+
<xsl:when test="count(ancestor::div1//interface[normalize-space(@inherits)=$thisName or (contains(normalize-space(@inherits),',') and substring-before(normalize-space(@inherits),',')=$thisName)]) > 0">
|
|
1940
|
+
<dl><dt><xsl:text>---</xsl:text>
|
|
1941
|
+
<!-- <xsl:call-template name="dom-type"> -->
|
|
1942
|
+
<!-- <xsl:with-param name="type" select="$thisName"/> -->
|
|
1943
|
+
<!-- </xsl:call-template> -->
|
|
1944
|
+
<xsl:copy-of select="$theReference"/>
|
|
1945
|
+
</dt>
|
|
1946
|
+
<xsl:apply-templates select="ancestor::div1//interface[normalize-space(@inherits)=$thisName or (contains(normalize-space(@inherits),',') and substring-before(normalize-space(@inherits),',')=$thisName)]" mode="showInheritance"/>
|
|
1947
|
+
</dl>
|
|
1948
|
+
</xsl:when>
|
|
1949
|
+
<xsl:otherwise>
|
|
1950
|
+
<xsl:text>---</xsl:text>
|
|
1951
|
+
<xsl:copy-of select="$theReference"/>
|
|
1952
|
+
<!-- <xsl:call-template name="dom-type"> -->
|
|
1953
|
+
<!-- <xsl:with-param name="type" select="$thisName"/> -->
|
|
1954
|
+
<!-- </xsl:call-template> -->
|
|
1955
|
+
</xsl:otherwise>
|
|
1956
|
+
</xsl:choose>
|
|
1957
|
+
</dd>
|
|
1958
|
+
</xsl:template>
|
|
1959
|
+
|
|
1960
|
+
<xsl:template match="*" mode="showInheritance">
|
|
1961
|
+
</xsl:template>
|
|
1962
|
+
|
|
1963
|
+
<xsl:template match="text()" mode="showInheritance">
|
|
1964
|
+
</xsl:template>
|
|
1965
|
+
|
|
1966
|
+
|
|
1967
|
+
<!-- appendix c -->
|
|
1968
|
+
|
|
1969
|
+
<xsl:template mode="divnum" match="MMLdefinition">
|
|
1970
|
+
<xsl:number level="multiple"
|
|
1971
|
+
count="div1 | div2 | div3 | div4 | MMLdefinition |inform-div1"
|
|
1972
|
+
format="A.1.1.1 "/>
|
|
1973
|
+
</xsl:template>
|
|
1974
|
+
|
|
1975
|
+
<xsl:template match="MMLdefinition">
|
|
1976
|
+
<xsl:element name="h{5 -$slice.depth}">
|
|
1977
|
+
<xsl:call-template name="anchor"/>
|
|
1978
|
+
<xsl:number level="multiple" count="inform-div1|div1|div2|div3|div4|MMLdefinition" format="A.1.1.1 "/>
|
|
1979
|
+
MMLdefinition: <code><xsl:value-of select="name"/></code>
|
|
1980
|
+
</xsl:element>
|
|
1981
|
+
<dl>
|
|
1982
|
+
<xsl:apply-templates select="description"/>
|
|
1983
|
+
|
|
1984
|
+
<xsl:apply-templates select="classification"/>
|
|
1985
|
+
|
|
1986
|
+
<xsl:if test="MMLattribute">
|
|
1987
|
+
<dt>MMLattribute</dt>
|
|
1988
|
+
<dd><table border="1">
|
|
1989
|
+
<tr><th>Name</th><th>Value</th><th>Default</th></tr>
|
|
1990
|
+
<xsl:for-each select="MMLattribute">
|
|
1991
|
+
<tr><xsl:apply-templates/></tr>
|
|
1992
|
+
</xsl:for-each>
|
|
1993
|
+
</table>
|
|
1994
|
+
</dd>
|
|
1995
|
+
</xsl:if>
|
|
1996
|
+
|
|
1997
|
+
<xsl:if test="signature">
|
|
1998
|
+
<dt>Signature</dt>
|
|
1999
|
+
<dd>
|
|
2000
|
+
<xsl:apply-templates select="signature"/>
|
|
2001
|
+
</dd>
|
|
2002
|
+
</xsl:if>
|
|
2003
|
+
|
|
2004
|
+
|
|
2005
|
+
<xsl:apply-templates select="property|MMLexample"/>
|
|
2006
|
+
|
|
2007
|
+
</dl>
|
|
2008
|
+
|
|
2009
|
+
</xsl:template>
|
|
2010
|
+
|
|
2011
|
+
<xsl:template match="signature">
|
|
2012
|
+
<p><xsl:value-of select="."/></p>
|
|
2013
|
+
</xsl:template>
|
|
2014
|
+
|
|
2015
|
+
|
|
2016
|
+
<xsl:template match="MMLexample">
|
|
2017
|
+
<dt>Example</dt>
|
|
2018
|
+
<dd><xsl:apply-templates select="description"/><pre>
|
|
2019
|
+
<xsl:if test="@diff and $show.diff.markup='1'">
|
|
2020
|
+
<xsl:attribute name="class">
|
|
2021
|
+
<xsl:text>diff-</xsl:text>
|
|
2022
|
+
<xsl:value-of select="@diff"/>
|
|
2023
|
+
</xsl:attribute>
|
|
2024
|
+
</xsl:if>
|
|
2025
|
+
<xsl:apply-templates select="node()[not(self::description)]"/>
|
|
2026
|
+
</pre></dd>
|
|
2027
|
+
</xsl:template>
|
|
2028
|
+
|
|
2029
|
+
<xsl:template match="classification">
|
|
2030
|
+
<dt>Classification</dt>
|
|
2031
|
+
<dd><xsl:apply-templates/></dd>
|
|
2032
|
+
</xsl:template>
|
|
2033
|
+
|
|
2034
|
+
|
|
2035
|
+
<xsl:template match="attvalue|attname|attdefault">
|
|
2036
|
+
<td><xsl:apply-templates/></td>
|
|
2037
|
+
</xsl:template>
|
|
2038
|
+
|
|
2039
|
+
|
|
2040
|
+
<xsl:template match="property">
|
|
2041
|
+
<dt>Property</dt>
|
|
2042
|
+
<dd>
|
|
2043
|
+
<xsl:apply-templates select="description"/>
|
|
2044
|
+
<pre>
|
|
2045
|
+
<xsl:if test="@diff and $show.diff.markup='1'">
|
|
2046
|
+
<xsl:attribute name="class">
|
|
2047
|
+
<xsl:text>diff-</xsl:text>
|
|
2048
|
+
<xsl:value-of select="@diff"/>
|
|
2049
|
+
</xsl:attribute>
|
|
2050
|
+
</xsl:if>
|
|
2051
|
+
<xsl:apply-templates select="node()[not(self::description)]"/>
|
|
2052
|
+
</pre></dd>
|
|
2053
|
+
</xsl:template>
|
|
2054
|
+
|
|
2055
|
+
<xsl:template match="description">
|
|
2056
|
+
<xsl:apply-templates/>
|
|
2057
|
+
</xsl:template>
|
|
2058
|
+
|
|
2059
|
+
|
|
2060
|
+
<xsl:template match="MMLdefinition/name"/>
|
|
2061
|
+
|
|
2062
|
+
|
|
2063
|
+
<xsl:template match="MMLdefinition/functorclass"/>
|
|
2064
|
+
|
|
2065
|
+
|
|
2066
|
+
|
|
2067
|
+
<xsl:template match="MMLdefinition/description">
|
|
2068
|
+
<dt>Description</dt>
|
|
2069
|
+
<dd><xsl:apply-templates/>
|
|
2070
|
+
<p>See also
|
|
2071
|
+
<xsl:variable name="x"
|
|
2072
|
+
select="id(concat('contm_',normalize-space(preceding-sibling::name)))"/>
|
|
2073
|
+
<xsl:choose>
|
|
2074
|
+
<xsl:when test="$x">
|
|
2075
|
+
<xsl:for-each select="$x">
|
|
2076
|
+
<a>
|
|
2077
|
+
<xsl:attribute name="href">
|
|
2078
|
+
<xsl:call-template name="href.target">
|
|
2079
|
+
<xsl:with-param name="target" select="."/>
|
|
2080
|
+
</xsl:call-template>
|
|
2081
|
+
</xsl:attribute>
|
|
2082
|
+
<b>
|
|
2083
|
+
<xsl:apply-templates select="." mode="divnum"/>
|
|
2084
|
+
<xsl:apply-templates select="head" mode="text"/>
|
|
2085
|
+
</b>
|
|
2086
|
+
</a>
|
|
2087
|
+
</xsl:for-each>
|
|
2088
|
+
</xsl:when>
|
|
2089
|
+
<xsl:otherwise>
|
|
2090
|
+
<xsl:for-each select="id('contm_trig')">
|
|
2091
|
+
<a>
|
|
2092
|
+
<xsl:attribute name="href">
|
|
2093
|
+
<xsl:call-template name="href.target">
|
|
2094
|
+
<xsl:with-param name="target" select="."/>
|
|
2095
|
+
</xsl:call-template>
|
|
2096
|
+
</xsl:attribute>
|
|
2097
|
+
<b>
|
|
2098
|
+
<xsl:apply-templates select="." mode="divnum"/>
|
|
2099
|
+
<xsl:apply-templates select="head" mode="text"/>
|
|
2100
|
+
</b>
|
|
2101
|
+
</a>
|
|
2102
|
+
</xsl:for-each>
|
|
2103
|
+
</xsl:otherwise>
|
|
2104
|
+
</xsl:choose>.</p>
|
|
2105
|
+
</dd>
|
|
2106
|
+
</xsl:template>
|
|
2107
|
+
|
|
2108
|
+
|
|
2109
|
+
<!--
|
|
2110
|
+
MathML Customistations
|
|
2111
|
+
|
|
2112
|
+
templates below this point are handle specific features or stylistic
|
|
2113
|
+
requirements of the MathMl specification.
|
|
2114
|
+
-->
|
|
2115
|
+
|
|
2116
|
+
|
|
2117
|
+
<!-- handle both authors and editors (marked up in the same authlist,
|
|
2118
|
+
but distinguished by role="editor" attribute -->
|
|
2119
|
+
<!-- as requested by Patrick, list editors twice, as they are also authors -->
|
|
2120
|
+
|
|
2121
|
+
<xsl:template match="authlist">
|
|
2122
|
+
<dt>
|
|
2123
|
+
<xsl:text>Editor</xsl:text>
|
|
2124
|
+
<xsl:if test="count(author[@role='editor']) > 1">s</xsl:if>:<xsl:text/>
|
|
2125
|
+
</dt>
|
|
2126
|
+
<xsl:apply-templates mode= "editor" select="author[@role='editor']"/>
|
|
2127
|
+
<xsl:if test="author[not(@role='@editor')]">
|
|
2128
|
+
<dt>
|
|
2129
|
+
<xsl:text>Principal Authors:</xsl:text>
|
|
2130
|
+
</dt>
|
|
2131
|
+
<!--<dd><xsl:apply-templates select="author[not(@role='editor')]"/></dd>-->
|
|
2132
|
+
<dd><xsl:apply-templates select="author"/></dd>
|
|
2133
|
+
</xsl:if>
|
|
2134
|
+
</xsl:template>
|
|
2135
|
+
|
|
2136
|
+
<xsl:template mode= "editor" match="author[@role='editor']">
|
|
2137
|
+
<dd><xsl:apply-templates/></dd>
|
|
2138
|
+
</xsl:template>
|
|
2139
|
+
|
|
2140
|
+
<xsl:template match="author">
|
|
2141
|
+
<xsl:value-of select="name"/>
|
|
2142
|
+
<xsl:if test="position() != last()">, </xsl:if>
|
|
2143
|
+
</xsl:template>
|
|
2144
|
+
|
|
2145
|
+
<xsl:template match="author[@diff]" priority="1">
|
|
2146
|
+
<xsl:choose>
|
|
2147
|
+
<xsl:when test="@diff and $show.diff.markup='1'">
|
|
2148
|
+
<span class="diff-{ancestor-or-self::*/@diff}">
|
|
2149
|
+
<xsl:value-of select="name"/>
|
|
2150
|
+
<xsl:if test="position() != last()">, </xsl:if>
|
|
2151
|
+
</span>
|
|
2152
|
+
</xsl:when>
|
|
2153
|
+
<xsl:when test="@diff='del' and $show.diff.markup='0'">
|
|
2154
|
+
<!-- suppressed -->
|
|
2155
|
+
</xsl:when>
|
|
2156
|
+
<xsl:otherwise>
|
|
2157
|
+
<xsl:value-of select="name"/>
|
|
2158
|
+
<xsl:if test="position() != last()">, </xsl:if>
|
|
2159
|
+
</xsl:otherwise>
|
|
2160
|
+
</xsl:choose>
|
|
2161
|
+
</xsl:template>
|
|
2162
|
+
|
|
2163
|
+
|
|
2164
|
+
<xsl:template match="latestloc[@role='rec']">
|
|
2165
|
+
<dt>Latest MathML Recommendation:</dt>
|
|
2166
|
+
<dd>
|
|
2167
|
+
<xsl:apply-templates/>
|
|
2168
|
+
</dd>
|
|
2169
|
+
</xsl:template>
|
|
2170
|
+
|
|
2171
|
+
<xsl:template match="latestloc">
|
|
2172
|
+
<dt>Latest MathML 2 version:</dt>
|
|
2173
|
+
<dd>
|
|
2174
|
+
<xsl:apply-templates/>
|
|
2175
|
+
</dd>
|
|
2176
|
+
</xsl:template>
|
|
2177
|
+
|
|
2178
|
+
<!-- errata linking -->
|
|
2179
|
+
<!-- add the apply-templates errataloc here rather than the main
|
|
2180
|
+
header template as it's smaller... -->
|
|
2181
|
+
|
|
2182
|
+
<xsl:template match="altlocs">
|
|
2183
|
+
<xsl:apply-templates select="../errataloc"/>
|
|
2184
|
+
<p>
|
|
2185
|
+
<xsl:text>In addition to the </xsl:text>
|
|
2186
|
+
<a href="overview.html">HTML</a>
|
|
2187
|
+
<xsl:text> version, </xsl:text>
|
|
2188
|
+
<xsl:text>this document is also available </xsl:text>
|
|
2189
|
+
<xsl:text>in these non-normative formats: </xsl:text>
|
|
2190
|
+
<xsl:for-each select="loc">
|
|
2191
|
+
<xsl:if test="position() > 1">
|
|
2192
|
+
<xsl:if test="last() > 2">
|
|
2193
|
+
<xsl:text>, </xsl:text>
|
|
2194
|
+
</xsl:if>
|
|
2195
|
+
<xsl:if test="last() = 2">
|
|
2196
|
+
<xsl:text> </xsl:text>
|
|
2197
|
+
</xsl:if>
|
|
2198
|
+
</xsl:if>
|
|
2199
|
+
<xsl:if test="position() = last() and position() > 1">and </xsl:if>
|
|
2200
|
+
<a href="{@href}"><xsl:apply-templates/></a>
|
|
2201
|
+
</xsl:for-each>
|
|
2202
|
+
<xsl:text>.</xsl:text>
|
|
2203
|
+
</p>
|
|
2204
|
+
<xsl:apply-templates select="../translationloc"/>
|
|
2205
|
+
</xsl:template>
|
|
2206
|
+
|
|
2207
|
+
|
|
2208
|
+
|
|
2209
|
+
<xsl:template match="errataloc">
|
|
2210
|
+
<p>Please refer to the <a href="{loc/@href}"><strong>errata</strong></a>
|
|
2211
|
+
for this document, which may include some normative corrections.</p>
|
|
2212
|
+
</xsl:template>
|
|
2213
|
+
|
|
2214
|
+
<xsl:template match="translationloc">
|
|
2215
|
+
<p>See also <a href="{loc/@href}"><strong>translations</strong></a>.</p>
|
|
2216
|
+
</xsl:template>
|
|
2217
|
+
|
|
2218
|
+
<!-- convert tr in table head to th -->
|
|
2219
|
+
<xsl:template match="thead/tr/td">
|
|
2220
|
+
<th>
|
|
2221
|
+
<xsl:copy-of select="@bgcolor|@rowspan|@colspan|@align|@valign"/>
|
|
2222
|
+
<xsl:choose>
|
|
2223
|
+
<xsl:when test="normalize-space(.)=''"> </xsl:when>
|
|
2224
|
+
<xsl:otherwise>
|
|
2225
|
+
<xsl:apply-templates/>
|
|
2226
|
+
</xsl:otherwise>
|
|
2227
|
+
</xsl:choose>
|
|
2228
|
+
</th>
|
|
2229
|
+
</xsl:template>
|
|
2230
|
+
|
|
2231
|
+
<!-- zap _ in ids -->
|
|
2232
|
+
<xsl:template match="table">
|
|
2233
|
+
<table>
|
|
2234
|
+
<!-- Wait: some of these aren't HTML attributes after all... -->
|
|
2235
|
+
<xsl:copy-of select="@*[local-name(.) != 'diff']"/>
|
|
2236
|
+
<xsl:if test="@id">
|
|
2237
|
+
<xsl:attribute name="id"><xsl:value-of
|
|
2238
|
+
select="translate(@id,'_','.')"/></xsl:attribute>
|
|
2239
|
+
</xsl:if>
|
|
2240
|
+
<xsl:apply-templates/>
|
|
2241
|
+
|
|
2242
|
+
<xsl:if test=".//footnote">
|
|
2243
|
+
<tbody>
|
|
2244
|
+
<tr>
|
|
2245
|
+
<td>
|
|
2246
|
+
<xsl:apply-templates select=".//footnote" mode="table.notes"/>
|
|
2247
|
+
</td>
|
|
2248
|
+
</tr>
|
|
2249
|
+
</tbody>
|
|
2250
|
+
</xsl:if>
|
|
2251
|
+
</table>
|
|
2252
|
+
</xsl:template>
|
|
2253
|
+
|
|
2254
|
+
|
|
2255
|
+
<!-- restore the navigation bars to more like the old style -->
|
|
2256
|
+
|
|
2257
|
+
|
|
2258
|
+
<xsl:template name="navigation.top">
|
|
2259
|
+
<xsl:param name="prev" select="''"/>
|
|
2260
|
+
<xsl:param name="next" select="''"/>
|
|
2261
|
+
|
|
2262
|
+
<xsl:comment> TOP NAVIGATION BAR </xsl:comment>
|
|
2263
|
+
<div class="minitoc">
|
|
2264
|
+
|
|
2265
|
+
Overview: <a href="{$front.filename.base}{$filename.extension}"><xsl:value-of select="/spec/header/title"/></a><br/>
|
|
2266
|
+
<xsl:if test="$prev">
|
|
2267
|
+
Previous: <xsl:apply-templates mode="divnum" select="$prev"/>
|
|
2268
|
+
<a>
|
|
2269
|
+
<xsl:attribute name="href">
|
|
2270
|
+
<xsl:call-template name="href.target">
|
|
2271
|
+
<xsl:with-param name="target" select="$prev"/>
|
|
2272
|
+
</xsl:call-template>
|
|
2273
|
+
</xsl:attribute>
|
|
2274
|
+
<xsl:apply-templates select="$prev/head/node()"/>
|
|
2275
|
+
</a>
|
|
2276
|
+
<br/>
|
|
2277
|
+
</xsl:if>
|
|
2278
|
+
<xsl:if test="$next">
|
|
2279
|
+
Next: <xsl:apply-templates mode="divnum" select="$next"/>
|
|
2280
|
+
<a>
|
|
2281
|
+
<xsl:attribute name="href">
|
|
2282
|
+
<xsl:call-template name="href.target">
|
|
2283
|
+
<xsl:with-param name="target" select="$next"/>
|
|
2284
|
+
</xsl:call-template>
|
|
2285
|
+
</xsl:attribute>
|
|
2286
|
+
<xsl:apply-templates select="$next/head/node()"/>
|
|
2287
|
+
</a>
|
|
2288
|
+
<br/>
|
|
2289
|
+
</xsl:if>
|
|
2290
|
+
<br/>
|
|
2291
|
+
<xsl:apply-templates mode="toc" select=".">
|
|
2292
|
+
<xsl:with-param name="just.filename" select="'0'"/>
|
|
2293
|
+
<xsl:with-param name="toc.level" select="4"/>
|
|
2294
|
+
</xsl:apply-templates>
|
|
2295
|
+
</div>
|
|
2296
|
+
</xsl:template>
|
|
2297
|
+
|
|
2298
|
+
|
|
2299
|
+
<xsl:template name="navigation.bottom">
|
|
2300
|
+
<xsl:param name="prev" select="''"/>
|
|
2301
|
+
<xsl:param name="next" select="''"/>
|
|
2302
|
+
|
|
2303
|
+
<div class="minitoc">
|
|
2304
|
+
|
|
2305
|
+
Overview: <a href="{$front.filename.base}{$filename.extension}"><xsl:value-of select="/spec/header/title"/></a><br/>
|
|
2306
|
+
<xsl:for-each select="$prev">
|
|
2307
|
+
Previous: <xsl:choose>
|
|
2308
|
+
<xsl:when test="ancestor::body">
|
|
2309
|
+
<xsl:number format="1.1 " level="multiple" count="div1|div2|div3|div4|div5"/>
|
|
2310
|
+
</xsl:when>
|
|
2311
|
+
<xsl:when test="ancestor::back">
|
|
2312
|
+
<xsl:number format="A.1 " level="multiple" count="div1|inform-div1|div2|div3|div4|div5"/>
|
|
2313
|
+
</xsl:when>
|
|
2314
|
+
</xsl:choose>
|
|
2315
|
+
<a>
|
|
2316
|
+
<xsl:attribute name="href">
|
|
2317
|
+
<xsl:call-template name="href.target">
|
|
2318
|
+
<xsl:with-param name="target" select="."/>
|
|
2319
|
+
<xsl:with-param name="just.filename" select="1"/>
|
|
2320
|
+
</xsl:call-template>
|
|
2321
|
+
</xsl:attribute>
|
|
2322
|
+
<xsl:apply-templates select="head/node()"/>
|
|
2323
|
+
</a>
|
|
2324
|
+
<br/>
|
|
2325
|
+
</xsl:for-each>
|
|
2326
|
+
<xsl:for-each select="$next">
|
|
2327
|
+
Next: <xsl:choose>
|
|
2328
|
+
<xsl:when test="ancestor::body">
|
|
2329
|
+
<xsl:number format="1.1 " level="multiple" count="div1|div2|div3|div4|div5"/>
|
|
2330
|
+
</xsl:when>
|
|
2331
|
+
<xsl:when test="ancestor::back">
|
|
2332
|
+
<xsl:number format="A.1 " level="multiple" count="div1|inform-div1|div2|div3|div4|div5"/>
|
|
2333
|
+
</xsl:when>
|
|
2334
|
+
</xsl:choose>
|
|
2335
|
+
|
|
2336
|
+
<a>
|
|
2337
|
+
<xsl:attribute name="href">
|
|
2338
|
+
<xsl:call-template name="href.target">
|
|
2339
|
+
<xsl:with-param name="target" select="."/>
|
|
2340
|
+
<xsl:with-param name="just.filename" select="1"/>
|
|
2341
|
+
</xsl:call-template>
|
|
2342
|
+
</xsl:attribute>
|
|
2343
|
+
<xsl:apply-templates select="head/node()"/>
|
|
2344
|
+
</a>
|
|
2345
|
+
</xsl:for-each>
|
|
2346
|
+
</div>
|
|
2347
|
+
</xsl:template>
|
|
2348
|
+
|
|
2349
|
+
<!-- eg roles -->
|
|
2350
|
+
|
|
2351
|
+
<xsl:template match="eg">
|
|
2352
|
+
<xsl:choose>
|
|
2353
|
+
<xsl:when test="@role">
|
|
2354
|
+
<xsl:choose>
|
|
2355
|
+
<xsl:when test="@role='mathml-error'">
|
|
2356
|
+
<pre class='error'>
|
|
2357
|
+
<xsl:apply-templates/>
|
|
2358
|
+
</pre>
|
|
2359
|
+
</xsl:when>
|
|
2360
|
+
<xsl:when test="@role='text'">
|
|
2361
|
+
<blockquote>
|
|
2362
|
+
<p><xsl:apply-templates/></p>
|
|
2363
|
+
</blockquote>
|
|
2364
|
+
</xsl:when>
|
|
2365
|
+
<xsl:otherwise>
|
|
2366
|
+
<pre>
|
|
2367
|
+
<xsl:apply-templates/>
|
|
2368
|
+
</pre>
|
|
2369
|
+
</xsl:otherwise>
|
|
2370
|
+
</xsl:choose>
|
|
2371
|
+
</xsl:when>
|
|
2372
|
+
<xsl:otherwise>
|
|
2373
|
+
<pre>
|
|
2374
|
+
<xsl:apply-templates/>
|
|
2375
|
+
</pre>
|
|
2376
|
+
</xsl:otherwise>
|
|
2377
|
+
</xsl:choose>
|
|
2378
|
+
</xsl:template>
|
|
2379
|
+
|
|
2380
|
+
<!-- kw role -->
|
|
2381
|
+
|
|
2382
|
+
<xsl:template match="kw">
|
|
2383
|
+
<xsl:choose>
|
|
2384
|
+
<xsl:when test="@role">
|
|
2385
|
+
<xsl:choose>
|
|
2386
|
+
<xsl:when test="@role='entity'">
|
|
2387
|
+
<code>&<xsl:apply-templates/>;</code>
|
|
2388
|
+
</xsl:when>
|
|
2389
|
+
<xsl:otherwise>
|
|
2390
|
+
<xsl:message>unkown role <xsl:value-of select="@role"/> on kw</xsl:message>
|
|
2391
|
+
<code class="error"><xsl:apply-templates/></code>
|
|
2392
|
+
</xsl:otherwise>
|
|
2393
|
+
</xsl:choose>
|
|
2394
|
+
</xsl:when>
|
|
2395
|
+
<xsl:otherwise>
|
|
2396
|
+
<b><xsl:apply-templates/></b>
|
|
2397
|
+
</xsl:otherwise>
|
|
2398
|
+
</xsl:choose>
|
|
2399
|
+
</xsl:template>
|
|
2400
|
+
|
|
2401
|
+
|
|
2402
|
+
<xsl:template match="el">
|
|
2403
|
+
<xsl:choose>
|
|
2404
|
+
<xsl:when test="@role">
|
|
2405
|
+
<xsl:choose>
|
|
2406
|
+
<xsl:when test="@role='starttag'">
|
|
2407
|
+
<code><<xsl:apply-templates/>></code>
|
|
2408
|
+
</xsl:when>
|
|
2409
|
+
<xsl:when test="@role='endtag'">
|
|
2410
|
+
<code></<xsl:apply-templates/>></code>
|
|
2411
|
+
</xsl:when>
|
|
2412
|
+
<xsl:when test="@role='emptytag'">
|
|
2413
|
+
<code><<xsl:apply-templates/>/></code>
|
|
2414
|
+
</xsl:when>
|
|
2415
|
+
<xsl:otherwise>
|
|
2416
|
+
<xsl:message>unkown role <xsl:value-of select="@role"/> on el</xsl:message>
|
|
2417
|
+
<code class="error"><xsl:apply-templates/></code>
|
|
2418
|
+
</xsl:otherwise>
|
|
2419
|
+
</xsl:choose>
|
|
2420
|
+
</xsl:when>
|
|
2421
|
+
<xsl:otherwise>
|
|
2422
|
+
<code><xsl:apply-templates/></code>
|
|
2423
|
+
</xsl:otherwise>
|
|
2424
|
+
</xsl:choose>
|
|
2425
|
+
</xsl:template>
|
|
2426
|
+
|
|
2427
|
+
<xsl:template match="tr[@diff]|td[@diff]" priority="662">
|
|
2428
|
+
<xsl:if test="not(@diff='del' and $show.diff.markup='0')">
|
|
2429
|
+
<xsl:element name="{local-name()}">
|
|
2430
|
+
<xsl:copy-of select="@*[local-name(.) != 'diff']"/>
|
|
2431
|
+
<xsl:if test="$show.diff.markup='1'">
|
|
2432
|
+
<xsl:attribute name="class">diff-<xsl:value-of select="@diff"/></xsl:attribute>
|
|
2433
|
+
</xsl:if>
|
|
2434
|
+
<xsl:apply-templates/>
|
|
2435
|
+
</xsl:element>
|
|
2436
|
+
</xsl:if>
|
|
2437
|
+
</xsl:template>
|
|
2438
|
+
|
|
2439
|
+
<!-- don't put [Definition ... ] around termdef elements-->
|
|
2440
|
+
<xsl:template match="termdef">
|
|
2441
|
+
<a name="{@id}" id="{@id}"></a>
|
|
2442
|
+
<xsl:apply-templates/>
|
|
2443
|
+
</xsl:template>
|
|
2444
|
+
|
|
2445
|
+
|
|
2446
|
+
<!-- anchor phrases if they have an id (used in appendix a) -->
|
|
2447
|
+
<xsl:template match="phrase">
|
|
2448
|
+
<xsl:call-template name="anchor"/>
|
|
2449
|
+
<xsl:apply-templates/>
|
|
2450
|
+
</xsl:template>
|
|
2451
|
+
|
|
2452
|
+
<!-- mathml CSS -->
|
|
2453
|
+
|
|
2454
|
+
<xsl:variable name="additional.css">
|
|
2455
|
+
.error { color: red }
|
|
2456
|
+
.minitoc { border-style: solid;
|
|
2457
|
+
border-color: #0050B2;
|
|
2458
|
+
border-width: 1px ;
|
|
2459
|
+
padding: 0.3em; }
|
|
2460
|
+
.attention { border-style: solid;
|
|
2461
|
+
border-width: 1px ;
|
|
2462
|
+
color: #5D0091;
|
|
2463
|
+
background: #F9F5DE;
|
|
2464
|
+
border-color: red;
|
|
2465
|
+
margin-left: 1em;
|
|
2466
|
+
margin-right: 1em;
|
|
2467
|
+
margin-top: 0.25em;
|
|
2468
|
+
margin-bottom: 0.25em; }
|
|
2469
|
+
|
|
2470
|
+
.attribute-Name { background: #F9F5C0; }
|
|
2471
|
+
.method-Name { background: #C0C0F9; }
|
|
2472
|
+
.IDL-definition { border-style: solid;
|
|
2473
|
+
border-width: 1px ;
|
|
2474
|
+
color: #001000;
|
|
2475
|
+
background: #E0FFE0;
|
|
2476
|
+
border-color: #206020;
|
|
2477
|
+
margin-left: 1em;
|
|
2478
|
+
margin-right: 1em;
|
|
2479
|
+
margin-top: 0.25em;
|
|
2480
|
+
margin-bottom: 0.25em; }
|
|
2481
|
+
.baseline {vertical-align: baseline}
|
|
2482
|
+
|
|
2483
|
+
#eqnoc1 {width: 10%}
|
|
2484
|
+
#eqnoc2 {width: 80%; text-align: center; }
|
|
2485
|
+
#eqnoc3 {width: 10%; text-align: right; }
|
|
2486
|
+
|
|
2487
|
+
div.div1 {margin-bottom: 1em;}
|
|
2488
|
+
|
|
2489
|
+
.h3style {
|
|
2490
|
+
text-align: left;
|
|
2491
|
+
font-family: sans-serif;
|
|
2492
|
+
font-weight: normal;
|
|
2493
|
+
color: #0050B2;
|
|
2494
|
+
font-size: 125%;
|
|
2495
|
+
}
|
|
2496
|
+
|
|
2497
|
+
h4 { text-align: left;
|
|
2498
|
+
font-family: sans-serif;
|
|
2499
|
+
font-weight: normal;
|
|
2500
|
+
color: #0050B2; }
|
|
2501
|
+
h5 { text-align: left;
|
|
2502
|
+
font-family: sans-serif;
|
|
2503
|
+
font-weight: bold;
|
|
2504
|
+
color: #0050B2; }
|
|
2505
|
+
|
|
2506
|
+
th {background: #E0FFE0;}
|
|
2507
|
+
|
|
2508
|
+
p, blockquote, h4 { font-family: sans-serif; }
|
|
2509
|
+
dt, dd, dl, ul, li { font-family: sans-serif; }
|
|
2510
|
+
pre, code { font-family: monospace }
|
|
2511
|
+
|
|
2512
|
+
|
|
2513
|
+
td.mathml-render {
|
|
2514
|
+
font-family: serif;
|
|
2515
|
+
font-size: 130%;
|
|
2516
|
+
border: solid 4px green;
|
|
2517
|
+
padding-left: 1em;
|
|
2518
|
+
padding-right: 1em;
|
|
2519
|
+
}
|
|
2520
|
+
|
|
2521
|
+
</xsl:variable>
|
|
2522
|
+
|
|
2523
|
+
<xsl:template match="blist">
|
|
2524
|
+
<dl>
|
|
2525
|
+
<xsl:apply-templates>
|
|
2526
|
+
<xsl:sort select="@id"/>
|
|
2527
|
+
</xsl:apply-templates>
|
|
2528
|
+
</dl>
|
|
2529
|
+
</xsl:template>
|
|
2530
|
+
|
|
2531
|
+
</xsl:stylesheet>
|