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,40 @@
|
|
|
1
|
+
|
|
2
|
+
The sources for the MathML specification
|
|
3
|
+
the file run in this directory is a bash shell script
|
|
4
|
+
which details the commands required to generate the MathML
|
|
5
|
+
specificaton. It does not use any advanced bash features and
|
|
6
|
+
could be easily modified to other environments such as the
|
|
7
|
+
windows command line.
|
|
8
|
+
|
|
9
|
+
It requires:
|
|
10
|
+
|
|
11
|
+
An XML validator
|
|
12
|
+
rxp is used in the script
|
|
13
|
+
this is not used for production but just to check the input
|
|
14
|
+
and generated output is valid.
|
|
15
|
+
|
|
16
|
+
An SGML Parser
|
|
17
|
+
nsgmls is used in the script.
|
|
18
|
+
Again this is not used for production, but just to check that all
|
|
19
|
+
generated HTML is valid.
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
The unicode.xml and its dtd, charlist.dtd, available from
|
|
23
|
+
http://www.w3.org/Math/characters
|
|
24
|
+
These are used as the source for the character tables in chapter 6.
|
|
25
|
+
In addition, to generate the diff-marked version of byalpha.html
|
|
26
|
+
showing differences from the MathML 2.0 rec, you will need the version
|
|
27
|
+
of unicode.xml distributed in the XML source zip file linked from that
|
|
28
|
+
recommendation.
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
An XSLT system.
|
|
32
|
+
The free java implementation saxon is used in the script.
|
|
33
|
+
|
|
34
|
+
pdflatex to generate the PDF versions of the specification.
|
|
35
|
+
The documents use the rapport3 LaTeX class file which should be part
|
|
36
|
+
of most TeX distributions but is available from TeX archives as part of
|
|
37
|
+
the ntgclass distribution. It also uses several commonly available
|
|
38
|
+
package files, hyperref, url,ae,pslatex.
|
|
39
|
+
|
|
40
|
+
|
|
@@ -0,0 +1,296 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
SOURCE=xml
|
|
4
|
+
HSTYLE=style/html
|
|
5
|
+
PSTYLE=style/pdf
|
|
6
|
+
W3CMATH=../..
|
|
7
|
+
|
|
8
|
+
# echo validate source
|
|
9
|
+
# rxp -sxV $SOURCE/mathml-spec.xml
|
|
10
|
+
# echo make html version
|
|
11
|
+
#
|
|
12
|
+
# saxon $SOURCE/mathml-spec.xml $HSTYLE/mmldiff.xsl show.diff.markup=0
|
|
13
|
+
#
|
|
14
|
+
# echo make diff marked html version
|
|
15
|
+
# saxon ../spec/xml/mathml-spec.xml $HSTYLE/mmldiff.xsl
|
|
16
|
+
# exit
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
echo validate sources
|
|
20
|
+
rxp -sxV $SOURCE/mathml-spec.xml
|
|
21
|
+
|
|
22
|
+
echo ""
|
|
23
|
+
echo ""
|
|
24
|
+
echo make standard html version
|
|
25
|
+
saxon $SOURCE/mathml-spec.xml $HSTYLE/mmldiff.xsl show.diff.markup=0
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
echo make diff marked html version
|
|
29
|
+
saxon ../spec/xml/mathml-spec.xml $HSTYLE/mmldiff.xsl
|
|
30
|
+
|
|
31
|
+
echo make xhtml stylesheets
|
|
32
|
+
echo " " mmldiff
|
|
33
|
+
saxon -o $HSTYLE/xmmldiff.xsl $HSTYLE/mmldiff.xsl $HSTYLE/html2xhtml.xsl system-dtd=mathml.dtd stylesheet.pi="/Math/XSL/mathml.xsl"
|
|
34
|
+
echo " " mmlspec
|
|
35
|
+
saxon -o $HSTYLE/xmmlspec.xsl $HSTYLE/mmlspec.xsl $HSTYLE/html2xhtml.xsl system-dtd=mathml.dtd stylesheet.pi="/Math/XSL/mathml.xsl"
|
|
36
|
+
echo " " slices
|
|
37
|
+
saxon -o $HSTYLE/xslices.xsl $HSTYLE/slices.xsl $HSTYLE/html2xhtml.xsl system-dtd=mathml.dtd
|
|
38
|
+
echo " " slices-common
|
|
39
|
+
saxon -o $HSTYLE/xslices-common.xsl $HSTYLE/slices-common.xsl $HSTYLE/html2xhtml.xsl system-dtd=mathml.dtd
|
|
40
|
+
echo " " xmlspec
|
|
41
|
+
saxon -o $HSTYLE/xxmlspec.xsl $HSTYLE/xmlspec.xsl $HSTYLE/html2xhtml.xsl system-dtd=mathml.dtd
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
echo make xhtml version
|
|
45
|
+
saxon $SOURCE/mathml-spec.xml $HSTYLE/mathmlx.xsl
|
|
46
|
+
|
|
47
|
+
#echo ""
|
|
48
|
+
#echo ""
|
|
49
|
+
#echo Chapter 6 Tables
|
|
50
|
+
#saxon ../../characters/unicode.xml $HSTYLE/mml6.xsl status=REC
|
|
51
|
+
#
|
|
52
|
+
#echo "Chapter 6 diff marked (byalpha) Tables"
|
|
53
|
+
#saxon ../../characters/unicode.xml $HSTYLE/mml6.xsl diff=1 ext="-d.html" status=REC
|
|
54
|
+
#
|
|
55
|
+
#echo xhtml mml6 stylesheet
|
|
56
|
+
#saxon -o $HSTYLE/xmml6.xsl $HSTYLE/mml6.xsl $HSTYLE/html2xhtml.xsl system-dtd=mathml.dtd stylesheet.pi="/Math/XSL/mathml.xsl" status=REC
|
|
57
|
+
#
|
|
58
|
+
#echo Chapter 6 xhtml Tables
|
|
59
|
+
#saxon ../../characters/unicode.xml $HSTYLE/xmml6.xsl ext=.xml
|
|
60
|
+
|
|
61
|
+
echo ""
|
|
62
|
+
echo ""
|
|
63
|
+
echo validate generated xhtml+mathml
|
|
64
|
+
for i in *.xml ;do echo -n $i ""; rxp -sxV $i ;done
|
|
65
|
+
|
|
66
|
+
echo ""
|
|
67
|
+
echo validate html
|
|
68
|
+
for i in *.html
|
|
69
|
+
do
|
|
70
|
+
echo -n $i ""
|
|
71
|
+
|
|
72
|
+
nsgmls -s -E4 $i
|
|
73
|
+
done
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
#echo ""
|
|
77
|
+
#mv images.tex images.old
|
|
78
|
+
#saxon -o images.tex $SOURCE/mathml-spec.xml $HSTYLE/images.xsl
|
|
79
|
+
#if (cmp images.tex images.old)
|
|
80
|
+
#then
|
|
81
|
+
#echo images same
|
|
82
|
+
#else
|
|
83
|
+
#echo images differ
|
|
84
|
+
#latex images.tex
|
|
85
|
+
#echo ""
|
|
86
|
+
#echo ""
|
|
87
|
+
#echo running generated images script
|
|
88
|
+
#bash images.sh
|
|
89
|
+
#fi
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
echo ""
|
|
93
|
+
echo PDF
|
|
94
|
+
echo generate TeX files
|
|
95
|
+
saxon $SOURCE/mathml-spec.xml $PSTYLE/mathmlspec.xsl
|
|
96
|
+
|
|
97
|
+
if test ! -f w3c_home.png
|
|
98
|
+
then
|
|
99
|
+
echo copy W3C logo
|
|
100
|
+
cp $SOURCE/../image/w3c_home.png .
|
|
101
|
+
fi
|
|
102
|
+
|
|
103
|
+
if test ! -f braids.png
|
|
104
|
+
then
|
|
105
|
+
echo copy braids
|
|
106
|
+
cp $SOURCE/../image/braids.png .
|
|
107
|
+
fi
|
|
108
|
+
|
|
109
|
+
if test ! -f intersect.png
|
|
110
|
+
then
|
|
111
|
+
echo copy intersect
|
|
112
|
+
cp $SOURCE/../image/intersect.png .
|
|
113
|
+
fi
|
|
114
|
+
|
|
115
|
+
# use nested if rather than while to limit looping
|
|
116
|
+
echo generate mathml-p.pdf
|
|
117
|
+
pdflatex \\batchmode \\input mathml-p.tex
|
|
118
|
+
if (grep -i rerun mathml-p.log)
|
|
119
|
+
then
|
|
120
|
+
pdflatex \\batchmode \\input mathml-p.tex
|
|
121
|
+
if (grep -i rerun mathml-p.log)
|
|
122
|
+
then
|
|
123
|
+
pdflatex \\batchmode \\input mathml-p.tex
|
|
124
|
+
if (grep -i rerun mathml-p.log)
|
|
125
|
+
then
|
|
126
|
+
pdflatex \\batchmode \\input mathml-p.tex
|
|
127
|
+
fi
|
|
128
|
+
fi
|
|
129
|
+
fi
|
|
130
|
+
|
|
131
|
+
echo generate mathml-s.pdf
|
|
132
|
+
pdflatex \\batchmode \\input mathml-s.tex
|
|
133
|
+
if (grep -i rerun mathml-s.log)
|
|
134
|
+
then
|
|
135
|
+
pdflatex \\batchmode \\input mathml-s.tex
|
|
136
|
+
if (grep -i rerun mathml-s.log)
|
|
137
|
+
then
|
|
138
|
+
pdflatex \\batchmode \\input mathml-s.tex
|
|
139
|
+
if (grep -i rerun mathml-s.log)
|
|
140
|
+
then
|
|
141
|
+
pdflatex \\batchmode \\input mathml-s.tex
|
|
142
|
+
fi
|
|
143
|
+
fi
|
|
144
|
+
fi
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
echo grep latex warnings
|
|
149
|
+
grep "^\!" mathml-?.log
|
|
150
|
+
grep -i warning mathml-?.log | grep -v bookmarks | grep -v "Font Warning"
|
|
151
|
+
grep -i rerun mathml-?.log
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
echo ""
|
|
155
|
+
echo make directories for zip files
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
mkdir mathml-html 2> /dev/null
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
if test ! -d mathml-html/image
|
|
162
|
+
then
|
|
163
|
+
echo cp image
|
|
164
|
+
cp -r image mathml-html
|
|
165
|
+
else
|
|
166
|
+
echo "(not) assuming mathml-html/image up to date"
|
|
167
|
+
cp -r image mathml-html
|
|
168
|
+
fi
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
cp $SOURCE/../image/w3c_home.png mathml-html/image
|
|
172
|
+
cp $HSTYLE/base.css mathml-html
|
|
173
|
+
|
|
174
|
+
if test ! -d mathml-html/glyphs
|
|
175
|
+
then
|
|
176
|
+
echo cp glyphs
|
|
177
|
+
cp -r glyphs mathml-html
|
|
178
|
+
else
|
|
179
|
+
echo "(not) assuming mathml-html/glyphs up to date"
|
|
180
|
+
cp -r glyphs mathml-html
|
|
181
|
+
fi
|
|
182
|
+
|
|
183
|
+
echo cp dtd and xsl
|
|
184
|
+
cp $W3CMATH/DTD/mathml2/xhtml-math11-f.dtd mathml-html
|
|
185
|
+
cp $W3CMATH/XSL/*.xsl mathml-html
|
|
186
|
+
|
|
187
|
+
echo sed xml
|
|
188
|
+
sed \
|
|
189
|
+
-e "s@/Math/DTD/mathml2/@@" \
|
|
190
|
+
mathml.dtd > mathml-html/mathml.dtd
|
|
191
|
+
|
|
192
|
+
for i in *.xml
|
|
193
|
+
do
|
|
194
|
+
sed \
|
|
195
|
+
-e "s@/Math/XSL/mathml.xsl@mathml.xsl@" \
|
|
196
|
+
-e "s@http://www.w3.org/StyleSheets/TR.*css@base.css@" \
|
|
197
|
+
-e "s@http://www.w3.org/Icons/w3c_home@image/w3c_home.png@" \
|
|
198
|
+
$i > mathml-html/$i
|
|
199
|
+
done
|
|
200
|
+
|
|
201
|
+
echo sed html
|
|
202
|
+
|
|
203
|
+
for i in *.html
|
|
204
|
+
do
|
|
205
|
+
sed \
|
|
206
|
+
-e "s@http://www.w3.org/StyleSheets/TR.*css@base.css@" \
|
|
207
|
+
-e "s@http://www.w3.org/Icons/w3c_home@image/w3c_home.png@" \
|
|
208
|
+
$i > mathml-html/$i
|
|
209
|
+
done
|
|
210
|
+
|
|
211
|
+
|
|
212
|
+
mkdir mathml-source 2> /dev/null
|
|
213
|
+
mkdir mathml-source/xml 2> /dev/null
|
|
214
|
+
mkdir mathml-source/pubtext 2> /dev/null
|
|
215
|
+
mkdir mathml-source/style 2> /dev/null
|
|
216
|
+
mkdir mathml-source/style/html 2> /dev/null
|
|
217
|
+
mkdir mathml-source/style/pdf 2> /dev/null
|
|
218
|
+
|
|
219
|
+
|
|
220
|
+
cp $SOURCE/{changes.xml,fundamentals.xml,operator-dict.xml,\
|
|
221
|
+
character-set.xml,glossary.xml,parsing.xml,\
|
|
222
|
+
content-element-def.xml,interface.xml,presentation-markup.xml,\
|
|
223
|
+
content-markup.xml,introduction.xml,references.xml,\
|
|
224
|
+
contributors.xml,mathml-css-sample.xml,\
|
|
225
|
+
mathml-dom.xml,validation-grammar.xml,\
|
|
226
|
+
dom-bindings.xml,mathml-spec.xml,\
|
|
227
|
+
dom-intro.xml,mixing.xml} \
|
|
228
|
+
mathml-source/xml
|
|
229
|
+
|
|
230
|
+
cp $SOURCE/../pubtext/{mathmlspec.dtd,xmlspec.dtd} mathml-source/pubtext
|
|
231
|
+
|
|
232
|
+
cp $HSTYLE/{mmldiff.xsl,html2xhtml.xsl,mmlspec.xsl,slices.xsl,slices-common.xsl,xmlspec.xsl,mml6.xsl,images.xsl} mathml-source/style/html
|
|
233
|
+
cp $PSTYLE/mathmlspec.xsl mathml-source/style/pdf
|
|
234
|
+
|
|
235
|
+
|
|
236
|
+
echo sed run
|
|
237
|
+
sed \
|
|
238
|
+
-e "s@=@=@" \
|
|
239
|
+
-e "s/exit/exit/" \
|
|
240
|
+
run > mathml-source/run
|
|
241
|
+
|
|
242
|
+
|
|
243
|
+
echo readme.txt
|
|
244
|
+
echo "
|
|
245
|
+
The sources for the MathML specification
|
|
246
|
+
the file "run" in this directory is a bash shell script
|
|
247
|
+
which details the commands required to generate the MathML
|
|
248
|
+
specificaton. It does not use any advanced bash features and
|
|
249
|
+
could be easily modified to other environments such as the
|
|
250
|
+
windows command line.
|
|
251
|
+
|
|
252
|
+
It requires:
|
|
253
|
+
|
|
254
|
+
An XML validator
|
|
255
|
+
rxp is used in the script
|
|
256
|
+
this is not used for production but just to check the input
|
|
257
|
+
and generated output is valid.
|
|
258
|
+
|
|
259
|
+
An SGML Parser
|
|
260
|
+
nsgmls is used in the script.
|
|
261
|
+
Again this is not used for production, but just to check that all
|
|
262
|
+
generated HTML is valid.
|
|
263
|
+
|
|
264
|
+
|
|
265
|
+
The unicode.xml and its dtd, charlist.dtd, available from
|
|
266
|
+
http://www.w3.org/Math/characters
|
|
267
|
+
These are used as the source for the character tables in chapter 6.
|
|
268
|
+
In addition, to generate the diff-marked version of byalpha.html
|
|
269
|
+
showing differences from the MathML 2.0 rec, you will need the version
|
|
270
|
+
of unicode.xml distributed in the XML source zip file linked from that
|
|
271
|
+
recommendation.
|
|
272
|
+
|
|
273
|
+
|
|
274
|
+
An XSLT system.
|
|
275
|
+
The free java implementation saxon is used in the script.
|
|
276
|
+
|
|
277
|
+
pdflatex to generate the PDF versions of the specification.
|
|
278
|
+
The documents use the rapport3 LaTeX class file which should be part
|
|
279
|
+
of most TeX distributions but is available from TeX archives as part of
|
|
280
|
+
the ntgclass distribution. It also uses several commonly available
|
|
281
|
+
package files, hyperref, url,ae,pslatex.
|
|
282
|
+
|
|
283
|
+
" > mathml-source/readme.txt
|
|
284
|
+
|
|
285
|
+
echo ""
|
|
286
|
+
echo mathml-source.zip
|
|
287
|
+
zip -qr mathml-source.zip mathml-source
|
|
288
|
+
|
|
289
|
+
echo mathml-html.zip
|
|
290
|
+
zip -qr mathml-html.zip mathml-html
|
|
291
|
+
|
|
292
|
+
|
|
293
|
+
|
|
294
|
+
|
|
295
|
+
echo ""
|
|
296
|
+
echo run ends here
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
|
|
3
|
+
html2xhtml.xsl: HTML to XHTML XSL stylesheet converter
|
|
4
|
+
========================================================
|
|
5
|
+
|
|
6
|
+
$Id: html2xhtml.xsl,v 1.9 2003/01/27 12:55:43 davidc Exp $
|
|
7
|
+
|
|
8
|
+
Copyright 1999 David Carlisle NAG Ltd
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
The following stylesheet takes as input an XSL stylesheet that writes
|
|
12
|
+
HTML, and produces a stylesheet that writes XML that hopefully matches the
|
|
13
|
+
XHTML specification. (It does not check that the output matches the DTD.)
|
|
14
|
+
It does the following things:
|
|
15
|
+
|
|
16
|
+
* Adds a DOCTYPE giving FPI and URL for one of the three flavours
|
|
17
|
+
of XHTML1. (Transitional unless the original stylesheet asked for
|
|
18
|
+
Frameset or Strict HTML.)
|
|
19
|
+
If the system-dtd parameter is set then instead of the canonical
|
|
20
|
+
XHTML PUBLIC DTD, a SYSTEM declaration is given to the supplied URL.
|
|
21
|
+
|
|
22
|
+
* Writes all HTML elements and attributes as lowercase, with
|
|
23
|
+
elements being written in the XHTML namespace.
|
|
24
|
+
|
|
25
|
+
* Writes canonically empty elements such as <BR> as
|
|
26
|
+
<br class="html-compat"/> .
|
|
27
|
+
(Appendix C recommends <br /> rather than <br/> but an XSL stylesheet
|
|
28
|
+
has no control over the concrete syntax of the linearisation, so
|
|
29
|
+
adding an attribute is probably the best that can be done. (No attribute
|
|
30
|
+
is added if the element already has attributes.)
|
|
31
|
+
|
|
32
|
+
* Changes the output method from html to xml in xsl:output
|
|
33
|
+
(and also in the xt:document extension element).
|
|
34
|
+
|
|
35
|
+
* Forces a line break after opening tags of non elements which are
|
|
36
|
+
not canonically empty, to ensure that they are never written with XML
|
|
37
|
+
empty syntax, so
|
|
38
|
+
<p>
|
|
39
|
+
</p>
|
|
40
|
+
not
|
|
41
|
+
<p/>
|
|
42
|
+
|
|
43
|
+
* Copies any elements from XSL or XT namespaces through to the new
|
|
44
|
+
stylesheet.
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
* Duplicates name attributes to id unless element already has id.
|
|
48
|
+
|
|
49
|
+
* Adds meta element to head specifying utf-8 encoding.
|
|
50
|
+
|
|
51
|
+
-->
|
|
52
|
+
|
|
53
|
+
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
|
54
|
+
xmlns:saxon="http://icl.com/saxon"
|
|
55
|
+
xmlns:xt="http://www.jclark.com/xt"
|
|
56
|
+
xmlns="http://www.w3.org/1999/xhtml"
|
|
57
|
+
xmlns:lxslt="http://xml.apache.org/xslt"
|
|
58
|
+
xmlns:xalanredirect="org.apache.xalan.xslt.extensions.Redirect"
|
|
59
|
+
version="1.0"
|
|
60
|
+
>
|
|
61
|
+
|
|
62
|
+
<xsl:output method="xml" indent="no"/>
|
|
63
|
+
|
|
64
|
+
<xsl:param name="system-dtd" />
|
|
65
|
+
<xsl:param name="stylesheet.pi" select="''"/>
|
|
66
|
+
|
|
67
|
+
<xsl:template match="xsl:*|xt:*|saxon:*|lxslt:*|xalanredirect:*">
|
|
68
|
+
<xsl:copy>
|
|
69
|
+
<xsl:copy-of select="@*"/>
|
|
70
|
+
<xsl:apply-templates/>
|
|
71
|
+
</xsl:copy>
|
|
72
|
+
</xsl:template>
|
|
73
|
+
|
|
74
|
+
<xsl:template match="xsl:attribute[@name='lang']">
|
|
75
|
+
<xsl:copy>
|
|
76
|
+
<xsl:copy-of select="@*"/>
|
|
77
|
+
<xsl:attribute name="name">xml:lang</xsl:attribute>
|
|
78
|
+
<xsl:apply-templates/>
|
|
79
|
+
</xsl:copy>
|
|
80
|
+
</xsl:template>
|
|
81
|
+
|
|
82
|
+
<xsl:template match="xsl:output|xt:document|saxon:output">
|
|
83
|
+
<xsl:copy>
|
|
84
|
+
<xsl:attribute name="method">xml</xsl:attribute>
|
|
85
|
+
<xsl:choose>
|
|
86
|
+
<xsl:when test="$system-dtd">
|
|
87
|
+
<xsl:attribute name="doctype-system">
|
|
88
|
+
<xsl:value-of select="$system-dtd"/>
|
|
89
|
+
</xsl:attribute>
|
|
90
|
+
</xsl:when>
|
|
91
|
+
<xsl:when test="contains(@doctype-public,'Frameset')">
|
|
92
|
+
<xsl:attribute name="doctype-public">
|
|
93
|
+
<xsl:text>-//W3C//DTD XHTML 1.0 Frameset//EN</xsl:text>
|
|
94
|
+
</xsl:attribute>
|
|
95
|
+
<xsl:attribute name="doctype-system">
|
|
96
|
+
<xsl:text>http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd</xsl:text>
|
|
97
|
+
</xsl:attribute>
|
|
98
|
+
</xsl:when>
|
|
99
|
+
<xsl:when test="contains(@doctype-public,'Strict')">
|
|
100
|
+
<xsl:attribute name="doctype-public">
|
|
101
|
+
<xsl:text>-//W3C//DTD XHTML 1.0 Strict//EN</xsl:text>
|
|
102
|
+
</xsl:attribute>
|
|
103
|
+
<xsl:attribute name="doctype-system">
|
|
104
|
+
<xsl:text>http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd</xsl:text>
|
|
105
|
+
</xsl:attribute>
|
|
106
|
+
</xsl:when>
|
|
107
|
+
<xsl:otherwise>
|
|
108
|
+
<xsl:attribute name="doctype-public">
|
|
109
|
+
<xsl:text>-//W3C//DTD XHTML 1.0 Transitional//EN</xsl:text>
|
|
110
|
+
</xsl:attribute>
|
|
111
|
+
<xsl:attribute name="doctype-system">
|
|
112
|
+
<xsl:text>http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd</xsl:text>
|
|
113
|
+
</xsl:attribute>
|
|
114
|
+
</xsl:otherwise>
|
|
115
|
+
</xsl:choose>
|
|
116
|
+
<xsl:attribute name="indent">yes</xsl:attribute>
|
|
117
|
+
<xsl:copy-of select="@*[not(
|
|
118
|
+
name(.)='method' or
|
|
119
|
+
name(.)='doctype-public' or
|
|
120
|
+
name(.)='doctype-system' or
|
|
121
|
+
name(.)='indent'
|
|
122
|
+
) ]"/>
|
|
123
|
+
<xsl:apply-templates/>
|
|
124
|
+
</xsl:copy>
|
|
125
|
+
</xsl:template>
|
|
126
|
+
|
|
127
|
+
<xsl:template match="xsl:import|xsl:include">
|
|
128
|
+
<xsl:copy>
|
|
129
|
+
<xsl:copy-of select="@*"/>
|
|
130
|
+
<xsl:attribute name="href">x<xsl:value-of select="@href"/></xsl:attribute>
|
|
131
|
+
</xsl:copy>
|
|
132
|
+
</xsl:template>
|
|
133
|
+
|
|
134
|
+
<xsl:template match="xsl:element[contains(@name,'{')]">
|
|
135
|
+
<xsl:copy>
|
|
136
|
+
<xsl:attribute name="namespace">http://www.w3.org/1999/xhtml</xsl:attribute>
|
|
137
|
+
<xsl:copy-of select="@*"/>
|
|
138
|
+
<xsl:apply-templates/>
|
|
139
|
+
</xsl:copy>
|
|
140
|
+
</xsl:template>
|
|
141
|
+
|
|
142
|
+
<xsl:template match="*|xsl:element">
|
|
143
|
+
<xsl:variable name="n">
|
|
144
|
+
<xsl:choose>
|
|
145
|
+
<xsl:when test="self::xsl:element">
|
|
146
|
+
<xsl:value-of select="translate(@name,
|
|
147
|
+
'ABCDEFGHIJKLMNOPQRSTUVWXYZ',
|
|
148
|
+
'abcdefghijklmnopqrstuvwxyz')"/>
|
|
149
|
+
</xsl:when>
|
|
150
|
+
<xsl:otherwise>
|
|
151
|
+
<xsl:value-of select="translate(local-name(.),
|
|
152
|
+
'ABCDEFGHIJKLMNOPQRSTUVWXYZ',
|
|
153
|
+
'abcdefghijklmnopqrstuvwxyz')"/>
|
|
154
|
+
</xsl:otherwise>
|
|
155
|
+
</xsl:choose>
|
|
156
|
+
</xsl:variable>
|
|
157
|
+
<xsl:if test="$n='html' and string($stylesheet.pi)">
|
|
158
|
+
<xsl:text> </xsl:text>
|
|
159
|
+
<xsl:element name="xsl:processing-instruction">
|
|
160
|
+
<xsl:attribute name="name">xml-stylesheet</xsl:attribute
|
|
161
|
+
>type="text/xsl" href="<xsl:copy-of
|
|
162
|
+
select="$stylesheet.pi"/>"</xsl:element>
|
|
163
|
+
</xsl:if>
|
|
164
|
+
<xsl:element
|
|
165
|
+
name="{$n}"
|
|
166
|
+
namespace="http://www.w3.org/1999/xhtml">
|
|
167
|
+
<xsl:for-each select="self::*[not(self::xsl:element)]/@* |
|
|
168
|
+
self::xsl:element/@use-attribute-sets">
|
|
169
|
+
<xsl:variable name="name" select="translate(local-name(.),
|
|
170
|
+
'ABCDEFGHIJKLMNOPQRSTUVWXYZ',
|
|
171
|
+
'abcdefghijklmnopqrstuvwxyz')"/>
|
|
172
|
+
<xsl:if test="($name != 'name') and ($name != 'align') and ($name != 'lang')">
|
|
173
|
+
<xsl:attribute name="{$name}">
|
|
174
|
+
<xsl:value-of select="."/>
|
|
175
|
+
</xsl:attribute>
|
|
176
|
+
</xsl:if>
|
|
177
|
+
|
|
178
|
+
</xsl:for-each>
|
|
179
|
+
<xsl:if test="@lang">
|
|
180
|
+
<xsl:attribute name="xml:lang"><xsl:value-of select="@lang"/></xsl:attribute>
|
|
181
|
+
</xsl:if>
|
|
182
|
+
<xsl:if test="@align and not(@style)">
|
|
183
|
+
<xsl:attribute name="style">vertical-align:<xsl:value-of select="@align"/></xsl:attribute>
|
|
184
|
+
</xsl:if>
|
|
185
|
+
<xsl:if test="@name and not(@id)">
|
|
186
|
+
<xsl:attribute name="id"><xsl:value-of select="@name"/></xsl:attribute>
|
|
187
|
+
</xsl:if>
|
|
188
|
+
<xsl:if test="@NAME and not(@id)">
|
|
189
|
+
<xsl:attribute name="id"><xsl:value-of select="@NAME"/></xsl:attribute>
|
|
190
|
+
</xsl:if>
|
|
191
|
+
<xsl:variable name="content">
|
|
192
|
+
<xsl:apply-templates/>
|
|
193
|
+
</xsl:variable>
|
|
194
|
+
<xsl:choose>
|
|
195
|
+
<xsl:when test="$n='br' or $n='hr'
|
|
196
|
+
or $n='link' or $n='img' or $n='base' or $n='meta'">
|
|
197
|
+
<xsl:if test="not(@*) and not(xsl:attribute)">
|
|
198
|
+
<xsl:attribute name="class">html-compat</xsl:attribute>
|
|
199
|
+
</xsl:if>
|
|
200
|
+
<xsl:copy-of select="$content"/>
|
|
201
|
+
</xsl:when>
|
|
202
|
+
<xsl:when test="string-length($content)>0">
|
|
203
|
+
<xsl:copy-of select="$content"/>
|
|
204
|
+
</xsl:when>
|
|
205
|
+
<xsl:otherwise>
|
|
206
|
+
<xsl:element name="xsl:text" xml:space='preserve'>
</xsl:element>
|
|
207
|
+
<xsl:copy-of select="$content"/>
|
|
208
|
+
</xsl:otherwise>
|
|
209
|
+
</xsl:choose>
|
|
210
|
+
</xsl:element>
|
|
211
|
+
</xsl:template>
|
|
212
|
+
|
|
213
|
+
|
|
214
|
+
</xsl:stylesheet>
|
|
215
|
+
|
|
216
|
+
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
<?xml version="1.0"?>
|
|
2
|
+
<!--
|
|
3
|
+
$Id: images.xsl,v 1.4 2003/09/15 13:51:26 davidc Exp $
|
|
4
|
+
|
|
5
|
+
images.xsl David Carlisle
|
|
6
|
+
-->
|
|
7
|
+
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
|
8
|
+
xmlns:saxon="http://icl.com/saxon"
|
|
9
|
+
extension-element-prefixes="saxon"
|
|
10
|
+
version="1.0">
|
|
11
|
+
|
|
12
|
+
<xsl:output method="text" />
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
<xsl:template match="/">
|
|
16
|
+
\batchmode
|
|
17
|
+
\documentclass{article}
|
|
18
|
+
\usepackage{amstext,amsfonts,amssymb,color,graphicx}
|
|
19
|
+
\pagestyle{empty}
|
|
20
|
+
\let\normalshape\upshape
|
|
21
|
+
\makeatletter
|
|
22
|
+
\definecolor{background}{rgb}{1.0,1.0,1.0}
|
|
23
|
+
%\pagecolor{background}
|
|
24
|
+
\let\ImageFontsize\large
|
|
25
|
+
\def\ImagePadding{1pt}
|
|
26
|
+
\def\ImageWidth{120mm}
|
|
27
|
+
\newsavebox{\FragmentBox}
|
|
28
|
+
\def\PaddedImage#1{%
|
|
29
|
+
\bgroup\ImageFontsize \savebox{\FragmentBox}{$#1$}%
|
|
30
|
+
\@tempdima\ht\FragmentBox \@tempdimb\dp\FragmentBox
|
|
31
|
+
\ifdim\@tempdima>\@tempdimb
|
|
32
|
+
\dp\FragmentBox\@tempdima
|
|
33
|
+
\else
|
|
34
|
+
\ht\FragmentBox\@tempdimb
|
|
35
|
+
\fi
|
|
36
|
+
\color{background}\fboxsep\ImagePadding%
|
|
37
|
+
\fbox{\color[rgb]{0.0,0.0,0.0}\box\FragmentBox}\egroup
|
|
38
|
+
\newpage}
|
|
39
|
+
\def\UnpaddedImage#1{%
|
|
40
|
+
\bgroup\ImageFontsize \savebox{\FragmentBox}{$#1$}%
|
|
41
|
+
%%%DOES THIS CAUSE PROBLEMS? \dp\FragmentBox\z@
|
|
42
|
+
\color{background}\fboxsep\ImagePadding%
|
|
43
|
+
\fbox{\color[rgb]{0.0,0.0,0.0}\box\FragmentBox}\egroup
|
|
44
|
+
\newpage}
|
|
45
|
+
\def\FDImage#1{%
|
|
46
|
+
\UnpaddedImage{\displaystyle #1}}
|
|
47
|
+
\makeatother
|
|
48
|
+
\renewcommand{\int}{\intop}
|
|
49
|
+
\newcommand{\Nset}{\mathbb{N}}
|
|
50
|
+
\newcommand{\Zset}{\mathbb{Z}}
|
|
51
|
+
\newcommand{\Qset}{\mathbb{Q}}
|
|
52
|
+
\newcommand{\Rset}{\mathbb{R}}
|
|
53
|
+
\newcommand{\Cset}{\mathbb{C}}
|
|
54
|
+
\newcommand{\xor}{\mathbin{\mathrm{xor}}}
|
|
55
|
+
\newcommand{\mod}{\mathbin{\mathrm{mod}}}
|
|
56
|
+
\newcommand{\diffd}{\mathrm{d}}
|
|
57
|
+
\newcommand{\eulere}{\mathrm{e}}
|
|
58
|
+
\newcommand{\ii}{\mathrm{i}}
|
|
59
|
+
\newdimen\boxwd
|
|
60
|
+
\newcommand{\widearrow}[1]{%
|
|
61
|
+
\setbox0=\hbox{$\mathsurround0pt \scriptstyle\;\;#1\;\;$}\boxwd=\wd0%
|
|
62
|
+
\mathrel{\mathop{\hbox to\boxwd{\rightarrowfill}}\limits_{#1}}}
|
|
63
|
+
\newwrite\img
|
|
64
|
+
\immediate\openout\img=images.sh
|
|
65
|
+
\newcount\n
|
|
66
|
+
\n=0
|
|
67
|
+
\begin{document}
|
|
68
|
+
|
|
69
|
+
\immediate\write\img{^^J%
|
|
70
|
+
dvips -Ppdf -j -E -i -S 1 images}
|
|
71
|
+
|
|
72
|
+
<xsl:for-each select="//graphic[@diff='add' or @diff='chg']">
|
|
73
|
+
|
|
74
|
+
\advance\n1
|
|
75
|
+
\immediate\write\img{^^J%
|
|
76
|
+
echo <xsl:value-of select="@source"/>^^J%
|
|
77
|
+
%convert -crop 0x0 -density 110x110 -transparent white eps:images.%
|
|
78
|
+
convert -crop 0x0 -density 110x110 eps:images.%
|
|
79
|
+
\ifnum \n <100 0\fi
|
|
80
|
+
\ifnum \n <10 0\fi
|
|
81
|
+
\the\n\space <xsl:value-of select="@source"/>}
|
|
82
|
+
<xsl:choose>
|
|
83
|
+
<xsl:when test="@role='inline' and @align='bottom'">
|
|
84
|
+
\UnpaddedImage{<xsl:value-of select="@alt"/>}
|
|
85
|
+
</xsl:when>
|
|
86
|
+
<xsl:when test="@role='inline'">
|
|
87
|
+
\PaddedImage{<xsl:value-of select="@alt"/>}
|
|
88
|
+
</xsl:when>
|
|
89
|
+
<xsl:otherwise>
|
|
90
|
+
\FDImage{<xsl:value-of select="@alt"/>}
|
|
91
|
+
</xsl:otherwise>
|
|
92
|
+
</xsl:choose>
|
|
93
|
+
</xsl:for-each>
|
|
94
|
+
|
|
95
|
+
\end{document}
|
|
96
|
+
</xsl:template>
|
|
97
|
+
|
|
98
|
+
</xsl:stylesheet>
|