diff options
author | Karl Berry <karl@freefriends.org> | 2008-05-12 22:29:41 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2008-05-12 22:29:41 +0000 |
commit | f724c0d6176b55cf00a8b2cf7da4d9d1715755af (patch) | |
tree | 07724dc93277564a221c330ea94b255afd5dcb21 /Master/texmf-dist/tex4ht/xtpipes | |
parent | ce17979d710d61d93b25e13de7cff43ab9f5590c (diff) |
tex4ht update from latest fix release
git-svn-id: svn://tug.org/texlive/trunk@8095 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex4ht/xtpipes')
-rwxr-xr-x | Master/texmf-dist/tex4ht/xtpipes/docbook.4xt | 114 | ||||
-rwxr-xr-x | Master/texmf-dist/tex4ht/xtpipes/htspk.4xt | 2146 | ||||
-rwxr-xr-x | Master/texmf-dist/tex4ht/xtpipes/jsml.4xt | 2832 | ||||
-rwxr-xr-x | Master/texmf-dist/tex4ht/xtpipes/oo-math.4xt | 118 | ||||
-rwxr-xr-x | Master/texmf-dist/tex4ht/xtpipes/oo-text.4xt | 181 | ||||
-rwxr-xr-x | Master/texmf-dist/tex4ht/xtpipes/xhtml.4xt | 514 | ||||
-rwxr-xr-x | Master/texmf-dist/tex4ht/xtpipes/xtpipes-default.4xt | 4 | ||||
-rwxr-xr-x | Master/texmf-dist/tex4ht/xtpipes/xtpipes-map.dtd | 30 | ||||
-rwxr-xr-x | Master/texmf-dist/tex4ht/xtpipes/xtpipes.dtd | 77 |
9 files changed, 6016 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex4ht/xtpipes/docbook.4xt b/Master/texmf-dist/tex4ht/xtpipes/docbook.4xt new file mode 100755 index 00000000000..903aaf4838b --- /dev/null +++ b/Master/texmf-dist/tex4ht/xtpipes/docbook.4xt @@ -0,0 +1,114 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE xtpipes SYSTEM "xtpipes.dtd" > +<xtpipes preamble="yes" signature="docbook.4xt (2008-02-22-01:05)"> + <sax content-handler="xtpipes.util.ScriptsManager" + lexical-handler="xtpipes.util.ScriptsManagerLH" > + <script element="ulink" > + <set name="ulink" > + <![CDATA[ + <xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + > + <xsl:output omit-xml-declaration = "yes" /> + + <xsl:template match=" ulink[ + @url and starts-with( @url, '#') +]" > + <link> + <xsl:attribute name="linkend"> + <xsl:value-of select=" substring( @url, 2 )" /> + </xsl:attribute> + <xsl:apply-templates select="*|text()|comment()" /> + </link> +</xsl:template> + + <xsl:template match="*|@*|text()|comment()" > + <xsl:copy> + <xsl:apply-templates select="*|@*|text()|comment()" /> + </xsl:copy> + </xsl:template> + </xsl:stylesheet> +]]> + + </set> + <xslt name="." xml="." xsl="ulink" /> +</script> + + <script element="tbody" > + <set name="tbody" > + <![CDATA[ + <xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + > + <xsl:output omit-xml-declaration = "yes" /> + + <xsl:template match=" row[ @role = 'hline' ]" /> +<xsl:template match=" row[ @role = 'hline' ]" /> +<xsl:template match=" row[ + following-sibling::*[1][ self::row[@role = 'hline'] ] +] "> + <xsl:copy> + <xsl:attribute name="rowsep"> + <xsl:text>1</xsl:text> + </xsl:attribute> + <xsl:apply-templates select="*|@*|text()|comment()" /> + </xsl:copy> +</xsl:template> +<xsl:template match=" row[ + (@role = 'cline') + and + preceding-sibling::*[1] + [ self::row[ not(@role) ] ] + and + ( count(child::entry) = count(preceding-sibling::*[1]/child::entry)) +]" /> +<xsl:template match=" row[ + not(@role) + and + following-sibling::*[1][ self::row[@role = 'cline'] ] + and + ( count(child::entry) = count(following-sibling::*[1]/child::entry)) +] "> + <xsl:copy> + <xsl:apply-templates select="@*" /> + <xsl:apply-templates select="*|text()|comment()" mode="cline" /> + </xsl:copy> +</xsl:template> +<xsl:template match=" text()|comment() " mode="cline"> + <xsl:copy> + <xsl:apply-templates select="*|@*|text()|comment()" /> + </xsl:copy> +</xsl:template> +<xsl:template match="*" mode="cline"> + <xsl:copy> + <xsl:if test="self::entry"> + <xsl:attribute name="rowsep"> + <xsl:variable name="pos"> + <xsl:value-of select="position()" /> + </xsl:variable> + <xsl:value-of select="parent::row + / following-sibling::*[1] + / child::entry[position()=$pos] + / @rowsep + " /> + </xsl:attribute> + </xsl:if> + <xsl:apply-templates select="*|@*|text()|comment()" /> + </xsl:copy> +</xsl:template> + + <xsl:template match="*|@*|text()|comment()" > + <xsl:copy> + <xsl:apply-templates select="*|@*|text()|comment()" /> + </xsl:copy> + </xsl:template> + </xsl:stylesheet> +]]> + + </set> + <xslt name="." xml="." xsl="tbody" /> +</script> + + </sax> +</xtpipes> + diff --git a/Master/texmf-dist/tex4ht/xtpipes/htspk.4xt b/Master/texmf-dist/tex4ht/xtpipes/htspk.4xt new file mode 100755 index 00000000000..58e3d4d7acd --- /dev/null +++ b/Master/texmf-dist/tex4ht/xtpipes/htspk.4xt @@ -0,0 +1,2146 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE xtpipes SYSTEM "xtpipes.dtd" > +<xtpipes> + <sax content-handler="xtpipes.util.ScriptsManager" + lexical-handler="xtpipes.util.ScriptsManagerLH" > + <script element="br" > + <set name="br" > + <![CDATA[ + <xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + > + <xsl:output omit-xml-declaration = "yes" /> + <xsl:template match="br" > + <xsl:copy> + <xsl:apply-templates select="@*" /> + <xsl:comment>.</xsl:comment> + </xsl:copy> + </xsl:template> + <xsl:template match="*|@*|text()|comment()" > + <xsl:copy> + <xsl:apply-templates select="*|@*|text()|comment()" /> + </xsl:copy> + </xsl:template> + </xsl:stylesheet> + ]]> + </set> + <xslt name="." xml="." xsl="br" /> +</script> + + <script element="span::msup" > + <set name="m-sub-sup" > + <![CDATA[ + <xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + > + <xsl:output omit-xml-declaration = "yes" /> + + <xsl:template match="span[ + ((@class = 'msup') or (@class = 'msub') + or (@class = 'msubsup')) + and + not( + child::span[ (@class = 'mrow-sub') ] + / child::span[ (@class != 'begin-script') + and + (@class != 'end-script') + and + (@class != 'mid-script') + ] + ) + and + not( + child::span[ (@class = 'mrow-super') ] + / child::span[ (@class != 'begin-script') + and + (@class != 'end-script') + and + (@class != 'mid-script') + ] + ) +]" > + <xsl:apply-templates select="child::span[ + @class = 'mrow-base' ]/*" /> +</xsl:template> + + <xsl:template match="*|@*|text()|comment()" > + <xsl:copy> + <xsl:apply-templates select="*|@*|text()|comment()" /> + </xsl:copy> + </xsl:template> + </xsl:stylesheet> +]]> + + </set> + <xslt name="." xml="." xsl="m-sub-sup" /> + <set name="m-sup-2-3" > + <![CDATA[ + <xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + > + <xsl:output omit-xml-declaration = "yes" /> + + <xsl:template match="span[ + (@class = 'msup') + and + (normalize-space( + child::span[ (@class = 'mrow-super') ] + / child::span[ (@class != 'begin-script') + and + (@class != 'end-script') + ] + ) = '2') + and not( + child::span[ (@class = 'mrow-base') ] + / child::span[ not( @title = 'speech-extra' ) ] + [ position() = last() ] + / self::* [ @class = 'mo-op' ] +) + +]" > + <xsl:copy> + <xsl:apply-templates select="*|@*|text()|comment()" + mode="squared" /> + </xsl:copy> +</xsl:template> +<xsl:template match="*|@*|text()|comment()" + mode="squared" > + <xsl:copy> + <xsl:choose> + <xsl:when test=" @class = 'mrow-super' "> + <xsl:apply-templates select="@*" /> + <span class="mo-op"> + <xsl:text> squared </xsl:text> + </span> + </xsl:when> + <xsl:otherwise> + <xsl:apply-templates select="*|@*|text()|comment()" /> + </xsl:otherwise> + </xsl:choose> + </xsl:copy> +</xsl:template> +<xsl:template match="span[ + (@class = 'msup') + and + (normalize-space( + child::span[ (@class = 'mrow-super') ] + / child::span[ (@class != 'begin-script') + and + (@class != 'end-script') + ] + ) = '3') + and not( + child::span[ (@class = 'mrow-base') ] + / child::span[ not( @title = 'speech-extra' ) ] + [ position() = last() ] + / self::* [ @class = 'mo-op' ] +) + +]" > + <xsl:copy> + <xsl:apply-templates select="*|@*|text()|comment()" + mode="cube" /> + </xsl:copy> +</xsl:template> +<xsl:template match="*|@*|text()|comment()" + mode="cube" > + <xsl:copy> + <xsl:choose> + <xsl:when test=" @class = 'mrow-super' "> + <xsl:apply-templates select="@*" /> + <span class="mo-op"> + <xsl:text> cube </xsl:text> + </span> + </xsl:when> + <xsl:otherwise> + <xsl:apply-templates select="*|@*|text()|comment()" /> + </xsl:otherwise> + </xsl:choose> + </xsl:copy> +</xsl:template> + + <xsl:template match="*|@*|text()|comment()" > + <xsl:copy> + <xsl:apply-templates select="*|@*|text()|comment()" /> + </xsl:copy> + </xsl:template> + </xsl:stylesheet> +]]> + +</set> +<xslt name="." xml="." xsl="m-sup-2-3" /> + +</script> +<script element="span::msub" > + <set name="m-sub-sup" > + <![CDATA[ + <xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + > + <xsl:output omit-xml-declaration = "yes" /> + + <xsl:template match="span[ + ((@class = 'msup') or (@class = 'msub') + or (@class = 'msubsup')) + and + not( + child::span[ (@class = 'mrow-sub') ] + / child::span[ (@class != 'begin-script') + and + (@class != 'end-script') + and + (@class != 'mid-script') + ] + ) + and + not( + child::span[ (@class = 'mrow-super') ] + / child::span[ (@class != 'begin-script') + and + (@class != 'end-script') + and + (@class != 'mid-script') + ] + ) +]" > + <xsl:apply-templates select="child::span[ + @class = 'mrow-base' ]/*" /> +</xsl:template> + + <xsl:template match="*|@*|text()|comment()" > + <xsl:copy> + <xsl:apply-templates select="*|@*|text()|comment()" /> + </xsl:copy> + </xsl:template> + </xsl:stylesheet> +]]> + +</set> +<xslt name="." xml="." xsl="m-sub-sup" /> + +</script> +<script element="span::msubsup" > + <set name="subsup-prime" > + <![CDATA[ + <xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + > + <xsl:output omit-xml-declaration = "yes" /> + + <xsl:template match="span[ + (@class = 'msubsup') + and + (count( + child::* [ @class='mrow-super' ] + / child::span [ not(@title = 'speech-extra') ] ) = 1) + and + (count( + child::* [ @class='mrow-super' ] + / child::span [ not(@title = 'speech-extra') ] + / child::span) = 1) + and + child::* [ @class='mrow-super' ] + / child::span [ not(@title = 'speech-extra') ] + / child::span[ @class='char' ] + / child::span[ + (@class = 'ch 2032') or (@class = 'ch 2033') + or (@class = 'ch 2034') + ] +]" > + <xsl:copy> + <xsl:attribute name="class" > + <xsl:text>msub</xsl:text> + </xsl:attribute> + <span class="mrow-base"> + <xsl:apply-templates select=" + *[@class = 'mrow-base'] / * + " /> + <xsl:apply-templates select=" + *[@class = 'mrow-super'] + / child::span [ not(@title = 'speech-extra') ] + " /> + </span> + <xsl:apply-templates select="*[@class = 'mrow-sub']" /> + </xsl:copy> +</xsl:template> + + <xsl:template match="*|@*|text()|comment()" > + <xsl:copy> + <xsl:apply-templates select="*|@*|text()|comment()" /> + </xsl:copy> + </xsl:template> + </xsl:stylesheet> +]]> + +</set> +<xslt name="." xml="." xsl="subsup-prime" /> + + <set name="m-sub-sup" > + <![CDATA[ + <xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + > + <xsl:output omit-xml-declaration = "yes" /> + + <xsl:template match="span[ + ((@class = 'msup') or (@class = 'msub') + or (@class = 'msubsup')) + and + not( + child::span[ (@class = 'mrow-sub') ] + / child::span[ (@class != 'begin-script') + and + (@class != 'end-script') + and + (@class != 'mid-script') + ] + ) + and + not( + child::span[ (@class = 'mrow-super') ] + / child::span[ (@class != 'begin-script') + and + (@class != 'end-script') + and + (@class != 'mid-script') + ] + ) +]" > + <xsl:apply-templates select="child::span[ + @class = 'mrow-base' ]/*" /> +</xsl:template> + + <xsl:template match="*|@*|text()|comment()" > + <xsl:copy> + <xsl:apply-templates select="*|@*|text()|comment()" /> + </xsl:copy> + </xsl:template> + </xsl:stylesheet> +]]> + +</set> +<xslt name="." xml="." xsl="m-sub-sup" /> + + <set name="m-subsup-2-3" > + <![CDATA[ + <xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + > + <xsl:output omit-xml-declaration = "yes" /> + + <xsl:template match="span[ + (@class = 'msubsup') + and + (normalize-space( + child::span[ (@class = 'mrow-super') ] + / child::span[ (@class != 'mid-script') + and + (@class != 'end-script') + ] + ) = '2') + and not( + child::span[ (@class = 'mrow-base') ] + / child::span[ not( @title = 'speech-extra' ) ] + [ position() = last() ] + / self::* [ @class = 'mo-op' ] +) + +]" > + <xsl:copy> + <xsl:attribute name="class" > + <xsl:text>msub</xsl:text> + </xsl:attribute> + <xsl:apply-templates select="*|text()|comment()" + mode="sub-squared" /> + </xsl:copy> +</xsl:template> +<xsl:template match="*|@*|text()|comment()" + mode="sub-squared" > + <xsl:copy> + <xsl:choose> + <xsl:when test=" @class = 'mrow-sub' "> + <xsl:apply-templates select="*[ + not( @class = 'end-script' ) + ] + |@*|text()|comment()" /> + <xsl:apply-templates select=" + following-sibling::*[1] / *[ + @class = 'end-script' + ] " /> + </xsl:when> + <xsl:when test=" @class = 'mrow-super' "> + <xsl:attribute name="class" > + <xsl:text>squared-super</xsl:text> + </xsl:attribute> + <span class="mo-op"> + <xsl:text> squared </xsl:text> + </span> + </xsl:when> + <xsl:otherwise> + <xsl:apply-templates select="*|@*|text()|comment()" /> + </xsl:otherwise> + </xsl:choose> + </xsl:copy> +</xsl:template> +<xsl:template match="span[ + (@class = 'msubsup') + and + (normalize-space( + child::span[ (@class = 'mrow-super') ] + / child::span[ (@class != 'mid-script') + and + (@class != 'end-script') + ] + ) = '3') + and not( + child::span[ (@class = 'mrow-base') ] + / child::span[ not( @title = 'speech-extra' ) ] + [ position() = last() ] + / self::* [ @class = 'mo-op' ] +) + +]" > + <xsl:copy> + <xsl:attribute name="class" > + <xsl:text>msub</xsl:text> + </xsl:attribute> + <xsl:apply-templates select="*|text()|comment()" + mode="sub-cube" /> + </xsl:copy> +</xsl:template> +<xsl:template match="*|@*|text()|comment()" + mode="sub-cube" > + <xsl:copy> + <xsl:choose> + <xsl:when test=" @class = 'mrow-sub' "> + <xsl:apply-templates select="*[ + not( @class = 'end-script' ) + ] + |@*|text()|comment()" /> + <xsl:apply-templates select=" + following-sibling::*[1] / *[ + @class = 'end-script' + ] " /> + </xsl:when> + <xsl:when test=" @class = 'mrow-super' "> + <xsl:attribute name="class" > + <xsl:text>cube-super</xsl:text> + </xsl:attribute> + <span class="mo-op"> + <xsl:text> cube </xsl:text> + </span> + </xsl:when> + <xsl:otherwise> + <xsl:apply-templates select="*|@*|text()|comment()" /> + </xsl:otherwise> + </xsl:choose> + </xsl:copy> +</xsl:template> + + <xsl:template match="*|@*|text()|comment()" > + <xsl:copy> + <xsl:apply-templates select="*|@*|text()|comment()" /> + </xsl:copy> + </xsl:template> + </xsl:stylesheet> +]]> + +</set> +<xslt name="." xml="." xsl="m-subsup-2-3" /> + +</script> + + <script element="span::mfrac" > + <set name="mfrac" > + <![CDATA[ + <xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + > + <xsl:output omit-xml-declaration = "yes" /> + + <xsl:template match="span[ @class = 'mfrac' ]" > + <xsl:copy> + <xsl:choose> + <xsl:when test=" + (string-length( + normalize-space(child::span[ @class = 'mrow-numerator' ][1]) + ) = 1) + and + (string-length( + normalize-space(child::span[ @class = 'mrow-enumerator' ][1]) + ) = 1) +"> + <xsl:variable name="a"> + <xsl:value-of select=" + normalize-space(child::span[ @class = 'mrow-numerator' ][1]) + " /> +</xsl:variable> +<xsl:variable name="b"> + <xsl:value-of select=" + normalize-space(child::span[ @class = 'mrow-enumerator' ][1]) + " /> +</xsl:variable> + + <xsl:choose> + <xsl:when test=" + (translate($a,'123456789','') != '') + or + (translate($b,'123456789','') != '') + " > + <xsl:apply-templates select="*|@*|text()|comment()" /> + </xsl:when> + <xsl:when test=" $a < $b "> + <xsl:attribute name="class"> + <xsl:text>word-frac</xsl:text> + </xsl:attribute> + <xsl:choose> + <xsl:when test=" $a = 1 "><xsl:text> one </xsl:text></xsl:when> + <xsl:when test=" $a = 2 "><xsl:text> two </xsl:text></xsl:when> + <xsl:when test=" $a = 3 "><xsl:text> three </xsl:text></xsl:when> + <xsl:when test=" $a = 4 "><xsl:text> four </xsl:text></xsl:when> + <xsl:when test=" $a = 5 "><xsl:text> five </xsl:text></xsl:when> + <xsl:when test=" $a = 6 "><xsl:text> six </xsl:text></xsl:when> + <xsl:when test=" $a = 7 "><xsl:text> seven </xsl:text></xsl:when> + <xsl:when test=" $a = 8 "><xsl:text> eight </xsl:text></xsl:when> + <xsl:when test=" $a = 9 "><xsl:text> nine </xsl:text></xsl:when> +</xsl:choose> + + <xsl:choose> + <xsl:when test=" $b = 2 "><xsl:text> half</xsl:text></xsl:when> + <xsl:when test=" $b = 3 "><xsl:text> third</xsl:text></xsl:when> + <xsl:when test=" $b = 4 "><xsl:text> fourth</xsl:text></xsl:when> + <xsl:when test=" $b = 5 "><xsl:text> fifth</xsl:text></xsl:when> + <xsl:when test=" $b = 6 "><xsl:text> sixth</xsl:text></xsl:when> + <xsl:when test=" $b = 7 "><xsl:text> seventh</xsl:text></xsl:when> + <xsl:when test=" $b = 8 "><xsl:text> eighth</xsl:text></xsl:when> + <xsl:when test=" $b = 9 "><xsl:text> nineth</xsl:text></xsl:when> +</xsl:choose> +<xsl:if test=" $a > 1 "><xsl:text>s</xsl:text></xsl:if> +<xsl:text> </xsl:text> + + </xsl:when> + <xsl:otherwise> + <xsl:apply-templates select="*|@*|text()|comment()" /> + </xsl:otherwise> + </xsl:choose> +</xsl:when> + + <xsl:when test=" + (@class = 'mfrac') + and + child::span[ @class = 'mrow-enumerator' ] + / child::span[ @class = 'continuous-mfrac' ] + and + ( normalize-space( + child::span[ @class = 'mrow-numerator' ] + ) + = + normalize-space( + child::span[ @class = 'mrow-enumerator' ] + / child::span[ @class = 'continuous-mfrac' ] + / child::span[ @class = 'mrow-numerator' ] + ) + ) + and ( + normalize-space( + child::span[ @class = 'mrow-enumerator' ] / + child::span[ @class = 'mfrac' ] / + preceding-sibling::*[1] ) + = + normalize-space( + child::span[ @class = 'mrow-enumerator' ] / + child::span[ @class = 'mfrac' ] / + child::span[ @class = 'mrow-enumerator' ] / + child::span[ @class = 'continuous-mfrac' ] / + preceding-sibling::*[1] ) +) + +" > + <xsl:variable name="a"> + <xsl:apply-templates select=" + child::span[ @class = 'mrow-enumerator' ] / + child::span[ @class = 'mcontinuous-mfrac' ] / + preceding-sibling::*[2] + " mode="enum-op" /> +</xsl:variable> +<xsl:variable name="b"> + <xsl:apply-templates select=" + child::span[ @class = 'mrow-enumerator' ] / + child::span[ @class = 'mcontinuous-mfrac' ] / + child::span[ @class = 'mrow-enumerator' ] / + child::span[ + (@class = 'mfrac') or (@class = 'mcontinuous-mfrac') + ] / + preceding-sibling::*[2] + " mode="enum-op" /> +</xsl:variable> + + <xsl:choose> + <xsl:when test=" + normalize-space($a)=normalize-space($b) + " > + <xsl:attribute name="class"> + <xsl:value-of select=" 'continuous-mfrac' " /> + </xsl:attribute> + <xsl:apply-templates select="*|text()|comment()" /> + </xsl:when> + <xsl:otherwise> + <xsl:apply-templates select="*|@*|text()|comment()" /> + </xsl:otherwise> + </xsl:choose> +</xsl:when> + + <xsl:when test=" + (translate( + normalize-space( + child::span[ @class = 'mrow-numerator' ]), + '0123456789','')= '') + and ( normalize-space( + child::span[ @class = 'mrow-numerator' ]) + and + normalize-space( + child::span[ @class = 'mrow-enumerator' ] / + child::span[ @class = 'mfrac' ] / + child::span[ @class = 'mrow-numerator' ]) +) +and +( normalize-space( + child::span[ @class = 'mrow-enumerator' ] / + child::span[ @class = 'mfrac' ] / + child::span[ @class = 'mrow-numerator' ]) + and + normalize-space( + child::span[ @class = 'mrow-enumerator' ] / + child::span[ @class = 'mfrac' ] / + child::span[ @class = 'mrow-enumerator' ] / + child::span[ @class = 'mfrac' ] / + child::span[ @class = 'mrow-numerator' ]) +) + + and ( child::span[ @class = 'mrow-enumerator' ] / + child::span[ @class = 'mfrac' ] / + preceding-sibling::*[1][@class = 'mo-bin'] +) +and +( normalize-space( + child::span[ @class = 'mrow-enumerator' ] / + child::span[ @class = 'mfrac' ] / + preceding-sibling::*[1] ) + = + normalize-space( + child::span[ @class = 'mrow-enumerator' ] / + child::span[ @class = 'mfrac' ] / + child::span[ @class = 'mrow-enumerator' ] / + child::span[ @class = 'mfrac' ] / + preceding-sibling::*[1] ) +) + +"> + <xsl:variable name="a"> + <xsl:apply-templates select=" + child::span[ @class = 'mrow-enumerator' ] / + child::span[ @class = 'mfrac' ] / + preceding-sibling::*[2] + " mode="enum-op" /> +</xsl:variable> +<xsl:variable name="b"> + <xsl:apply-templates select=" + child::span[ @class = 'mrow-enumerator' ] / + child::span[ @class = 'mfrac' ] / + child::span[ @class = 'mrow-enumerator' ] / + child::span[ @class = 'mfrac' ] / + preceding-sibling::*[2] + " mode="enum-op" /> +</xsl:variable> +<xsl:variable name="c"> + <xsl:value-of select=" + normalize-space( + child::span[ @class = 'mrow-enumerator' ] / + child::span[ @class = 'mfrac' ] / + child::span[ @class = 'mrow-enumerator' ] / + child::span[ @class = 'mfrac' ] / + child::span[ @class = 'mrow-enumerator' ] ) + " /> +</xsl:variable> + + <xsl:choose> + <xsl:when test=" + ( translate($a,'0123456789 ','') = '') + and (normalize-space($a)=normalize-space($b)) + and starts-with( $c, normalize-space( $a )) + and starts-with( + normalize-space( + substring-after( $c, normalize-space( $a )) ) + , + normalize-space( + child::span[ @class = 'mrow-enumerator' ] / + child::span[ @class = 'mfrac' ] / + preceding-sibling::*[1] ) + ) + " > + <xsl:attribute name="class"> + <xsl:value-of select=" 'continuous-mfrac' " /> + </xsl:attribute> + <xsl:apply-templates select="*|text()|comment()" /> + </xsl:when> + <xsl:otherwise> + <xsl:apply-templates select="*|@*|text()|comment()" /> + </xsl:otherwise> + </xsl:choose> +</xsl:when> + + <xsl:otherwise> + <xsl:apply-templates select="*|@*|text()|comment()" /> + </xsl:otherwise> + </xsl:choose> + </xsl:copy> +</xsl:template> +<xsl:template match="*" mode="enum-op"> + <xsl:if test="preceding-sibling::*" > + <xsl:apply-templates select=" preceding-sibling::*[1] " /> + </xsl:if> + <xsl:value-of select="." /> +</xsl:template> + + <xsl:template match="*|@*|text()|comment()" > + <xsl:copy> + <xsl:apply-templates select="*|@*|text()|comment()" /> + </xsl:copy> + </xsl:template> + </xsl:stylesheet> +]]> + + </set> + <xslt name="." xml="." xsl="mfrac" /> +</script> + + <script element="span::munder-underline" > + <set name="munder" > + <![CDATA[ + <xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + > + <xsl:output omit-xml-declaration = "yes" /> + + <xsl:template match="*" mode="content" > + <xsl:choose> + <xsl:when test=" @class = 'char' " > + <xsl:text>x</xsl:text> + </xsl:when> + <xsl:when test=" not( + (@title = 'speech-extra') or (@class = 'accent-char') + ) " > + <xsl:apply-templates select="*|text()" mode="content" /> + </xsl:when> + </xsl:choose> +</xsl:template> + + <xsl:template match="span[ + (@class = 'munder-underline') + and + child::span[ + (@class = 'mo-0332') + and + descendant::span[ @class = 'mi' ] + ] +]" > + <xsl:copy> + <xsl:apply-templates select="@*" /> + <xsl:variable name="content"> + <xsl:apply-templates select="*" mode="content" /> + </xsl:variable> + <xsl:choose> + <xsl:when test=" + string-length( normalize-space( $content )) = 1 + " > + <xsl:apply-templates + select=" *[ @class != 'begin-end' ] " /> + <span class="begin-end" title="speech-extra" > + <xsl:text> under bar </xsl:text> + </span> + </xsl:when> + <xsl:otherwise> + <xsl:apply-templates select="*|text()|comment()" /> + </xsl:otherwise> + </xsl:choose> + </xsl:copy> +</xsl:template> + + <xsl:template match="*|@*|text()|comment()" > + <xsl:copy> + <xsl:apply-templates select="*|@*|text()|comment()" /> + </xsl:copy> + </xsl:template> + </xsl:stylesheet> +]]> + + </set> + <xslt name="." xml="." xsl="munder" /> +</script> +<script element="span::mover-overline" > + <set name="mover" > + <![CDATA[ + <xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + > + <xsl:output omit-xml-declaration = "yes" /> + + <xsl:template match="*" mode="content" > + <xsl:choose> + <xsl:when test=" @class = 'char' " > + <xsl:text>x</xsl:text> + </xsl:when> + <xsl:when test=" not( + (@title = 'speech-extra') or (@class = 'accent-char') + ) " > + <xsl:apply-templates select="*|text()" mode="content" /> + </xsl:when> + </xsl:choose> +</xsl:template> + + <xsl:template match="span[ + (@class = 'mover-overline') + and + child::span[ + (@class = 'mo-00AF') + and + descendant::span[ @class = 'mi' ] + ] +]" > + <xsl:copy> + <xsl:apply-templates select="@*" /> + <xsl:variable name="content"> + <xsl:apply-templates select="*" mode="content" /> + </xsl:variable> + <xsl:choose> + <xsl:when test=" + string-length( normalize-space( $content )) = 1 + " > + <xsl:apply-templates + select=" *[ @class != 'begin-end' ] " /> + <span class="begin-end" title="speech-extra" > + <xsl:text> over bar </xsl:text> + </span> + </xsl:when> + <xsl:otherwise> + <xsl:apply-templates select="*|text()|comment()" /> + </xsl:otherwise> + </xsl:choose> + </xsl:copy> +</xsl:template> + + <xsl:template match="*|@*|text()|comment()" > + <xsl:copy> + <xsl:apply-templates select="*|@*|text()|comment()" /> + </xsl:copy> + </xsl:template> + </xsl:stylesheet> +]]> + + </set> + <xslt name="." xml="." xsl="mover" /> +</script> + + <script element="span::limits-msub-msup" > + <set name="smash" > + <![CDATA[ + <xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + > + <xsl:output omit-xml-declaration = "yes" /> + + <xsl:template match="span[ + (@class = 'limits-msub-msup') + and + child::*[ (position() = 1) + and (@class = 'limits-mrow-base') + and child::*[ (position() = 1) + and (@class = 'limits-msub-msup') + ] ] +]" > + <xsl:copy> + <xsl:apply-templates select="@*" /> + <xsl:apply-templates select=" + *[1] + / *[1] + / *[ not(@class='limits-mrow-super') ] " /> + <xsl:apply-templates select=" *[ + preceding-sibling::* + and + not(@class='limits-mrow-super') ]" /> + <xsl:apply-templates select=" + *[1] + / *[1] + / *[@class='limits-mrow-super' ] " /> + <xsl:apply-templates select=" *[ + preceding-sibling::* + and + (@class='limits-mrow-super') ]" /> + </xsl:copy> +</xsl:template> + + <xsl:template match="*|@*|text()|comment()" > + <xsl:copy> + <xsl:apply-templates select="*|@*|text()|comment()" /> + </xsl:copy> + </xsl:template> + </xsl:stylesheet> +]]> + + </set> + <xslt name="." xml="." xsl="smash" /> +</script> + + <script element="span::mathvariant-bold" > + <set name="bold" > + <![CDATA[ + <xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + > + <xsl:output omit-xml-declaration = "yes" /> + + <xsl:template match="*" mode="content" > + <xsl:choose> + <xsl:when test=" @class = 'char' " > + <xsl:text>x</xsl:text> + </xsl:when> + <xsl:when test=" not( + (@title = 'speech-extra') or (@class = 'accent-char') + ) " > + <xsl:apply-templates select="*|text()" mode="content" /> + </xsl:when> + </xsl:choose> +</xsl:template> + + <xsl:template match="span[ @class = 'mathvariant-bold' ]" > + <xsl:copy> + <xsl:apply-templates select="@*" /> + <xsl:variable name="content"> + <xsl:apply-templates select="*" mode="content" /> + </xsl:variable> + <xsl:choose> + <xsl:when test=" + string-length( normalize-space( $content )) = 1 + " > + <span class="begin-end" title="speech-extra" > + <xsl:text> bold </xsl:text> + </span> + <xsl:apply-templates select="*|text()|comment()" /> + </xsl:when> + <xsl:otherwise> + <span class="begin-end" title="speech-extra" > + <xsl:text> begin bold </xsl:text> + </span> + <xsl:apply-templates select="*|text()|comment()" /> + <span class="begin-end" title="speech-extra" > + <xsl:text> end bold </xsl:text> + </span> + </xsl:otherwise> + </xsl:choose> + </xsl:copy> +</xsl:template> + + <xsl:template match="*|@*|text()|comment()" > + <xsl:copy> + <xsl:apply-templates select="*|@*|text()|comment()" /> + </xsl:copy> + </xsl:template> + </xsl:stylesheet> +]]> + + </set> + <xslt name="." xml="." xsl="bold" /> +</script> + + <script element="span::mi" > + <set name="math-cap" > + <![CDATA[ + <xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + > + <xsl:output omit-xml-declaration = "yes" /> + + <xsl:template match="span[ @class = 'mi' ]" > + <xsl:copy> + <xsl:apply-templates select="@*" /> + <xsl:if test=" string-length(.) = 1 " > + <xsl:if test=" + (translate(.,'ABCDEFGHIJKLMNOPQRSTUVWXYZ', + '') = '' ) + " > + <span class="capital-description" + title="speech-extra" > + <xsl:text> capital </xsl:text> + </span> + </xsl:if> + </xsl:if> + <xsl:apply-templates select="*|text()|comment()" /> + </xsl:copy> +</xsl:template> + + <xsl:template match="*|@*|text()|comment()" > + <xsl:copy> + <xsl:apply-templates select="*|@*|text()|comment()" /> + </xsl:copy> + </xsl:template> + </xsl:stylesheet> +]]> + + </set> + <xslt name="." xml="." xsl="math-cap" /> +</script> + + <script element="div::tr" > + <set name="bold" > + <![CDATA[ + <xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + > + <xsl:output omit-xml-declaration = "yes" /> + + <xsl:template match="div[ + parent::div[ @class = 'tr' ] + and ( normalize-space(.) = '' ) + and not( normalize-space(following-sibling::*) != '' ) +]" > +</xsl:template> + + <xsl:template match="*|@*|text()|comment()" > + <xsl:copy> + <xsl:apply-templates select="*|@*|text()|comment()" /> + </xsl:copy> + </xsl:template> + </xsl:stylesheet> +]]> + + </set> + <xslt name="." xml="." xsl="bold" /> +</script> + + <script element="span::inline-math" > + <set name="num-sub" > + <![CDATA[ + <xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + > + <xsl:output omit-xml-declaration = "yes" /> + + <xsl:template match="span[ + (@class = 'msub') + and + (count( child::span[ @class = 'mrow-base' ] + / child::* ) = 1 ) + and not( ancestor::*[ + (@class = 'msub') + or + (@class = 'msup') + or + (@class = 'msubsup') + ] ) + and + not( child::span[ @class = 'mrow-sub' ] + / child::* [ + not( @title = 'speech-extra' ) + and + not( @class = 'mn' ) + and + not( + (@class = 'mo-punc') + and + ( . = ',' ) + and + preceding-sibling::*[1][ @class = 'mn' ] + and + following-sibling::*[1][ @class = 'mn' ] + and + following-sibling::*[2][ @class = 'mn' ] + and + following-sibling::*[3][ @class = 'mn' ] + and + ( not(following-sibling::*[4]) + or + not(following-sibling::*[4][ @class = 'mn' ]) + ) + ) + and + not( + (@class = 'mo-punc') + and + ( . = '.' ) + and + following-sibling::*[1][ @class = 'mn' ] + and + not( + following-sibling::*[ + (@class = 'mo-punc') + and + (. = '.') + ] + ) + ) + ]) +]" > + <xsl:copy> + <xsl:apply-templates select="@*" /> + <xsl:apply-templates select="*[1]" /> + <span class="mrow-sub"> + <span class="space" title="speech-extra"> + <xsl:text> </xsl:text> + </span> + <xsl:apply-templates + select="*[2] / *[ + not(@title = 'speech-extra') + and + not( + (@class = 'mo-punc') + and (. = ',') + ) + ]" /> + </span> + </xsl:copy> +</xsl:template> + + <xsl:template match="*|@*|text()|comment()" > + <xsl:copy> + <xsl:apply-templates select="*|@*|text()|comment()" /> + </xsl:copy> + </xsl:template> + </xsl:stylesheet> +]]> + + </set> + <xslt name="." xml="." xsl="num-sub" /> + + <dom name="." xml="." method="fracLevel" class="tex4ht.HtSpk" /> +<set name="rmXmlDecl" > + <![CDATA[ + <xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + > + <xsl:output omit-xml-declaration = "yes" /> + + <xsl:template match="*|@*|text()|comment()" > + <xsl:copy> + <xsl:apply-templates select="*|@*|text()|comment()" /> + </xsl:copy> + </xsl:template> + </xsl:stylesheet> +]]> + +</set> +<xslt name="." xml="." xsl="rmXmlDecl" /> + + + <dom name="." xml="." method="scriptLevel" class="tex4ht.HtSpk" /> +<set name="rmXmlDecl" > + <![CDATA[ + <xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + > + <xsl:output omit-xml-declaration = "yes" /> + + <xsl:template match="*|@*|text()|comment()" > + <xsl:copy> + <xsl:apply-templates select="*|@*|text()|comment()" /> + </xsl:copy> + </xsl:template> + </xsl:stylesheet> +]]> + +</set> +<xslt name="." xml="." xsl="rmXmlDecl" /> + + + <dom name="." xml="." method="rootLevel" class="tex4ht.HtSpk" /> +<set name="rmXmlDecl" > + <![CDATA[ + <xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + > + <xsl:output omit-xml-declaration = "yes" /> + + <xsl:template match="*|@*|text()|comment()" > + <xsl:copy> + <xsl:apply-templates select="*|@*|text()|comment()" /> + </xsl:copy> + </xsl:template> + </xsl:stylesheet> +]]> + +</set> +<xslt name="." xml="." xsl="rmXmlDecl" /> + + + <set name="inline-math" > + <![CDATA[ + <xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + > + <xsl:output omit-xml-declaration = "yes" /> + + <xsl:template match="*" mode="content" > + <xsl:choose> + <xsl:when test=" @class = 'char' " > + <xsl:text>x</xsl:text> + </xsl:when> + <xsl:when test=" not( + (@title = 'speech-extra') or (@class = 'accent-char') + ) " > + <xsl:apply-templates select="*|text()" mode="content" /> + </xsl:when> + </xsl:choose> +</xsl:template> + +<xsl:template match="span[ + (@class = 'end-script') + and + ancestor::* [ following-sibling::* [ + not( @class = 'content-less' ) + ] + ][1] + / following-sibling::* [ + not( @class = 'content-less' ) + ][1] + / self::* + [ + (@class = 'end-math') + or + (@class = 'end-script') + or + (@class = 'end-root') + or + (@class = 'end-stack') + or + (@class = 'mid-stack') + or + (@class = 'end-array') + or + (@class = 'tr') + or + (@title = 'implicit-baseline') + ] +]" > +</xsl:template> + +<xsl:template match="span[ + ((@class = 'mfrac') and + (translate( + concat( + span[ (@class = 'mrow-numerator')], + span[ (@class = 'mrow-enumerator')] + ) ,'0123456789','') = '') + and + not(descendant::*/descendant::*/descendant::*) + or + (@class = 'word-frac')) + and + preceding-sibling::*[1] + / self::span[ @class = 'mn'] + ]" > + <xsl:text> and </xsl:text> + <xsl:copy> + <xsl:apply-templates select="*|@*|text()|comment()" /> + </xsl:copy> +</xsl:template> + +<xsl:template match="span[ + (@class = 'mo-bin') + and + ( preceding-sibling::*[ + (position()=1) + and + ( (@title='speech-extra') + or (@class='mo-bin') + or (@class='mo-rel') ) + ] + and + ( + following-sibling::*[ (@class='mn') or (@class='mi') ] + or + (count(following-sibling::*[ + not(@title = 'speech-extra') + ]) = 1) + ) + or + not(preceding-sibling::*) + ) + and + (normalize-space(.)='minus') +]" > + <xsl:copy> + <xsl:attribute name="class"> + <xsl:text>mo-unary</xsl:text> + </xsl:attribute> + <xsl:apply-templates select="*|text()|comment()" + mode="minus-neg" /> + </xsl:copy> +</xsl:template> +<xsl:template match="*|@*|text()|comment()" mode="minus-neg" > + <xsl:copy> + <xsl:apply-templates select="*|@*|text()|comment()" + mode="minus-neg" /> + </xsl:copy> +</xsl:template> +<xsl:template match="text()" mode="minus-neg" > + <xsl:choose> + <xsl:when test=" . = 'minus' " > + <xsl:text>negative</xsl:text> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="." /> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + +<xsl:template match="span[ @class = 'end-limits-script' ]" > + <xsl:if test=" parent::*[ not(following-sibling::*) ] "> + <xsl:copy> + <xsl:apply-templates select=" @* " /> + <xsl:choose> + <xsl:when test=" + parent::*[ preceding-sibling::span[ + @class != 'limits-mrow-base' + ] ] + " > + <xsl:text> end scripts </xsl:text> + </xsl:when> + <xsl:otherwise> + <xsl:text> end script </xsl:text> + </xsl:otherwise> + </xsl:choose> + </xsl:copy> + </xsl:if> +</xsl:template> +<xsl:template match="span[ @class = 'begin-limits-script' ]" > + <xsl:copy> + <xsl:apply-templates select=" @* " /> + <xsl:choose> + <xsl:when test=" + parent::*[ @class = 'limits-mrow-super' ] + " > + <xsl:apply-templates + select=" parent::* + / preceding-sibling::*[1] " + mode = "extra-over" /> + </xsl:when> + <xsl:when test=" + parent::*[ @class = 'limits-mrow-sub' ] + " > + <xsl:apply-templates + select=" parent::* + / preceding-sibling::*[1] " + mode = "extra-under" /> + </xsl:when> + </xsl:choose> + <xsl:apply-templates select="*|text()|comment()" /> + </xsl:copy> +</xsl:template> +<xsl:template match="*" mode="extra-over" > + <xsl:if test = " self::span[ @class = 'limits-mrow-super' ] " > + <xsl:text> over </xsl:text> + <xsl:apply-templates select=" preceding-sibling::*[1] " + mode = "extra-over" /> + </xsl:if> +</xsl:template> +<xsl:template match="*" mode="extra-under" > + <xsl:if test = " self::span[ @class = 'limits-mrow-sub' ] " > + <xsl:text> under </xsl:text> + <xsl:apply-templates select=" preceding-sibling::*[1] " + mode = "extra-under" /> + </xsl:if> +</xsl:template> + +<xsl:template match="span[ + (@class = 'begin-script') + and + following-sibling::*[ + child::span / child::span[ + (@class = 'ch 2032') or (@class = 'ch 2033') + or (@class = 'ch 2034') + ] ] +]" > +</xsl:template> +<xsl:template match="span[ + (@class = 'end-script') + and + preceding-sibling::*[ + child::span / child::span[ + (@class = 'ch 2032') or (@class = 'ch 2033') + or (@class = 'ch 2034') + ] ] +]" > +</xsl:template> + + + <xsl:template match="span[ + (@class = 'inline-math') + and + (count( child::*[ not(@title) or (@title != 'speech-extra') ] + ) = 1) +]" > + <xsl:copy> + <xsl:variable name="content"> + <xsl:apply-templates + select="child::*[ not(@title) or (@title != 'speech-extra') ] +" + mode="content" /> + </xsl:variable> + <xsl:choose> + <xsl:when test=" + string-length( normalize-space( $content )) = 1 + " > + <xsl:attribute name="class"> + <xsl:text>semi-math</xsl:text> + </xsl:attribute> + <xsl:apply-templates select="child::*[ not(@title) or (@title != 'speech-extra') ] +" /> + </xsl:when> + <xsl:when test=" child::*[ + (position() = 2) + and + ((@class = 'msub') or (@class = 'msup') or (@class = 'msubsup')) +]" > + <xsl:variable name="content"> + <xsl:apply-templates select="child::*[2] / child::*[ + @class = 'mrow-base' ]" + mode="content" /> + </xsl:variable> + <xsl:choose> + <xsl:when test=" + string-length( normalize-space( $content )) = 1 + " > + <xsl:attribute name="class"> + <xsl:text>semi-math</xsl:text> + </xsl:attribute> + <xsl:apply-templates select="*[2]" /> + + </xsl:when> + <xsl:otherwise> + <xsl:apply-templates select="*|@*|comment()|text()" /> + </xsl:otherwise> + </xsl:choose> +</xsl:when> + + <xsl:otherwise> + <xsl:apply-templates select="*|@*|comment()|text()" /> + </xsl:otherwise> + </xsl:choose> + </xsl:copy> +</xsl:template> + + <xsl:template match="*|@*|text()|comment()" > + <xsl:copy> + <xsl:apply-templates select="*|@*|text()|comment()" /> + </xsl:copy> + </xsl:template> + </xsl:stylesheet> +]]> + + </set> + <xslt name="." xml="." xsl="inline-math" /> + <set name="inline-math-2" > + <![CDATA[ + <xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + > + <xsl:output omit-xml-declaration = "yes" /> + + <xsl:template match="*" mode="content" > + <xsl:choose> + <xsl:when test=" @class = 'char' " > + <xsl:text>x</xsl:text> + </xsl:when> + <xsl:when test=" not( + (@title = 'speech-extra') or (@class = 'accent-char') + ) " > + <xsl:apply-templates select="*|text()" mode="content" /> + </xsl:when> + </xsl:choose> +</xsl:template> + +<xsl:template match="span[ + (@class = 'end-script') + and + ancestor::*[ preceding-sibling::* [ + ((@class = 'begin-script') or (@class = 'mid-script')) ]] + +]" > + <xsl:copy> + <xsl:apply-templates select="*|@*|comment()" /> + <xsl:value-of select=" + ancestor::*[ preceding-sibling::* [ + ((@class = 'begin-script') or + (@class = 'mid-script')) ]] [1] + / preceding-sibling::* [ + ((@class = 'begin-script') or + (@class = 'mid-script')) ][1] + " /> + </xsl:copy> +</xsl:template> + +<xsl:template match="span[ @class = 'mi' ]" > + <span class="space" title="speech-extra"> + <xsl:text> </xsl:text> + </span> + <xsl:copy> + <xsl:apply-templates select="*|@*|text()|comment()" /> + </xsl:copy> +</xsl:template> + +<xsl:template match="span[ + (@class = 'begin-script') + and + following-sibling::* [1] / child::*[ + (position() = 1) + and + (@class = 'mrow-base') + and + ( normalize-space(.) = '' ) + ] +]" > +</xsl:template> + + + <xsl:template match="span[ + (@class = 'inline-math') + and + (count( child::*[ not(@title) or (@title != 'speech-extra') ] + ) = 2) + and + child::span[ + (@class = 'mo-unary') + and + following-sibling::*[1] + / descendant::span[ @class = 'mi' ] + ] +]" > + <xsl:copy> + <xsl:variable name="content"> + <xsl:apply-templates + select="child::*[ + (not(@title) or (@title != 'speech-extra')) + and not( @class = 'mo-unary' ) + ]" + mode="content" /> + </xsl:variable> + <xsl:choose> + <xsl:when test=" + string-length( normalize-space( $content )) = 1 + " > + <xsl:attribute name="class"> + <xsl:text>semi-math</xsl:text> + </xsl:attribute> + <xsl:apply-templates select="child::*[ not(@title) or (@title != 'speech-extra') ] +" /> + </xsl:when> + <xsl:otherwise> + <xsl:apply-templates select="*|@*|comment()|text()" /> + </xsl:otherwise> + </xsl:choose> + </xsl:copy> +</xsl:template> + + <xsl:template match="*|@*|text()|comment()" > + <xsl:copy> + <xsl:apply-templates select="*|@*|text()|comment()" /> + </xsl:copy> + </xsl:template> + </xsl:stylesheet> +]]> + + </set> + <xslt name="." xml="." xsl="inline-math-2" /> + <set name="empty-el" > + <![CDATA[ + <xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + > + <xsl:output omit-xml-declaration = "yes" /> + + <xsl:template match="*[ not(child::*) ]" > + <xsl:copy> + <xsl:apply-templates select="@*|comment()|text()" /> + <xsl:if test=" normalize-space(.) = '' " > + <xsl:comment>.</xsl:comment> + </xsl:if> + </xsl:copy> +</xsl:template> + + <xsl:template match="*|@*|text()|comment()" > + <xsl:copy> + <xsl:apply-templates select="*|@*|text()|comment()" /> + </xsl:copy> + </xsl:template> + </xsl:stylesheet> +]]> + +</set> +<xslt name="." xml="." xsl="empty-el" /> + +</script> + + <script element="div::display-math" > + <set name="num-sub" > + <![CDATA[ + <xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + > + <xsl:output omit-xml-declaration = "yes" /> + + <xsl:template match="span[ + (@class = 'msub') + and + (count( child::span[ @class = 'mrow-base' ] + / child::* ) = 1 ) + and not( ancestor::*[ + (@class = 'msub') + or + (@class = 'msup') + or + (@class = 'msubsup') + ] ) + and + not( child::span[ @class = 'mrow-sub' ] + / child::* [ + not( @title = 'speech-extra' ) + and + not( @class = 'mn' ) + and + not( + (@class = 'mo-punc') + and + ( . = ',' ) + and + preceding-sibling::*[1][ @class = 'mn' ] + and + following-sibling::*[1][ @class = 'mn' ] + and + following-sibling::*[2][ @class = 'mn' ] + and + following-sibling::*[3][ @class = 'mn' ] + and + ( not(following-sibling::*[4]) + or + not(following-sibling::*[4][ @class = 'mn' ]) + ) + ) + and + not( + (@class = 'mo-punc') + and + ( . = '.' ) + and + following-sibling::*[1][ @class = 'mn' ] + and + not( + following-sibling::*[ + (@class = 'mo-punc') + and + (. = '.') + ] + ) + ) + ]) +]" > + <xsl:copy> + <xsl:apply-templates select="@*" /> + <xsl:apply-templates select="*[1]" /> + <span class="mrow-sub"> + <span class="space" title="speech-extra"> + <xsl:text> </xsl:text> + </span> + <xsl:apply-templates + select="*[2] / *[ + not(@title = 'speech-extra') + and + not( + (@class = 'mo-punc') + and (. = ',') + ) + ]" /> + </span> + </xsl:copy> +</xsl:template> + + <xsl:template match="*|@*|text()|comment()" > + <xsl:copy> + <xsl:apply-templates select="*|@*|text()|comment()" /> + </xsl:copy> + </xsl:template> + </xsl:stylesheet> +]]> + + </set> + <xslt name="." xml="." xsl="num-sub" /> + + <dom name="." xml="." method="fracLevel" class="tex4ht.HtSpk" /> +<set name="rmXmlDecl" > + <![CDATA[ + <xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + > + <xsl:output omit-xml-declaration = "yes" /> + + <xsl:template match="*|@*|text()|comment()" > + <xsl:copy> + <xsl:apply-templates select="*|@*|text()|comment()" /> + </xsl:copy> + </xsl:template> + </xsl:stylesheet> +]]> + +</set> +<xslt name="." xml="." xsl="rmXmlDecl" /> + + + <dom name="." xml="." method="scriptLevel" class="tex4ht.HtSpk" /> +<set name="rmXmlDecl" > + <![CDATA[ + <xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + > + <xsl:output omit-xml-declaration = "yes" /> + + <xsl:template match="*|@*|text()|comment()" > + <xsl:copy> + <xsl:apply-templates select="*|@*|text()|comment()" /> + </xsl:copy> + </xsl:template> + </xsl:stylesheet> +]]> + +</set> +<xslt name="." xml="." xsl="rmXmlDecl" /> + + + <dom name="." xml="." method="rootLevel" class="tex4ht.HtSpk" /> +<set name="rmXmlDecl" > + <![CDATA[ + <xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + > + <xsl:output omit-xml-declaration = "yes" /> + + <xsl:template match="*|@*|text()|comment()" > + <xsl:copy> + <xsl:apply-templates select="*|@*|text()|comment()" /> + </xsl:copy> + </xsl:template> + </xsl:stylesheet> +]]> + +</set> +<xslt name="." xml="." xsl="rmXmlDecl" /> + + + <set name="display-math" > + <![CDATA[ + <xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + > + <xsl:output omit-xml-declaration = "yes" /> + + <xsl:template match="*" mode="content" > + <xsl:choose> + <xsl:when test=" @class = 'char' " > + <xsl:text>x</xsl:text> + </xsl:when> + <xsl:when test=" not( + (@title = 'speech-extra') or (@class = 'accent-char') + ) " > + <xsl:apply-templates select="*|text()" mode="content" /> + </xsl:when> + </xsl:choose> +</xsl:template> + +<xsl:template match="span[ + (@class = 'end-script') + and + ancestor::* [ following-sibling::* [ + not( @class = 'content-less' ) + ] + ][1] + / following-sibling::* [ + not( @class = 'content-less' ) + ][1] + / self::* + [ + (@class = 'end-math') + or + (@class = 'end-script') + or + (@class = 'end-root') + or + (@class = 'end-stack') + or + (@class = 'mid-stack') + or + (@class = 'end-array') + or + (@class = 'tr') + or + (@title = 'implicit-baseline') + ] +]" > +</xsl:template> + +<xsl:template match="span[ + ((@class = 'mfrac') and + (translate( + concat( + span[ (@class = 'mrow-numerator')], + span[ (@class = 'mrow-enumerator')] + ) ,'0123456789','') = '') + and + not(descendant::*/descendant::*/descendant::*) + or + (@class = 'word-frac')) + and + preceding-sibling::*[1] + / self::span[ @class = 'mn'] + ]" > + <xsl:text> and </xsl:text> + <xsl:copy> + <xsl:apply-templates select="*|@*|text()|comment()" /> + </xsl:copy> +</xsl:template> + +<xsl:template match="span[ + (@class = 'mo-bin') + and + ( preceding-sibling::*[ + (position()=1) + and + ( (@title='speech-extra') + or (@class='mo-bin') + or (@class='mo-rel') ) + ] + and + ( + following-sibling::*[ (@class='mn') or (@class='mi') ] + or + (count(following-sibling::*[ + not(@title = 'speech-extra') + ]) = 1) + ) + or + not(preceding-sibling::*) + ) + and + (normalize-space(.)='minus') +]" > + <xsl:copy> + <xsl:attribute name="class"> + <xsl:text>mo-unary</xsl:text> + </xsl:attribute> + <xsl:apply-templates select="*|text()|comment()" + mode="minus-neg" /> + </xsl:copy> +</xsl:template> +<xsl:template match="*|@*|text()|comment()" mode="minus-neg" > + <xsl:copy> + <xsl:apply-templates select="*|@*|text()|comment()" + mode="minus-neg" /> + </xsl:copy> +</xsl:template> +<xsl:template match="text()" mode="minus-neg" > + <xsl:choose> + <xsl:when test=" . = 'minus' " > + <xsl:text>negative</xsl:text> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="." /> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + +<xsl:template match="span[ @class = 'end-limits-script' ]" > + <xsl:if test=" parent::*[ not(following-sibling::*) ] "> + <xsl:copy> + <xsl:apply-templates select=" @* " /> + <xsl:choose> + <xsl:when test=" + parent::*[ preceding-sibling::span[ + @class != 'limits-mrow-base' + ] ] + " > + <xsl:text> end scripts </xsl:text> + </xsl:when> + <xsl:otherwise> + <xsl:text> end script </xsl:text> + </xsl:otherwise> + </xsl:choose> + </xsl:copy> + </xsl:if> +</xsl:template> +<xsl:template match="span[ @class = 'begin-limits-script' ]" > + <xsl:copy> + <xsl:apply-templates select=" @* " /> + <xsl:choose> + <xsl:when test=" + parent::*[ @class = 'limits-mrow-super' ] + " > + <xsl:apply-templates + select=" parent::* + / preceding-sibling::*[1] " + mode = "extra-over" /> + </xsl:when> + <xsl:when test=" + parent::*[ @class = 'limits-mrow-sub' ] + " > + <xsl:apply-templates + select=" parent::* + / preceding-sibling::*[1] " + mode = "extra-under" /> + </xsl:when> + </xsl:choose> + <xsl:apply-templates select="*|text()|comment()" /> + </xsl:copy> +</xsl:template> +<xsl:template match="*" mode="extra-over" > + <xsl:if test = " self::span[ @class = 'limits-mrow-super' ] " > + <xsl:text> over </xsl:text> + <xsl:apply-templates select=" preceding-sibling::*[1] " + mode = "extra-over" /> + </xsl:if> +</xsl:template> +<xsl:template match="*" mode="extra-under" > + <xsl:if test = " self::span[ @class = 'limits-mrow-sub' ] " > + <xsl:text> under </xsl:text> + <xsl:apply-templates select=" preceding-sibling::*[1] " + mode = "extra-under" /> + </xsl:if> +</xsl:template> + +<xsl:template match="span[ + (@class = 'begin-script') + and + following-sibling::*[ + child::span / child::span[ + (@class = 'ch 2032') or (@class = 'ch 2033') + or (@class = 'ch 2034') + ] ] +]" > +</xsl:template> +<xsl:template match="span[ + (@class = 'end-script') + and + preceding-sibling::*[ + child::span / child::span[ + (@class = 'ch 2032') or (@class = 'ch 2033') + or (@class = 'ch 2034') + ] ] +]" > +</xsl:template> + + + <xsl:template match="*|@*|text()|comment()" > + <xsl:copy> + <xsl:apply-templates select="*|@*|text()|comment()" /> + </xsl:copy> + </xsl:template> + </xsl:stylesheet> +]]> + + </set> + <xslt name="." xml="." xsl="display-math" /> + <set name="display-math-2" > + <![CDATA[ + <xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + > + <xsl:output omit-xml-declaration = "yes" /> + + <xsl:template match="*" mode="content" > + <xsl:choose> + <xsl:when test=" @class = 'char' " > + <xsl:text>x</xsl:text> + </xsl:when> + <xsl:when test=" not( + (@title = 'speech-extra') or (@class = 'accent-char') + ) " > + <xsl:apply-templates select="*|text()" mode="content" /> + </xsl:when> + </xsl:choose> +</xsl:template> + +<xsl:template match="span[ + (@class = 'end-script') + and + ancestor::*[ preceding-sibling::* [ + ((@class = 'begin-script') or (@class = 'mid-script')) ]] + +]" > + <xsl:copy> + <xsl:apply-templates select="*|@*|comment()" /> + <xsl:value-of select=" + ancestor::*[ preceding-sibling::* [ + ((@class = 'begin-script') or + (@class = 'mid-script')) ]] [1] + / preceding-sibling::* [ + ((@class = 'begin-script') or + (@class = 'mid-script')) ][1] + " /> + </xsl:copy> +</xsl:template> + +<xsl:template match="span[ @class = 'mi' ]" > + <span class="space" title="speech-extra"> + <xsl:text> </xsl:text> + </span> + <xsl:copy> + <xsl:apply-templates select="*|@*|text()|comment()" /> + </xsl:copy> +</xsl:template> + +<xsl:template match="span[ + (@class = 'begin-script') + and + following-sibling::* [1] / child::*[ + (position() = 1) + and + (@class = 'mrow-base') + and + ( normalize-space(.) = '' ) + ] +]" > +</xsl:template> + + + <xsl:template match="*|@*|text()|comment()" > + <xsl:copy> + <xsl:apply-templates select="*|@*|text()|comment()" /> + </xsl:copy> + </xsl:template> + </xsl:stylesheet> +]]> + + </set> + <xslt name="." xml="." xsl="display-math-2" /> + <set name="empty-el" > + <![CDATA[ + <xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + > + <xsl:output omit-xml-declaration = "yes" /> + + <xsl:template match="*[ not(child::*) ]" > + <xsl:copy> + <xsl:apply-templates select="@*|comment()|text()" /> + <xsl:if test=" normalize-space(.) = '' " > + <xsl:comment>.</xsl:comment> + </xsl:if> + </xsl:copy> +</xsl:template> + + <xsl:template match="*|@*|text()|comment()" > + <xsl:copy> + <xsl:apply-templates select="*|@*|text()|comment()" /> + </xsl:copy> + </xsl:template> + </xsl:stylesheet> +]]> + +</set> +<xslt name="." xml="." xsl="empty-el" /> + +</script> + + + <script element="div::split-side" > + <set name="clean-split" > + <![CDATA[ + <xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + > + <xsl:output omit-xml-declaration = "yes" /> + + <xsl:template match="*" mode="content" > + <xsl:choose> + <xsl:when test=" @class = 'char' " > + <xsl:text>x</xsl:text> + </xsl:when> + <xsl:when test=" not( + (@title = 'speech-extra') or (@class = 'accent-char') + ) " > + <xsl:apply-templates select="*|text()" mode="content" /> + </xsl:when> + </xsl:choose> +</xsl:template> + + <xsl:template match=" div[ @class='split-side' ] +" > + <xsl:variable name="content"> + <xsl:apply-templates select="*" mode="content" /> + </xsl:variable> + <xsl:if test=" + string-length( normalize-space( $content )) != 0 + " > + <xsl:copy> + <xsl:apply-templates select=" *|@*|text()|comment() " /> + </xsl:copy> + </xsl:if> +</xsl:template> + + <xsl:template match="*|@*|text()|comment()" > + <xsl:copy> + <xsl:apply-templates select="*|@*|text()|comment()" /> + </xsl:copy> + </xsl:template> + </xsl:stylesheet> +]]> + + </set> + <xslt name="." xml="." xsl="clean-split" /> +</script> + + <script element="div::newtheorem" > + <set name="newtheorem" > + <![CDATA[ + <xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + > + <xsl:output omit-xml-declaration = "yes" /> + + <xsl:template match=" + div[ (@class='newtheorem') + and + child::*[1] / child::span[ @class = 'theorem-head' ] + ] +" > + <xsl:copy> + <xsl:apply-templates select="*|@*|text()|comment()" /> + <div class="begin-end" title="speech-extra"> + <xsl:value-of select=" + concat( ' end ', + string( child::*[1] / + child::span[ @class = 'theorem-head' ] ) + ) " /> + </div> + </xsl:copy> +</xsl:template> + + <xsl:template match="*[ not(child::*) ]" > + <xsl:copy> + <xsl:apply-templates select="@*|comment()|text()" /> + <xsl:if test=" normalize-space(.) = '' " > + <xsl:comment>.</xsl:comment> + </xsl:if> + </xsl:copy> +</xsl:template> + + <xsl:template match="*|@*|text()|comment()" > + <xsl:copy> + <xsl:apply-templates select="*|@*|text()|comment()" /> + </xsl:copy> + </xsl:template> + </xsl:stylesheet> +]]> + + </set> + <xslt name="." xml="." xsl="newtheorem" /> +</script> + + </sax> +</xtpipes> + diff --git a/Master/texmf-dist/tex4ht/xtpipes/jsml.4xt b/Master/texmf-dist/tex4ht/xtpipes/jsml.4xt new file mode 100755 index 00000000000..c6bb1b41ac3 --- /dev/null +++ b/Master/texmf-dist/tex4ht/xtpipes/jsml.4xt @@ -0,0 +1,2832 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE xtpipes SYSTEM "xtpipes.dtd" > +<xtpipes signature="jsml.4xt (2007-09-01-14:10)"> + <sax content-handler="xtpipes.util.ScriptsManager, tex4ht.GroupMn, tex4ht.JsmlFilter" + lexical-handler="xtpipes.util.ScriptsManagerLH" > + <script element="mn-group" > + <dom name="." xml="." method="mnGroup" class="tex4ht.HtJsml" /> +<set name="rmXmlDecl" > + <![CDATA[ + <xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + > + <xsl:output omit-xml-declaration = "yes" /> + + <xsl:template match="*|@*|text()|comment()" > + <xsl:copy> + <xsl:apply-templates select="*|@*|text()|comment()" /> + </xsl:copy> + </xsl:template> + </xsl:stylesheet> +]]> + +</set> +<xslt name="." xml="." xsl="rmXmlDecl" /> + + + <set name="merge" > + <![CDATA[ + <xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + > + <xsl:output omit-xml-declaration = "yes" /> + + <xsl:template match="mn-group" > + <xsl:choose> + <xsl:when test=" not(child::mn) "> + <xsl:apply-templates select="*|text()" /> + </xsl:when> + <xsl:otherwise> + <mn> + <xsl:value-of select="." /> + </mn> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + + <xsl:template match="*|@*|text()|comment()" > + <xsl:copy> + <xsl:apply-templates select="*|@*|text()|comment()" /> + </xsl:copy> + </xsl:template> + </xsl:stylesheet> +]]> + + </set> + <xslt name="." xml="." xsl="merge" /> +</script> + + <script element="msup" > + <set name="m-sub-sup" > + <![CDATA[ + <xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + > + <xsl:output omit-xml-declaration = "yes" /> + + <xsl:template match="*[ + (self::msup or self::msub or self::msubsup) + and + not( + child::mrow[ @class = 'mrow-sub' ] + / child::*[ not(@title = 'speech-extra') + and + (normalize-space(.) != '') + ] + ) + and + not( + child::mrow[ @class = 'mrow-super' ] + / child::*[ not(@title = 'speech-extra') + and + (normalize-space(.) != '') + ] + ) +]" > + <xsl:apply-templates select="child::mrow[ + @class = 'mrow-base' ]/*" /> +</xsl:template> + + <xsl:template match="*|@*|text()|comment()" > + <xsl:copy> + <xsl:apply-templates select="*|@*|text()|comment()" /> + </xsl:copy> + </xsl:template> + </xsl:stylesheet> +]]> + + </set> + <xslt name="." xml="." xsl="m-sub-sup" /> + <set name="m-sup-2-3" > + <![CDATA[ + <xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + > + <xsl:output omit-xml-declaration = "yes" /> + + <xsl:template match="msup[ + (normalize-space( + child::mrow[ (@class = 'mrow-super') ] + / child::*[ not (@class = 'begin-script') + and + not (@class = 'end-script') + ] + ) = '2') + and not( + child::mrow[ @class = 'mrow-base' ] + / child::span[ not( @title = 'speech-extra' ) ] + [ position() = last() ] + / self::* [ @class = 'mo-op' ] +) + + and (normalize-space(mrow[@class = 'mrow-base']) != '' ) +]" > + <xsl:copy> + <xsl:apply-templates select="*|@*|text()|comment()" + mode="squared" /> + </xsl:copy> +</xsl:template> +<xsl:template match="*|@*|text()|comment()" + mode="squared" > + <xsl:copy> + <xsl:choose> + <xsl:when test=" @class = 'mrow-super' "> + <xsl:apply-templates select="@*" /> + <mo class="mo-op"> + <xsl:text> squared </xsl:text> + </mo> + </xsl:when> + <xsl:otherwise> + <xsl:apply-templates select="*|@*|text()" /> + </xsl:otherwise> + </xsl:choose> + </xsl:copy> +</xsl:template> +<xsl:template match="msup[ + (normalize-space( + child::mrow[ (@class = 'mrow-super') ] + / child::*[ not (@class = 'begin-script') + and + not (@class = 'end-script') + ] + ) = '3') + and not( + child::mrow[ @class = 'mrow-base' ] + / child::span[ not( @title = 'speech-extra' ) ] + [ position() = last() ] + / self::* [ @class = 'mo-op' ] +) + + and (normalize-space(mrow[@class = 'mrow-base']) != '' ) +]" > + <xsl:copy> + <xsl:apply-templates select="*|@*|text()|comment()" + mode="cube" /> + </xsl:copy> +</xsl:template> +<xsl:template match="*|@*|text()|comment()" + mode="cube" > + <xsl:copy> + <xsl:choose> + <xsl:when test=" @class = 'mrow-super' "> + <xsl:apply-templates select="@*" /> + <mo class="mo-op"> + <xsl:text> cube </xsl:text> + </mo> + </xsl:when> + <xsl:otherwise> + <xsl:apply-templates select="*|@*|text()" /> + </xsl:otherwise> + </xsl:choose> + </xsl:copy> +</xsl:template> + + <xsl:template match="*|@*|text()|comment()" > + <xsl:copy> + <xsl:apply-templates select="*|@*|text()|comment()" /> + </xsl:copy> + </xsl:template> + </xsl:stylesheet> +]]> + +</set> +<xslt name="." xml="." xsl="m-sup-2-3" /> + +</script> +<script element="msub" > + <set name="m-sub-sup" > + <![CDATA[ + <xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + > + <xsl:output omit-xml-declaration = "yes" /> + + <xsl:template match="*[ + (self::msup or self::msub or self::msubsup) + and + not( + child::mrow[ @class = 'mrow-sub' ] + / child::*[ not(@title = 'speech-extra') + and + (normalize-space(.) != '') + ] + ) + and + not( + child::mrow[ @class = 'mrow-super' ] + / child::*[ not(@title = 'speech-extra') + and + (normalize-space(.) != '') + ] + ) +]" > + <xsl:apply-templates select="child::mrow[ + @class = 'mrow-base' ]/*" /> +</xsl:template> + + <xsl:template match=" + msub [ + normalize-space(child::*[1]) = 'log' + or + normalize-space(child::*[1]) = 'ln' +]" > + <xsl:copy> + <xsl:apply-templates select="@*" /> + <xsl:apply-templates select="child::*[1]" /> + <xsl:apply-templates select="child::*[2]" + mode="log" /> + </xsl:copy> +</xsl:template> +<xsl:template match="*" mode="log" > + <xsl:copy> + <xsl:apply-templates select="@*" /> + <xsl:choose> + <xsl:when test="parent::mrow[ @class = 'mrow-sub' ]" > + <BREAK SIZE="small"/> + <xsl:apply-templates select="*" /> + <BREAK SIZE="small"/> + <span title="speech-extra"> + <xsl:text>of</xsl:text> + </span> + <BREAK SIZE="small"/> + </xsl:when> + <xsl:otherwise> + <xsl:apply-templates + select="*[ not(@title = 'speech-extra') ]" + mode="log" /> + </xsl:otherwise> + </xsl:choose> + </xsl:copy> +</xsl:template> + + <xsl:template match="*|@*|text()|comment()" > + <xsl:copy> + <xsl:apply-templates select="*|@*|text()|comment()" /> + </xsl:copy> + </xsl:template> + </xsl:stylesheet> +]]> + +</set> +<xslt name="." xml="." xsl="m-sub-sup" /> + +</script> +<script element="msubsup" > + <set name="subsup-prime" > + <![CDATA[ + <xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + > + <xsl:output omit-xml-declaration = "yes" /> + + <xsl:template match="msubsup[ + (count( + child::mrow [ @class='mrow-super' ] + / child::* [ not(@title = 'speech-extra') ] + ) = 1) + and + not( + child::mrow [ @class='mrow-super' ] + / child::* [ not(@title = 'speech-extra') ] + / descendant::*[ preceding-sibling::* + or following-sibling::*] + ) + and + child::mrow [ @class='mrow-super' ] + / child::* [ not(@title = 'speech-extra') ] + / descendant-or-self::span[ @class='char' ] + / child::span[ + (@class = 'ch 2032') or (@class = 'ch 2033') + or (@class = 'ch 2034') + ] +]" > + <msub> + <mrow class="mrow-base"> + <xsl:apply-templates select=" + child::mrow[@class = 'mrow-base'] / * + " /> + <BREAK SIZE="small"/> + <xsl:apply-templates select=" + child::mrow[@class = 'mrow-super'] + / child::* [ not(@title = 'speech-extra') ] + " /> + </mrow> + <mrow class="mrow-sub"> + <xsl:apply-templates + select="*[@class = 'mrow-sub'] /* " /> + <xsl:apply-templates select=" + child::mrow[@class = 'mrow-super'] + / child::* [ @class = 'end-script' ] + " /> + </mrow> + </msub> +</xsl:template> + + <xsl:template match="*|@*|text()|comment()" > + <xsl:copy> + <xsl:apply-templates select="*|@*|text()|comment()" /> + </xsl:copy> + </xsl:template> + </xsl:stylesheet> +]]> + +</set> +<xslt name="." xml="." xsl="subsup-prime" /> + + <set name="m-sub-sup" > + <![CDATA[ + <xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + > + <xsl:output omit-xml-declaration = "yes" /> + + <xsl:template match="*[ + (self::msup or self::msub or self::msubsup) + and + not( + child::mrow[ @class = 'mrow-sub' ] + / child::*[ not(@title = 'speech-extra') + and + (normalize-space(.) != '') + ] + ) + and + not( + child::mrow[ @class = 'mrow-super' ] + / child::*[ not(@title = 'speech-extra') + and + (normalize-space(.) != '') + ] + ) +]" > + <xsl:apply-templates select="child::mrow[ + @class = 'mrow-base' ]/*" /> +</xsl:template> + + <xsl:template match="*|@*|text()|comment()" > + <xsl:copy> + <xsl:apply-templates select="*|@*|text()|comment()" /> + </xsl:copy> + </xsl:template> + </xsl:stylesheet> +]]> + +</set> +<xslt name="." xml="." xsl="m-sub-sup" /> + + <set name="m-subsup-2-3" > + <![CDATA[ + <xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + > + <xsl:output omit-xml-declaration = "yes" /> + + <xsl:template match="msubsup[ + (normalize-space( + child::mrow[ (@class = 'mrow-super') ] + / child::span[ (@class != 'mid-script') + and + (@class != 'end-script') + ] + ) = '2') + and not( + child::mrow[ @class = 'mrow-base' ] + / child::span[ not( @title = 'speech-extra' ) ] + [ position() = last() ] + / self::* [ @class = 'mo-op' ] +) + +]" > + <xsl:copy> + <xsl:attribute name="class" > + <xsl:text>msub</xsl:text> + </xsl:attribute> + <xsl:apply-templates select="*|text()|comment()" + mode="sub-squared" /> + </xsl:copy> +</xsl:template> +<xsl:template match="*|@*|text()|comment()" + mode="sub-squared" > + <xsl:copy> + <xsl:choose> + <xsl:when test=" @class = 'mrow-sub' "> + <xsl:apply-templates select="*[ + not( @class = 'end-script' ) + ] + |@*|text()|comment()" /> + <xsl:apply-templates select=" + following-sibling::*[1] / *[ + @class = 'end-script' + ] " /> + </xsl:when> + <xsl:when test=" @class = 'mrow-super' "> + <xsl:attribute name="class" > + <xsl:text>squared-super</xsl:text> + </xsl:attribute> + <mo class="mo-op"> + <xsl:text> squared </xsl:text> + </mo> + </xsl:when> + <xsl:otherwise> + <xsl:apply-templates select="*|@*|text()|comment()" /> + </xsl:otherwise> + </xsl:choose> + </xsl:copy> +</xsl:template> +<xsl:template match="msubsup[ + (normalize-space( + child::mrow[ (@class = 'mrow-super') ] + / child::span[ (@class != 'mid-script') + and + (@class != 'end-script') + ] + ) = '3') + and not( + child::mrow[ @class = 'mrow-base' ] + / child::span[ not( @title = 'speech-extra' ) ] + [ position() = last() ] + / self::* [ @class = 'mo-op' ] +) + +]" > + <xsl:copy> + <xsl:attribute name="class" > + <xsl:text>msub</xsl:text> + </xsl:attribute> + <xsl:apply-templates select="*|text()|comment()" + mode="sub-cube" /> + </xsl:copy> +</xsl:template> +<xsl:template match="*|@*|text()|comment()" + mode="sub-cube" > + <xsl:copy> + <xsl:choose> + <xsl:when test=" @class = 'mrow-sub' "> + <xsl:apply-templates select="*[ + not( @class = 'end-script' ) + ] + |@*|text()|comment()" /> + <xsl:apply-templates select=" + following-sibling::*[1] / *[ + @class = 'end-script' + ] " /> + </xsl:when> + <xsl:when test=" @class = 'mrow-super' "> + <xsl:attribute name="class" > + <xsl:text>cube-super</xsl:text> + </xsl:attribute> + <mo class="mo-op"> + <xsl:text> cube </xsl:text> + </mo> + </xsl:when> + <xsl:otherwise> + <xsl:apply-templates select="*|@*|text()|comment()" /> + </xsl:otherwise> + </xsl:choose> + </xsl:copy> +</xsl:template> + + <xsl:template match="*|@*|text()|comment()" > + <xsl:copy> + <xsl:apply-templates select="*|@*|text()|comment()" /> + </xsl:copy> + </xsl:template> + </xsl:stylesheet> +]]> + +</set> +<xslt name="." xml="." xsl="m-subsup-2-3" /> + +</script> + + <script element="mfrac" > + <set name="mfrac" > + <![CDATA[ + <xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + > + <xsl:output omit-xml-declaration = "yes" /> + + <xsl:template match="mfrac" > + <xsl:copy> + <xsl:choose> + <xsl:when test=" + (string-length( + normalize-space(child::mrow[ @class = 'mrow-numerator' ][1]) + ) = 1) + and + (string-length( + normalize-space(child::mrow[ @class = 'mrow-enumerator' ][1]) + ) = 1) +"> + <xsl:variable name="a"> + <xsl:value-of select=" + normalize-space(child::mrow[ @class = 'mrow-numerator' ][1]) + " /> +</xsl:variable> +<xsl:variable name="b"> + <xsl:value-of select=" + normalize-space(child::mrow[ @class = 'mrow-enumerator' ][1]) + " /> +</xsl:variable> + + <xsl:choose> + <xsl:when test=" + (translate($a,'123456789','') != '') + or + (translate($b,'123456789','') != '') + " > + <xsl:apply-templates select="*|@*|text()|comment()" /> + </xsl:when> + <xsl:when test=" $a < $b "> + <xsl:attribute name="class"> + <xsl:text>word-frac</xsl:text> + </xsl:attribute> + <xsl:choose> + <xsl:when test=" $a = 1 "><xsl:text> one </xsl:text></xsl:when> + <xsl:when test=" $a = 2 "><xsl:text> two </xsl:text></xsl:when> + <xsl:when test=" $a = 3 "><xsl:text> three </xsl:text></xsl:when> + <xsl:when test=" $a = 4 "><xsl:text> four </xsl:text></xsl:when> + <xsl:when test=" $a = 5 "><xsl:text> five </xsl:text></xsl:when> + <xsl:when test=" $a = 6 "><xsl:text> six </xsl:text></xsl:when> + <xsl:when test=" $a = 7 "><xsl:text> seven </xsl:text></xsl:when> + <xsl:when test=" $a = 8 "><xsl:text> eight </xsl:text></xsl:when> + <xsl:when test=" $a = 9 "><xsl:text> nine </xsl:text></xsl:when> +</xsl:choose> + + <xsl:choose> + <xsl:when test=" $b = 2 "><xsl:text> half</xsl:text></xsl:when> + <xsl:when test=" $b = 3 "><xsl:text> third</xsl:text></xsl:when> + <xsl:when test=" $b = 4 "><xsl:text> fourth</xsl:text></xsl:when> + <xsl:when test=" $b = 5 "><xsl:text> fifth</xsl:text></xsl:when> + <xsl:when test=" $b = 6 "><xsl:text> sixth</xsl:text></xsl:when> + <xsl:when test=" $b = 7 "><xsl:text> seventh</xsl:text></xsl:when> + <xsl:when test=" $b = 8 "><xsl:text> eighth</xsl:text></xsl:when> + <xsl:when test=" $b = 9 "><xsl:text> nineth</xsl:text></xsl:when> +</xsl:choose> +<xsl:if test=" $a > 1 "><xsl:text>s</xsl:text></xsl:if> +<xsl:text> </xsl:text> + + </xsl:when> + <xsl:otherwise> + <xsl:apply-templates select="*|@*|text()|comment()" /> + </xsl:otherwise> + </xsl:choose> +</xsl:when> + + <xsl:when test=" + self::mfrac + and + child::mrow[ @class = 'mrow-enumerator' ] + / child::mfrac[ @class = 'continued-mfrac' ] + and + ( normalize-space( + child::mrow[ @class = 'mrow-numerator' ] + ) + = + normalize-space( + child::mrow[ @class = 'mrow-enumerator' ] + / child::mfrac[ @class = 'continued-mfrac' ] + / child::mrow[ @class = 'mrow-numerator' ] + ) + ) + and ( + normalize-space( + child::span[ @class = 'mrow-enumerator' ] / + child::mfrac / + preceding-sibling::*[1] ) + = + normalize-space( + child::span[ @class = 'mrow-enumerator' ] / + child::mfrac / + child::span[ @class = 'mrow-enumerator' ] / + child::span[ @class = 'continued-mfrac' ] / + preceding-sibling::*[1] ) +) + +" > + <xsl:variable name="a"> + <xsl:apply-templates select=" + child::span[ @class = 'mrow-enumerator' ] / + child::span[ @class = 'mcontinued-mfrac' ] / + preceding-sibling::*[2] + " mode="enum-op" /> +</xsl:variable> +<xsl:variable name="b"> + <xsl:apply-templates select=" + child::span[ @class = 'mrow-enumerator' ] / + child::span[ @class = 'mcontinued-mfrac' ] / + child::span[ @class = 'mrow-enumerator' ] / + child::span[ + self::mfrac or (@class = 'mcontinued-mfrac') + ] / + preceding-sibling::*[2] + " mode="enum-op" /> +</xsl:variable> + + <xsl:choose> + <xsl:when test=" + normalize-space($a)=normalize-space($b) + " > + <xsl:attribute name="class"> + <xsl:value-of select=" 'continued-mfrac' " /> + </xsl:attribute> + <xsl:apply-templates select="*|text()|comment()" /> + </xsl:when> + <xsl:otherwise> + <xsl:apply-templates select="*|@*|text()|comment()" /> + </xsl:otherwise> + </xsl:choose> +</xsl:when> + + <xsl:when test=" + (translate( + normalize-space( + child::mrow[ @class = 'mrow-numerator' ]), + '0123456789','')= '') + and ( normalize-space( + child::mrow[ @class = 'mrow-numerator' ]) + and + normalize-space( + child::mrow[ @class = 'mrow-enumerator' ] / + child::mfrac / + child::mrow[ @class = 'mrow-numerator' ]) +) +and +( normalize-space( + child::mrow[ @class = 'mrow-enumerator' ] / + child::mfrac / + child::mrow[ @class = 'mrow-numerator' ]) + and + normalize-space( + child::mrow[ @class = 'mrow-enumerator' ] / + child::mfrac / + child::mrow[ @class = 'mrow-enumerator' ] / + child::mfrac / + child::mrow[ @class = 'mrow-numerator' ]) +) + + and ( child::mrow[ @class = 'mrow-enumerator' ] / + child::mfrac / + preceding-sibling::*[1][@class = 'MathClass-bin'] +) +and +( normalize-space( + child::mrow[ @class = 'mrow-enumerator' ] / + child::mfrac / + preceding-sibling::*[1] ) + = + normalize-space( + child::mrow[ @class = 'mrow-enumerator' ] / + child::mfrac / + child::mrow[ @class = 'mrow-enumerator' ] / + child::mfrac / + preceding-sibling::*[1] ) +) + +"> + <xsl:variable name="a"> + <xsl:apply-templates select=" + child::mrow[ @class = 'mrow-enumerator' ] / + child::mfrac / + preceding-sibling::*[2] + " mode="enum-op" /> +</xsl:variable> +<xsl:variable name="b"> + <xsl:apply-templates select=" + child::mrow[ @class = 'mrow-enumerator' ] / + child::mfrac / + child::mrow[ @class = 'mrow-enumerator' ] / + child::mfrac / + preceding-sibling::*[2] + " mode="enum-op" /> +</xsl:variable> +<xsl:variable name="c"> + <xsl:value-of select=" + normalize-space( + child::mrow[ @class = 'mrow-enumerator' ] / + child::mfrac / + child::mrow[ @class = 'mrow-enumerator' ] / + child::mfrac / + child::mrow[ @class = 'mrow-enumerator' ] ) + " /> +</xsl:variable> + + <xsl:choose> + <xsl:when test=" + ( translate($a,'0123456789 ','') = '') + and (normalize-space($a)=normalize-space($b)) + and starts-with( $c, normalize-space( $a )) + and starts-with( + normalize-space( + substring-after( $c, normalize-space( $a )) ) + , + normalize-space( + child::mrow[ @class = 'mrow-enumerator' ] / + child::mfrac / + preceding-sibling::*[1] ) + ) + " > + <xsl:attribute name="class"> + <xsl:value-of select=" 'continued-mfrac' " /> + </xsl:attribute> + <xsl:apply-templates select="*|text()|comment()" /> + </xsl:when> + <xsl:otherwise> + <xsl:apply-templates select="*|@*|text()|comment()" /> + </xsl:otherwise> + </xsl:choose> +</xsl:when> + + <xsl:otherwise> + <xsl:apply-templates select="*|@*|text()|comment()" /> + </xsl:otherwise> + </xsl:choose> + </xsl:copy> +</xsl:template> +<xsl:template match="*" mode="enum-op"> + <xsl:if test="preceding-sibling::*" > + <xsl:apply-templates select=" preceding-sibling::*[1] " /> + </xsl:if> + <xsl:value-of select="." /> +</xsl:template> + + <xsl:template match="*|@*|text()|comment()" > + <xsl:copy> + <xsl:apply-templates select="*|@*|text()|comment()" /> + </xsl:copy> + </xsl:template> + </xsl:stylesheet> +]]> + + </set> + <xslt name="." xml="." xsl="mfrac" /> +</script> + + <script element="munder::munder-underline" > + <set name="munder" > + <![CDATA[ + <xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + > + <xsl:output omit-xml-declaration = "yes" /> + + <xsl:template match="*" mode="content" > + <xsl:choose> + <xsl:when test=" @class = 'char' " > + <xsl:if test="not( child::*[ + (@class = 'ch 2032') or (@class = 'ch 2033') + or (@class = 'ch 2034') + ] )"> + <xsl:text>x</xsl:text> + </xsl:if> + </xsl:when> + <xsl:when test=" not( + (@title = 'speech-extra') or (@class = 'accent-char') + ) " > + <xsl:apply-templates select="*|text()" mode="content" /> + </xsl:when> + </xsl:choose> +</xsl:template> + + <xsl:template match="munder[ + (@class = 'munder-underline') + and + child::mrow[ + (@class = 'mo-0332') + and + descendant::mi + ] +]" > + <xsl:variable name="content"> + <xsl:apply-templates select="*" mode="content" /> + </xsl:variable> + <xsl:choose> + <xsl:when test=" + string-length( normalize-space( $content )) = 1 + " > + <xsl:copy> + <xsl:apply-templates select="@*" /> + <xsl:apply-templates + select=" *[ @class != 'begin-end' ] " /> + <span class="begin-end" title="speech-extra" > + <BREAK SIZE="small"/> + <xsl:text> under bar </xsl:text> + <BREAK SIZE="small"/> + </span> + </xsl:copy> + </xsl:when> + <xsl:otherwise> + <xsl:choose> + <xsl:when test="child::mrow / child::mover"> + <xsl:apply-templates select="child::mrow / child::mover" + mode="under-mover" /> + </xsl:when> + <xsl:otherwise> + <xsl:copy> + <xsl:apply-templates select=" *|@*|text() " /> + </xsl:copy> + </xsl:otherwise> +</xsl:choose> + + </xsl:otherwise> + </xsl:choose> +</xsl:template> +<xsl:template match="*" mode="under-mover" > + <xsl:choose> + <xsl:when test="self::mover"> + <xsl:copy> + <xsl:apply-templates select="@*" /> + <xsl:apply-templates select="*" mode="under-mover" /> + </xsl:copy> + </xsl:when> + <xsl:when test="self::mrow[ parent::mover ]"> + <xsl:copy> + <xsl:apply-templates select="@*" /> + <xsl:choose> + <xsl:when test="child::mover"> + <xsl:apply-templates select="*" mode="under-mover" /> + </xsl:when> + <xsl:otherwise> + <munder class="munder-underline"> + <xsl:apply-templates select=" + ancestor::munder[1] / child::*[following-sibling::mrow] +"/> + + <mrow class="mo-0032"> + <xsl:apply-templates select="*" /> + </mrow> + <xsl:apply-templates select=" + ancestor::munder[1] / child::*[preceding-sibling::mrow] +"/> + + </munder> + </xsl:otherwise> +</xsl:choose> + + </xsl:copy> + </xsl:when> + <xsl:otherwise> + <xsl:apply-templates select="." /> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + + <xsl:template match="*|@*|text()|comment()" > + <xsl:copy> + <xsl:apply-templates select="*|@*|text()|comment()" /> + </xsl:copy> + </xsl:template> + </xsl:stylesheet> +]]> + + </set> + <xslt name="." xml="." xsl="munder" /> +</script> +<script element="mover::mover-overline" > + <set name="mover" > + <![CDATA[ + <xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + > + <xsl:output omit-xml-declaration = "yes" /> + + <xsl:template match="*" mode="content" > + <xsl:choose> + <xsl:when test=" @class = 'char' " > + <xsl:if test="not( child::*[ + (@class = 'ch 2032') or (@class = 'ch 2033') + or (@class = 'ch 2034') + ] )"> + <xsl:text>x</xsl:text> + </xsl:if> + </xsl:when> + <xsl:when test=" not( + (@title = 'speech-extra') or (@class = 'accent-char') + ) " > + <xsl:apply-templates select="*|text()" mode="content" /> + </xsl:when> + </xsl:choose> +</xsl:template> + + <xsl:template match="mover[ + (@class = 'mover-overline') + and + child::mrow[ + (@class = 'mo-00AF') + and + descendant::mi + ] +]" > + <xsl:variable name="content"> + <xsl:apply-templates select="*" mode="content" /> + </xsl:variable> + <xsl:choose> + <xsl:when test=" + string-length( normalize-space( $content )) = 1 + " > + <BREAK SIZE="small"/> +<xsl:choose> + <xsl:when test="child::mrow / child::munder"> + <xsl:apply-templates select="child::mrow / child::munder" + mode="under-munder" /> + </xsl:when> + <xsl:otherwise> + <xsl:copy> + <xsl:apply-templates select="@*" /> + <xsl:apply-templates + select=" *[ @class != 'begin-end' ] " /> + <span class="begin-end" title="speech-extra" > + <BREAK SIZE="small"/> + <xsl:text> over bar </xsl:text> + <BREAK SIZE="small"/> +</span> + + </xsl:copy> + </xsl:otherwise> +</xsl:choose> + + </xsl:when> + <xsl:otherwise> + <xsl:copy> + <xsl:apply-templates select="@*" /> + <xsl:apply-templates + select="*|text()|comment()" /> + </xsl:copy> + </xsl:otherwise> + </xsl:choose> +</xsl:template> +<xsl:template match="*" mode="under-munder" > + <xsl:choose> + <xsl:when test="self::munder"> + <xsl:copy> + <xsl:apply-templates select="@*" /> + <xsl:apply-templates select="*" mode="under-munder" /> + </xsl:copy> + </xsl:when> + <xsl:when test="self::mrow[ parent::munder ]"> + <xsl:copy> + <xsl:apply-templates select="@*" /> + <xsl:choose> + <xsl:when test="child::munder"> + <xsl:apply-templates select="*" mode="under-munder" /> + </xsl:when> + <xsl:otherwise> + <mover class="mover-overline"> + <mrow class="mo-00AF"> + <xsl:apply-templates select="*" /> + </mrow> + <span class="begin-end" title="speech-extra" > + <BREAK SIZE="small"/> + <xsl:text> over bar </xsl:text> + <BREAK SIZE="small"/> +</span> + + </mover> + </xsl:otherwise> +</xsl:choose> + + </xsl:copy> + </xsl:when> + <xsl:otherwise> + <xsl:apply-templates select="." /> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + + <xsl:template match="*|@*|text()|comment()" > + <xsl:copy> + <xsl:apply-templates select="*|@*|text()|comment()" /> + </xsl:copy> + </xsl:template> + </xsl:stylesheet> +]]> + + </set> + <xslt name="." xml="." xsl="mover" /> +</script> + + <script element="msub::limits-msub-msup" > + <set name="smash" > + <![CDATA[ + <xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + > + <xsl:output omit-xml-declaration = "yes" /> + + <xsl:template match="*[ + (@class = 'limits-msub-msup') + and + child::*[ (position() = 1) + and (@class = 'limits-mrow-base') + and child::*[ (position() = 1) + and (@class = 'limits-msub-msup') + ] ] +]" > + <xsl:copy> + <xsl:apply-templates select="@*" /> + <xsl:apply-templates select=" + *[1] + / *[1] + / *[ not(@class='limits-mrow-super') ] " /> + <xsl:apply-templates select=" *[ + preceding-sibling::* + and + not(@class='limits-mrow-super') ]" /> + <xsl:apply-templates select=" + *[1] + / *[1] + / *[@class='limits-mrow-super' ] " /> + <xsl:apply-templates select=" *[ + preceding-sibling::* + and + (@class='limits-mrow-super') ]" /> + </xsl:copy> +</xsl:template> + + <xsl:template match="*|@*|text()|comment()" > + <xsl:copy> + <xsl:apply-templates select="*|@*|text()|comment()" /> + </xsl:copy> + </xsl:template> + </xsl:stylesheet> +]]> + + </set> + <xslt name="." xml="." xsl="smash" /> +</script> +<script element="msup::limits-msub-msup" > + <set name="smash" > + <![CDATA[ + <xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + > + <xsl:output omit-xml-declaration = "yes" /> + + <xsl:template match="*[ + (@class = 'limits-msub-msup') + and + child::*[ (position() = 1) + and (@class = 'limits-mrow-base') + and child::*[ (position() = 1) + and (@class = 'limits-msub-msup') + ] ] +]" > + <xsl:copy> + <xsl:apply-templates select="@*" /> + <xsl:apply-templates select=" + *[1] + / *[1] + / *[ not(@class='limits-mrow-super') ] " /> + <xsl:apply-templates select=" *[ + preceding-sibling::* + and + not(@class='limits-mrow-super') ]" /> + <xsl:apply-templates select=" + *[1] + / *[1] + / *[@class='limits-mrow-super' ] " /> + <xsl:apply-templates select=" *[ + preceding-sibling::* + and + (@class='limits-mrow-super') ]" /> + </xsl:copy> +</xsl:template> + + <xsl:template match="*|@*|text()|comment()" > + <xsl:copy> + <xsl:apply-templates select="*|@*|text()|comment()" /> + </xsl:copy> + </xsl:template> + </xsl:stylesheet> +]]> + + </set> + <xslt name="." xml="." xsl="smash" /> +</script> +<script element="msubsup::limits-msub-msup" > + <set name="smash" > + <![CDATA[ + <xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + > + <xsl:output omit-xml-declaration = "yes" /> + + <xsl:template match="*[ + (@class = 'limits-msub-msup') + and + child::*[ (position() = 1) + and (@class = 'limits-mrow-base') + and child::*[ (position() = 1) + and (@class = 'limits-msub-msup') + ] ] +]" > + <xsl:copy> + <xsl:apply-templates select="@*" /> + <xsl:apply-templates select=" + *[1] + / *[1] + / *[ not(@class='limits-mrow-super') ] " /> + <xsl:apply-templates select=" *[ + preceding-sibling::* + and + not(@class='limits-mrow-super') ]" /> + <xsl:apply-templates select=" + *[1] + / *[1] + / *[@class='limits-mrow-super' ] " /> + <xsl:apply-templates select=" *[ + preceding-sibling::* + and + (@class='limits-mrow-super') ]" /> + </xsl:copy> +</xsl:template> + + <xsl:template match="*|@*|text()|comment()" > + <xsl:copy> + <xsl:apply-templates select="*|@*|text()|comment()" /> + </xsl:copy> + </xsl:template> + </xsl:stylesheet> +]]> + + </set> + <xslt name="." xml="." xsl="smash" /> +</script> + + + <script element="mi" > + <set name="math-cap" > + <![CDATA[ + <xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + > + <xsl:output omit-xml-declaration = "yes" /> + + <xsl:template match="mi" > + <xsl:copy> + <xsl:apply-templates select="@*" /> + <xsl:if test=" string-length(.) = 1 " > + <xsl:if test=" + (translate(.,'ABCDEFGHIJKLMNOPQRSTUVWXYZ', + '') = '' ) + " > + <span class="capital-description" + title="speech-extra" > + <xsl:text> capital </xsl:text> + </span> + </xsl:if> + </xsl:if> + <xsl:apply-templates select="*|text()|comment()" /> + </xsl:copy> +</xsl:template> + + <xsl:template match="*|@*|text()|comment()" > + <xsl:copy> + <xsl:apply-templates select="*|@*|text()|comment()" /> + </xsl:copy> + </xsl:template> + </xsl:stylesheet> +]]> + + </set> + <xslt name="." xml="." xsl="math-cap" /> +</script> + + <script element="tr" > + <set name="eqnum" > + <![CDATA[ + <xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + > + <xsl:output omit-xml-declaration = "yes" /> + + <xsl:template match="div[ + (parent::tr or parent::mtr) + and ( normalize-space(.) = '' ) + and not( normalize-space(following-sibling::*) != '' ) +]" > +</xsl:template> + + <xsl:template match="*|@*|text()|comment()" > + <xsl:copy> + <xsl:apply-templates select="*|@*|text()|comment()" /> + </xsl:copy> + </xsl:template> + </xsl:stylesheet> +]]> + + </set> + <xslt name="." xml="." xsl="eqnum" /> +</script> +<script element="mtr" > + <set name="eqnum" > + <![CDATA[ + <xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + > + <xsl:output omit-xml-declaration = "yes" /> + + <xsl:template match="div[ + (parent::tr or parent::mtr) + and ( normalize-space(.) = '' ) + and not( normalize-space(following-sibling::*) != '' ) +]" > +</xsl:template> + + <xsl:template match="*|@*|text()|comment()" > + <xsl:copy> + <xsl:apply-templates select="*|@*|text()|comment()" /> + </xsl:copy> + </xsl:template> + </xsl:stylesheet> +]]> + + </set> + <xslt name="." xml="." xsl="eqnum" /> +</script> + + <script element="span::inline-math" > + <set name="num-sub" > + <![CDATA[ + <xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + > + <xsl:output omit-xml-declaration = "yes" /> + + <xsl:template match="msub[ + ( + (count( child::mrow[ @class = 'mrow-base' ] + / child::* ) = 1 ) + and child::mrow[ @class = 'mrow-base' ] / descendant::mi + and not( ancestor::*[ + self::msub or self::msup or self::msubsup + ] ) + + or + ( + count( child::mrow[ @class = 'mrow-base' ] + / child::* [ + not(self::BREAK) + ] + ) = 2 ) + and child::mrow[ @class = 'mrow-base' ] [ + child::*[1][ self::mi ] + and + child::*[ + (position() > 1) + and + (normalize-space(.) = + normalize-space( + descendant-or-self::span[ + (@class = 'ch 2032') or (@class = 'ch 2033') + or (@class = 'ch 2034') + ] + )) + ] + ] + and not( ancestor::*[ + self::msub or self::msup or self::msubsup + ] ) + + ) + and + child::mrow[ @class = 'mrow-sub' ] + / child::*[ not(@title = 'speech-extra') ][1] + / self::*[ + normalize-space(.) + = normalize-space( descendant::mn ) ] +]" > + <xsl:copy> + <xsl:apply-templates select="@*" /> + <BREAK SIZE="small"/> + <xsl:apply-templates select="*[1]" /> + <mrow class="mrow-sub"> + <xsl:apply-templates + select="*[2] / *[ + not(@title = 'speech-extra') + ]" /> + <BREAK SIZE="small"/> + </mrow> + </xsl:copy> +</xsl:template> +<xsl:template match="msubsup[ + ( + (count( child::mrow[ @class = 'mrow-base' ] + / child::* ) = 1 ) + and child::mrow[ @class = 'mrow-base' ] / descendant::mi + and not( ancestor::*[ + self::msub or self::msup or self::msubsup + ] ) + + ) + and + child::mrow[ @class = 'mrow-sub' ] + / child::*[ not(@title = 'speech-extra') ][1] + / self::*[ + normalize-space(.) + = normalize-space( descendant::mn ) ] +]" > + <msup> + <BREAK SIZE="small"/> + <xsl:apply-templates select="*[1]" /> + <mrow class="mrow-sub"> + <xsl:apply-templates + select="*[2] / *[ + not(@title = 'speech-extra') + ]" /> + <BREAK SIZE="small"/> + </mrow> + <xsl:apply-templates select="*[3]" /> + </msup> +</xsl:template> + + <xsl:template match="*|@*|text()|comment()" > + <xsl:copy> + <xsl:apply-templates select="*|@*|text()|comment()" /> + </xsl:copy> + </xsl:template> + </xsl:stylesheet> +]]> + + </set> + <xslt name="." xml="." xsl="num-sub" /> + + <dom name="." xml="." method="fracLevel" class="tex4ht.HtJsml" /> +<set name="rmXmlDecl" > + <![CDATA[ + <xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + > + <xsl:output omit-xml-declaration = "yes" /> + + <xsl:template match="*|@*|text()|comment()" > + <xsl:copy> + <xsl:apply-templates select="*|@*|text()|comment()" /> + </xsl:copy> + </xsl:template> + </xsl:stylesheet> +]]> + +</set> +<xslt name="." xml="." xsl="rmXmlDecl" /> + + + <dom name="." xml="." method="scriptLevel" class="tex4ht.HtJsml" /> +<set name="rmXmlDecl" > + <![CDATA[ + <xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + > + <xsl:output omit-xml-declaration = "yes" /> + + <xsl:template match="*|@*|text()|comment()" > + <xsl:copy> + <xsl:apply-templates select="*|@*|text()|comment()" /> + </xsl:copy> + </xsl:template> + </xsl:stylesheet> +]]> + +</set> +<xslt name="." xml="." xsl="rmXmlDecl" /> + + + <dom name="." xml="." method="rootLevel" class="tex4ht.HtJsml" /> +<set name="rmXmlDecl" > + <![CDATA[ + <xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + > + <xsl:output omit-xml-declaration = "yes" /> + + <xsl:template match="*|@*|text()|comment()" > + <xsl:copy> + <xsl:apply-templates select="*|@*|text()|comment()" /> + </xsl:copy> + </xsl:template> + </xsl:stylesheet> +]]> + +</set> +<xslt name="." xml="." xsl="rmXmlDecl" /> + + + <set name="inline-math" > + <![CDATA[ + <xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + > + <xsl:output omit-xml-declaration = "yes" /> + + <xsl:template match="mn-group-s" > + <xsl:apply-templates select="*|@*|text()|comment()" /> +</xsl:template> + +<xsl:template match="mo[ + (@class='MathClass-punc') + and ( (.='.') or (.=',') or (.='!') + or (.=';') or (.=':') or (.='?') ) +]" > + <xsl:copy> + <xsl:apply-templates select="@*" /> + <BREAK SIZE="small"/> + <xsl:choose> + <xsl:when test=" .='.' " > + <SAYAS SUB="dot">.</SAYAS> + </xsl:when> + <xsl:when test=" .=',' " > + <SAYAS SUB="comma">,</SAYAS> + </xsl:when> + <xsl:when test=" .=';' " > + <SAYAS SUB="semicolon">;</SAYAS> + </xsl:when> + <xsl:when test=" .=':' " > + <SAYAS SUB="colon">:</SAYAS> + </xsl:when> + <xsl:when test=" .='!' " > + <SAYAS SUB="exclamation mark">!</SAYAS> + </xsl:when> + <xsl:when test=" .='?' " > + <SAYAS SUB="question mark">?</SAYAS> + </xsl:when> + </xsl:choose> + <BREAK SIZE="small"/> + </xsl:copy> +</xsl:template> + +<xsl:template match="mn[ + ancestor::mover[ + not( descendant::*[ + (count( child::*[ not(@title = 'speech-extra') + and not( self::BREAK ) + ] + ) > 1) + ]) + and + ( + preceding-sibling::*[1][self::dot or self::mn-group-s] + or + following-sibling::*[1][self::dot or self::mn-group-s] + ) +] + + or + ancestor::munder[ + not( descendant::*[ + (count( child::*[ not(@title = 'speech-extra') + and not( self::BREAK ) + ] + ) > 1) + ]) + and + ( + preceding-sibling::*[1][self::dot or self::mn-group-s] + or + following-sibling::*[1][self::dot or self::mn-group-s] + ) +] + +]" > + <xsl:copy> + <SAYAS CLASS="digits"> + <xsl:value-of select="." /> + </SAYAS> + </xsl:copy> +</xsl:template> + + +<xsl:template match="*" mode="content" > + <xsl:choose> + <xsl:when test=" @class = 'char' " > + <xsl:if test="not( child::*[ + (@class = 'ch 2032') or (@class = 'ch 2033') + or (@class = 'ch 2034') + ] )"> + <xsl:text>x</xsl:text> + </xsl:if> + </xsl:when> + <xsl:when test=" not( + (@title = 'speech-extra') or (@class = 'accent-char') + ) " > + <xsl:apply-templates select="*|text()" mode="content" /> + </xsl:when> + </xsl:choose> +</xsl:template> + +<xsl:template match="span[ + (@class = 'end-script') + and + ancestor::* [ following-sibling::* [ + not( @class = 'content-less' ) + ] + ][1] + / following-sibling::* [ + not( @class = 'content-less' ) + ][1] + / self::* + [ + (@class = 'end-math') + or + (@class = 'end-script') + or + (@class = 'end-root') + or + (@class = 'end-stack') + or + (@class = 'mid-stack') + or + (@class = 'end-array') + or + self::td or self::mtd or self::tr or self::mtr + or + (@title = 'implicit-baseline') + ] +]" > + <BREAK SIZE="small"/> +</xsl:template> +<xsl:template match="span[ + (@class = 'end-script') + and + parent::mrow / parent::msub + and + ancestor::* [ following-sibling::* ][1] + / following-sibling::* [ normalize-space(.) != '' ][1] + [ + (self::msub or self::msubsup) + and + (normalize-space(child::mrow[ + @class = 'mrow-base' ]) = '') + ] +]" > + <BREAK SIZE="small"/> +</xsl:template> +<xsl:template match="span[ + (@class = 'end-script') + and + parent::mrow /parent::*[ self::msup or self::msubsup] + and + ancestor::* [ following-sibling::* ][1] + / following-sibling::* [ normalize-space(.) != '' ][1] + [ + self::msup + and + (normalize-space(child::mrow[ + @class = 'mrow-base' ]) = '') + ] +]" > + <BREAK SIZE="small"/> +</xsl:template> + +<xsl:template match="span[ + (@class = 'begin-script') + or (@class = 'mid-script') +]" > + <xsl:copy> + <xsl:apply-templates select="@*" /> + <xsl:apply-templates select="*|text()|comment()" + mode="clean-script" /> + </xsl:copy> +</xsl:template> +<xsl:template match="*" mode="clean-script" > + <xsl:copy> + <xsl:apply-templates select="@*" /> + <xsl:apply-templates select="*|text()|comment()" + mode="clean-script" /> + </xsl:copy> +</xsl:template> +<xsl:template match="text()" mode="clean-script" > +</xsl:template> +<xsl:template match="span[@class = 'scripts-extra']" + mode="clean-script" > + <xsl:copy> + <xsl:apply-templates select="@*" /> + <xsl:value-of select=" + ancestor::span[ + (@class = 'begin-script') + or (@class = 'mid-script') ] [1] + " /> + </xsl:copy> +</xsl:template> + +<xsl:template match="mfrac[ + ( + (translate( + concat( + mrow[ (@class = 'mrow-numerator')], + mrow[ (@class = 'mrow-enumerator')] + ) ,'0123456789','') = '') + and + not(descendant::*/descendant::* + /descendant::mn-group-s) + or + (@class = 'word-frac') + ) + and + preceding-sibling::*[1] + / self::mn-group-s[ child::*[ + (position() = last()) + and + self::mn + ] ] + ]" > + <xsl:text> and </xsl:text> + <xsl:copy> + <xsl:apply-templates select="*|@*|text()|comment()" /> + </xsl:copy> +</xsl:template> + +<xsl:template match="mo[ + (@class = 'MathClass-bin') + and + ( normalize-space(.) = + normalize-space(descendant::span[@class = 'ch 2212']) + ) + and + ( preceding-sibling::*[1][ + (@title='speech-extra') + or (@class='MathClass-bin') + or (@class='MathClass-rel') + or (@class='MathClass-punc') + or (@class='MathClass-op') + or self::mn-group-s [ child::* [ + (position() = last()) + and + (@class='MathClass-punc') + ] ] ] + and + ( + following-sibling::*[1][ self::mn-group-s + or self::mi ] + or + (count(following-sibling::*[ + not(@title = 'speech-extra') + ]) = 1) + ) + or + not(preceding-sibling::*) and following-sibling::* + ) +]" > + <xsl:copy> + <xsl:attribute name="class"> + <xsl:text>mo-unary</xsl:text> + </xsl:attribute> + <xsl:apply-templates select="*|text()|comment()" + mode="minus-neg" /> + </xsl:copy> +</xsl:template> +<xsl:template match="*|@*|text()|comment()" mode="minus-neg" > + <xsl:copy> + <xsl:apply-templates select="*|@*|text()|comment()" + mode="minus-neg" /> + </xsl:copy> +</xsl:template> +<xsl:template match="text()" mode="minus-neg" > + <xsl:choose> + <xsl:when test=" . = 'minus' " > + <xsl:text>negative</xsl:text> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="." /> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + +<xsl:template match="span[ @class = 'end-limits-script' ]" > + <xsl:if test=" parent::*[ not(following-sibling::*) ] "> + <xsl:copy> + <xsl:apply-templates select=" @* " /> + <xsl:choose> + <xsl:when test=" + parent::*[ preceding-sibling::mrow[ + @class != 'limits-mrow-base' + ] ] + " > + <BREAK SIZE="small"/> + <xsl:text> end scripts </xsl:text> + <BREAK SIZE="small"/> + </xsl:when> + <xsl:otherwise> + <BREAK SIZE="small"/> + <xsl:text> end script </xsl:text> + <BREAK SIZE="small"/> + </xsl:otherwise> + </xsl:choose> + </xsl:copy> + </xsl:if> +</xsl:template> +<xsl:template match="span[ @class = 'begin-limits-script' ]" > + <xsl:copy> + <xsl:apply-templates select=" @* " /> + <xsl:choose> + <xsl:when test=" + parent::*[ @class = 'limits-mrow-super' ] + " > + <xsl:apply-templates + select=" parent::* + / preceding-sibling::*[1] " + mode = "extra-over" /> + </xsl:when> + <xsl:when test=" + parent::*[ @class = 'limits-mrow-sub' ] + " > + <xsl:apply-templates + select=" parent::* + / preceding-sibling::*[1] " + mode = "extra-under" /> + </xsl:when> + </xsl:choose> + <xsl:apply-templates select="*|text()|comment()" /> + </xsl:copy> +</xsl:template> +<xsl:template match="*" mode="extra-over" > + <xsl:if test = " self::mrow[ @class = 'limits-mrow-super' ] " > + <xsl:text> over </xsl:text> + <xsl:apply-templates select=" preceding-sibling::*[1] " + mode = "extra-over" /> + </xsl:if> +</xsl:template> +<xsl:template match="*" mode="extra-under" > + <xsl:if test = " self::mrow[ @class = 'limits-mrow-sub' ] " > + <xsl:text> under </xsl:text> + <xsl:apply-templates select=" preceding-sibling::*[1] " + mode = "extra-under" /> + </xsl:if> +</xsl:template> + +<xsl:template match="span[ + (@class = 'begin-script') + and + following-sibling::*[ not(@title = 'speech-extra') ] [1] + / descendant-or-self::*[ not( self::PROS ) ][1] + / + child::span / child::span[ + (@class = 'ch 2032') or (@class = 'ch 2033') + or (@class = 'ch 2034') + ] +]" > + <BREAK SIZE="small"/> +</xsl:template> +<xsl:template match="span[ + (@class = 'end-script') + and + preceding-sibling::*[ not(@title = 'speech-extra') ] [1] + / descendant-or-self::*[ not( self::PROS ) ][1] + / + child::span / child::span[ + (@class = 'ch 2032') or (@class = 'ch 2033') + or (@class = 'ch 2034') + ] +]" > + <BREAK SIZE="small"/> +</xsl:template> + +<xsl:template match="mrow[ + (@class = 'mrow-super') + and + parent::msup + and + (count( child::*[ not(@title = 'speech-extra') + and not( self::BREAK ) + ] + ) = 1) + and + child::*[ not(@title = 'speech-extra') + and not( self::BREAK ) + ] + [1][ + normalize-space(.) + = + normalize-space( + descendant::span[@class = 'ch 2218'] + ) + ] +]" > + <xsl:copy> + <xsl:apply-templates select="@*" /> + <xsl:apply-templates + select="*[not(@title = 'speech-extra') + and + not(self::BREAK) + ]" + mode="degree" /> + <BREAK SIZE="small"/> + </xsl:copy> +</xsl:template> +<xsl:template match="*" mode="degree" > + <xsl:copy> + <xsl:apply-templates select="@*" /> + <xsl:choose> + <xsl:when test="self::span[ @class='ch 2218' ]" > + <xsl:text>degree</xsl:text> + </xsl:when> + <xsl:otherwise> + <xsl:apply-templates + select="*[not(self::BREAK)]|text()" + mode="degree"/> + </xsl:otherwise> + </xsl:choose> + </xsl:copy> +</xsl:template> + + + + <xsl:template match="*|@*|text()|comment()" > + <xsl:copy> + <xsl:apply-templates select="*|@*|text()|comment()" /> + </xsl:copy> + </xsl:template> + </xsl:stylesheet> +]]> + + </set> + <xslt name="." xml="." xsl="inline-math" /> + <sax name="." xml="." content-handler="tex4ht.JsmlMathBreak" /> + + <set name="inline-math-2" > + <![CDATA[ + <xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + > + <xsl:output omit-xml-declaration = "yes" /> + + <xsl:template match="*" mode="content" > + <xsl:choose> + <xsl:when test=" @class = 'char' " > + <xsl:if test="not( child::*[ + (@class = 'ch 2032') or (@class = 'ch 2033') + or (@class = 'ch 2034') + ] )"> + <xsl:text>x</xsl:text> + </xsl:if> + </xsl:when> + <xsl:when test=" not( + (@title = 'speech-extra') or (@class = 'accent-char') + ) " > + <xsl:apply-templates select="*|text()" mode="content" /> + </xsl:when> + </xsl:choose> +</xsl:template> + +<xsl:template match="span[ + (@class = 'end-script') + and + ancestor::*[ preceding-sibling::* [ + ((@class = 'begin-script') or (@class = 'mid-script')) ]] +]" > + <xsl:copy> + <xsl:apply-templates select="@*" /> + <xsl:apply-templates select=" + ancestor::*[ preceding-sibling::* [ + ((@class = 'begin-script') or + (@class = 'mid-script')) ]][1] + / preceding-sibling::* [ + ((@class = 'begin-script') or + (@class = 'mid-script')) ][1] + " mode="script-copy" /> + </xsl:copy> +</xsl:template> +<xsl:template match="*|@*|text()|comment()" + mode="script-copy" > + <xsl:copy> + <xsl:apply-templates select="*|@*|text()|comment()" /> + </xsl:copy> +</xsl:template> +<xsl:template match="span[ + (@class = 'begin-script') or + (@class = 'mid-script') ]" mode="script-copy" > + <xsl:apply-templates select="*|text()|comment()" /> +</xsl:template> + +<xsl:template match="span[ + ((@class = 'begin-script') or (@class = 'mid-script')) + and + following-sibling::* + / following-sibling::span[ @class = 'end-script' ] + and + following-sibling::*[1] + / descendant-or-self::*[ not(self::PROS) ][1] + / child::*[1][ + (@class = 'mrow-base') + and + (normalize-space(.)='') + ] +]" > +</xsl:template> + +<xsl:template match="span[ + (@class = 'begin-script') + and + following-sibling::* [1] / child::*[ + (position() = 1) + and + (@class = 'mrow-base') + and + ( normalize-space(.) = '' ) + ] +]" > +</xsl:template> + + + + <xsl:template match="*|@*|text()|comment()" > + <xsl:copy> + <xsl:apply-templates select="*|@*|text()|comment()" /> + </xsl:copy> + </xsl:template> + </xsl:stylesheet> +]]> + + </set> + <xslt name="." xml="." xsl="inline-math-2" /> +</script> + + <script element="div::display-math" > + <set name="num-sub" > + <![CDATA[ + <xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + > + <xsl:output omit-xml-declaration = "yes" /> + + <xsl:template match="msub[ + ( + (count( child::mrow[ @class = 'mrow-base' ] + / child::* ) = 1 ) + and child::mrow[ @class = 'mrow-base' ] / descendant::mi + and not( ancestor::*[ + self::msub or self::msup or self::msubsup + ] ) + + or + ( + count( child::mrow[ @class = 'mrow-base' ] + / child::* [ + not(self::BREAK) + ] + ) = 2 ) + and child::mrow[ @class = 'mrow-base' ] [ + child::*[1][ self::mi ] + and + child::*[ + (position() > 1) + and + (normalize-space(.) = + normalize-space( + descendant-or-self::span[ + (@class = 'ch 2032') or (@class = 'ch 2033') + or (@class = 'ch 2034') + ] + )) + ] + ] + and not( ancestor::*[ + self::msub or self::msup or self::msubsup + ] ) + + ) + and + child::mrow[ @class = 'mrow-sub' ] + / child::*[ not(@title = 'speech-extra') ][1] + / self::*[ + normalize-space(.) + = normalize-space( descendant::mn ) ] +]" > + <xsl:copy> + <xsl:apply-templates select="@*" /> + <BREAK SIZE="small"/> + <xsl:apply-templates select="*[1]" /> + <mrow class="mrow-sub"> + <xsl:apply-templates + select="*[2] / *[ + not(@title = 'speech-extra') + ]" /> + <BREAK SIZE="small"/> + </mrow> + </xsl:copy> +</xsl:template> +<xsl:template match="msubsup[ + ( + (count( child::mrow[ @class = 'mrow-base' ] + / child::* ) = 1 ) + and child::mrow[ @class = 'mrow-base' ] / descendant::mi + and not( ancestor::*[ + self::msub or self::msup or self::msubsup + ] ) + + ) + and + child::mrow[ @class = 'mrow-sub' ] + / child::*[ not(@title = 'speech-extra') ][1] + / self::*[ + normalize-space(.) + = normalize-space( descendant::mn ) ] +]" > + <msup> + <BREAK SIZE="small"/> + <xsl:apply-templates select="*[1]" /> + <mrow class="mrow-sub"> + <xsl:apply-templates + select="*[2] / *[ + not(@title = 'speech-extra') + ]" /> + <BREAK SIZE="small"/> + </mrow> + <xsl:apply-templates select="*[3]" /> + </msup> +</xsl:template> + + <xsl:template match="*|@*|text()|comment()" > + <xsl:copy> + <xsl:apply-templates select="*|@*|text()|comment()" /> + </xsl:copy> + </xsl:template> + </xsl:stylesheet> +]]> + + </set> + <xslt name="." xml="." xsl="num-sub" /> + + <dom name="." xml="." method="fracLevel" class="tex4ht.HtJsml" /> +<set name="rmXmlDecl" > + <![CDATA[ + <xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + > + <xsl:output omit-xml-declaration = "yes" /> + + <xsl:template match="*|@*|text()|comment()" > + <xsl:copy> + <xsl:apply-templates select="*|@*|text()|comment()" /> + </xsl:copy> + </xsl:template> + </xsl:stylesheet> +]]> + +</set> +<xslt name="." xml="." xsl="rmXmlDecl" /> + + + <dom name="." xml="." method="scriptLevel" class="tex4ht.HtJsml" /> +<set name="rmXmlDecl" > + <![CDATA[ + <xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + > + <xsl:output omit-xml-declaration = "yes" /> + + <xsl:template match="*|@*|text()|comment()" > + <xsl:copy> + <xsl:apply-templates select="*|@*|text()|comment()" /> + </xsl:copy> + </xsl:template> + </xsl:stylesheet> +]]> + +</set> +<xslt name="." xml="." xsl="rmXmlDecl" /> + + + <dom name="." xml="." method="rootLevel" class="tex4ht.HtJsml" /> +<set name="rmXmlDecl" > + <![CDATA[ + <xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + > + <xsl:output omit-xml-declaration = "yes" /> + + <xsl:template match="*|@*|text()|comment()" > + <xsl:copy> + <xsl:apply-templates select="*|@*|text()|comment()" /> + </xsl:copy> + </xsl:template> + </xsl:stylesheet> +]]> + +</set> +<xslt name="." xml="." xsl="rmXmlDecl" /> + + + <set name="display-math" > + <![CDATA[ + <xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + > + <xsl:output omit-xml-declaration = "yes" /> + + <xsl:template match="mn-group-s" > + <xsl:apply-templates select="*|@*|text()|comment()" /> +</xsl:template> + +<xsl:template match="mo[ + (@class='MathClass-punc') + and ( (.='.') or (.=',') or (.='!') + or (.=';') or (.=':') or (.='?') ) +]" > + <xsl:copy> + <xsl:apply-templates select="@*" /> + <BREAK SIZE="small"/> + <xsl:choose> + <xsl:when test=" .='.' " > + <SAYAS SUB="dot">.</SAYAS> + </xsl:when> + <xsl:when test=" .=',' " > + <SAYAS SUB="comma">,</SAYAS> + </xsl:when> + <xsl:when test=" .=';' " > + <SAYAS SUB="semicolon">;</SAYAS> + </xsl:when> + <xsl:when test=" .=':' " > + <SAYAS SUB="colon">:</SAYAS> + </xsl:when> + <xsl:when test=" .='!' " > + <SAYAS SUB="exclamation mark">!</SAYAS> + </xsl:when> + <xsl:when test=" .='?' " > + <SAYAS SUB="question mark">?</SAYAS> + </xsl:when> + </xsl:choose> + <BREAK SIZE="small"/> + </xsl:copy> +</xsl:template> + +<xsl:template match="mn[ + ancestor::mover[ + not( descendant::*[ + (count( child::*[ not(@title = 'speech-extra') + and not( self::BREAK ) + ] + ) > 1) + ]) + and + ( + preceding-sibling::*[1][self::dot or self::mn-group-s] + or + following-sibling::*[1][self::dot or self::mn-group-s] + ) +] + + or + ancestor::munder[ + not( descendant::*[ + (count( child::*[ not(@title = 'speech-extra') + and not( self::BREAK ) + ] + ) > 1) + ]) + and + ( + preceding-sibling::*[1][self::dot or self::mn-group-s] + or + following-sibling::*[1][self::dot or self::mn-group-s] + ) +] + +]" > + <xsl:copy> + <SAYAS CLASS="digits"> + <xsl:value-of select="." /> + </SAYAS> + </xsl:copy> +</xsl:template> + + +<xsl:template match="*" mode="content" > + <xsl:choose> + <xsl:when test=" @class = 'char' " > + <xsl:if test="not( child::*[ + (@class = 'ch 2032') or (@class = 'ch 2033') + or (@class = 'ch 2034') + ] )"> + <xsl:text>x</xsl:text> + </xsl:if> + </xsl:when> + <xsl:when test=" not( + (@title = 'speech-extra') or (@class = 'accent-char') + ) " > + <xsl:apply-templates select="*|text()" mode="content" /> + </xsl:when> + </xsl:choose> +</xsl:template> + +<xsl:template match="span[ + (@class = 'end-script') + and + ancestor::* [ following-sibling::* [ + not( @class = 'content-less' ) + ] + ][1] + / following-sibling::* [ + not( @class = 'content-less' ) + ][1] + / self::* + [ + (@class = 'end-math') + or + (@class = 'end-script') + or + (@class = 'end-root') + or + (@class = 'end-stack') + or + (@class = 'mid-stack') + or + (@class = 'end-array') + or + self::td or self::mtd or self::tr or self::mtr + or + (@title = 'implicit-baseline') + ] +]" > + <BREAK SIZE="small"/> +</xsl:template> +<xsl:template match="span[ + (@class = 'end-script') + and + parent::mrow / parent::msub + and + ancestor::* [ following-sibling::* ][1] + / following-sibling::* [ normalize-space(.) != '' ][1] + [ + (self::msub or self::msubsup) + and + (normalize-space(child::mrow[ + @class = 'mrow-base' ]) = '') + ] +]" > + <BREAK SIZE="small"/> +</xsl:template> +<xsl:template match="span[ + (@class = 'end-script') + and + parent::mrow /parent::*[ self::msup or self::msubsup] + and + ancestor::* [ following-sibling::* ][1] + / following-sibling::* [ normalize-space(.) != '' ][1] + [ + self::msup + and + (normalize-space(child::mrow[ + @class = 'mrow-base' ]) = '') + ] +]" > + <BREAK SIZE="small"/> +</xsl:template> + +<xsl:template match="span[ + (@class = 'begin-script') + or (@class = 'mid-script') +]" > + <xsl:copy> + <xsl:apply-templates select="@*" /> + <xsl:apply-templates select="*|text()|comment()" + mode="clean-script" /> + </xsl:copy> +</xsl:template> +<xsl:template match="*" mode="clean-script" > + <xsl:copy> + <xsl:apply-templates select="@*" /> + <xsl:apply-templates select="*|text()|comment()" + mode="clean-script" /> + </xsl:copy> +</xsl:template> +<xsl:template match="text()" mode="clean-script" > +</xsl:template> +<xsl:template match="span[@class = 'scripts-extra']" + mode="clean-script" > + <xsl:copy> + <xsl:apply-templates select="@*" /> + <xsl:value-of select=" + ancestor::span[ + (@class = 'begin-script') + or (@class = 'mid-script') ] [1] + " /> + </xsl:copy> +</xsl:template> + +<xsl:template match="mfrac[ + ( + (translate( + concat( + mrow[ (@class = 'mrow-numerator')], + mrow[ (@class = 'mrow-enumerator')] + ) ,'0123456789','') = '') + and + not(descendant::*/descendant::* + /descendant::mn-group-s) + or + (@class = 'word-frac') + ) + and + preceding-sibling::*[1] + / self::mn-group-s[ child::*[ + (position() = last()) + and + self::mn + ] ] + ]" > + <xsl:text> and </xsl:text> + <xsl:copy> + <xsl:apply-templates select="*|@*|text()|comment()" /> + </xsl:copy> +</xsl:template> + +<xsl:template match="mo[ + (@class = 'MathClass-bin') + and + ( normalize-space(.) = + normalize-space(descendant::span[@class = 'ch 2212']) + ) + and + ( preceding-sibling::*[1][ + (@title='speech-extra') + or (@class='MathClass-bin') + or (@class='MathClass-rel') + or (@class='MathClass-punc') + or (@class='MathClass-op') + or self::mn-group-s [ child::* [ + (position() = last()) + and + (@class='MathClass-punc') + ] ] ] + and + ( + following-sibling::*[1][ self::mn-group-s + or self::mi ] + or + (count(following-sibling::*[ + not(@title = 'speech-extra') + ]) = 1) + ) + or + not(preceding-sibling::*) and following-sibling::* + ) +]" > + <xsl:copy> + <xsl:attribute name="class"> + <xsl:text>mo-unary</xsl:text> + </xsl:attribute> + <xsl:apply-templates select="*|text()|comment()" + mode="minus-neg" /> + </xsl:copy> +</xsl:template> +<xsl:template match="*|@*|text()|comment()" mode="minus-neg" > + <xsl:copy> + <xsl:apply-templates select="*|@*|text()|comment()" + mode="minus-neg" /> + </xsl:copy> +</xsl:template> +<xsl:template match="text()" mode="minus-neg" > + <xsl:choose> + <xsl:when test=" . = 'minus' " > + <xsl:text>negative</xsl:text> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="." /> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + +<xsl:template match="span[ @class = 'end-limits-script' ]" > + <xsl:if test=" parent::*[ not(following-sibling::*) ] "> + <xsl:copy> + <xsl:apply-templates select=" @* " /> + <xsl:choose> + <xsl:when test=" + parent::*[ preceding-sibling::mrow[ + @class != 'limits-mrow-base' + ] ] + " > + <BREAK SIZE="small"/> + <xsl:text> end scripts </xsl:text> + <BREAK SIZE="small"/> + </xsl:when> + <xsl:otherwise> + <BREAK SIZE="small"/> + <xsl:text> end script </xsl:text> + <BREAK SIZE="small"/> + </xsl:otherwise> + </xsl:choose> + </xsl:copy> + </xsl:if> +</xsl:template> +<xsl:template match="span[ @class = 'begin-limits-script' ]" > + <xsl:copy> + <xsl:apply-templates select=" @* " /> + <xsl:choose> + <xsl:when test=" + parent::*[ @class = 'limits-mrow-super' ] + " > + <xsl:apply-templates + select=" parent::* + / preceding-sibling::*[1] " + mode = "extra-over" /> + </xsl:when> + <xsl:when test=" + parent::*[ @class = 'limits-mrow-sub' ] + " > + <xsl:apply-templates + select=" parent::* + / preceding-sibling::*[1] " + mode = "extra-under" /> + </xsl:when> + </xsl:choose> + <xsl:apply-templates select="*|text()|comment()" /> + </xsl:copy> +</xsl:template> +<xsl:template match="*" mode="extra-over" > + <xsl:if test = " self::mrow[ @class = 'limits-mrow-super' ] " > + <xsl:text> over </xsl:text> + <xsl:apply-templates select=" preceding-sibling::*[1] " + mode = "extra-over" /> + </xsl:if> +</xsl:template> +<xsl:template match="*" mode="extra-under" > + <xsl:if test = " self::mrow[ @class = 'limits-mrow-sub' ] " > + <xsl:text> under </xsl:text> + <xsl:apply-templates select=" preceding-sibling::*[1] " + mode = "extra-under" /> + </xsl:if> +</xsl:template> + +<xsl:template match="span[ + (@class = 'begin-script') + and + following-sibling::*[ not(@title = 'speech-extra') ] [1] + / descendant-or-self::*[ not( self::PROS ) ][1] + / + child::span / child::span[ + (@class = 'ch 2032') or (@class = 'ch 2033') + or (@class = 'ch 2034') + ] +]" > + <BREAK SIZE="small"/> +</xsl:template> +<xsl:template match="span[ + (@class = 'end-script') + and + preceding-sibling::*[ not(@title = 'speech-extra') ] [1] + / descendant-or-self::*[ not( self::PROS ) ][1] + / + child::span / child::span[ + (@class = 'ch 2032') or (@class = 'ch 2033') + or (@class = 'ch 2034') + ] +]" > + <BREAK SIZE="small"/> +</xsl:template> + +<xsl:template match="mrow[ + (@class = 'mrow-super') + and + parent::msup + and + (count( child::*[ not(@title = 'speech-extra') + and not( self::BREAK ) + ] + ) = 1) + and + child::*[ not(@title = 'speech-extra') + and not( self::BREAK ) + ] + [1][ + normalize-space(.) + = + normalize-space( + descendant::span[@class = 'ch 2218'] + ) + ] +]" > + <xsl:copy> + <xsl:apply-templates select="@*" /> + <xsl:apply-templates + select="*[not(@title = 'speech-extra') + and + not(self::BREAK) + ]" + mode="degree" /> + <BREAK SIZE="small"/> + </xsl:copy> +</xsl:template> +<xsl:template match="*" mode="degree" > + <xsl:copy> + <xsl:apply-templates select="@*" /> + <xsl:choose> + <xsl:when test="self::span[ @class='ch 2218' ]" > + <xsl:text>degree</xsl:text> + </xsl:when> + <xsl:otherwise> + <xsl:apply-templates + select="*[not(self::BREAK)]|text()" + mode="degree"/> + </xsl:otherwise> + </xsl:choose> + </xsl:copy> +</xsl:template> + + + <xsl:template match="*|@*|text()|comment()" > + <xsl:copy> + <xsl:apply-templates select="*|@*|text()|comment()" /> + </xsl:copy> + </xsl:template> + </xsl:stylesheet> +]]> + + </set> + <xslt name="." xml="." xsl="display-math" /> + <sax name="." xml="." content-handler="tex4ht.JsmlMathBreak" /> + + <set name="display-math-2" > + <![CDATA[ + <xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + > + <xsl:output omit-xml-declaration = "yes" /> + + <xsl:template match="*" mode="content" > + <xsl:choose> + <xsl:when test=" @class = 'char' " > + <xsl:if test="not( child::*[ + (@class = 'ch 2032') or (@class = 'ch 2033') + or (@class = 'ch 2034') + ] )"> + <xsl:text>x</xsl:text> + </xsl:if> + </xsl:when> + <xsl:when test=" not( + (@title = 'speech-extra') or (@class = 'accent-char') + ) " > + <xsl:apply-templates select="*|text()" mode="content" /> + </xsl:when> + </xsl:choose> +</xsl:template> + +<xsl:template match="span[ + (@class = 'end-script') + and + ancestor::*[ preceding-sibling::* [ + ((@class = 'begin-script') or (@class = 'mid-script')) ]] +]" > + <xsl:copy> + <xsl:apply-templates select="@*" /> + <xsl:apply-templates select=" + ancestor::*[ preceding-sibling::* [ + ((@class = 'begin-script') or + (@class = 'mid-script')) ]][1] + / preceding-sibling::* [ + ((@class = 'begin-script') or + (@class = 'mid-script')) ][1] + " mode="script-copy" /> + </xsl:copy> +</xsl:template> +<xsl:template match="*|@*|text()|comment()" + mode="script-copy" > + <xsl:copy> + <xsl:apply-templates select="*|@*|text()|comment()" /> + </xsl:copy> +</xsl:template> +<xsl:template match="span[ + (@class = 'begin-script') or + (@class = 'mid-script') ]" mode="script-copy" > + <xsl:apply-templates select="*|text()|comment()" /> +</xsl:template> + +<xsl:template match="span[ + ((@class = 'begin-script') or (@class = 'mid-script')) + and + following-sibling::* + / following-sibling::span[ @class = 'end-script' ] + and + following-sibling::*[1] + / descendant-or-self::*[ not(self::PROS) ][1] + / child::*[1][ + (@class = 'mrow-base') + and + (normalize-space(.)='') + ] +]" > +</xsl:template> + +<xsl:template match="span[ + (@class = 'begin-script') + and + following-sibling::* [1] / child::*[ + (position() = 1) + and + (@class = 'mrow-base') + and + ( normalize-space(.) = '' ) + ] +]" > +</xsl:template> + + + <xsl:template match="*|@*|text()|comment()" > + <xsl:copy> + <xsl:apply-templates select="*|@*|text()|comment()" /> + </xsl:copy> + </xsl:template> + </xsl:stylesheet> +]]> + + </set> + <xslt name="." xml="." xsl="display-math-2" /> + +</script> + + <script element="PARA" > + <set name="apostro" > + <![CDATA[ + <xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + > + <xsl:output omit-xml-declaration = "yes" /> + + <xsl:template match="span[ + (@class = 'char-del') + and child::span [ @class = 'ch 2019' ] +]" > + <xsl:text>'</xsl:text> +</xsl:template> + + <xsl:template match="PROS[ parent::SENT[@class='ol-mark'] ]" > + <xsl:copy> + <xsl:apply-templates + select="*[not(@class='char-del')]|@*|text()|comment()" /> + </xsl:copy> +</xsl:template> + + <xsl:template match=" PARA[ normalize-space(.) = '' ] " > +</xsl:template> + + <xsl:template match="*|@*|text()|comment()" > + <xsl:copy> + <xsl:apply-templates select="*|@*|text()|comment()" /> + </xsl:copy> + </xsl:template> + </xsl:stylesheet> +]]> + + </set> + <xslt name="." xml="." xsl="apostro" /> +</script> + + <script element="div::split-side" > + <set name="clean-split" > + <![CDATA[ + <xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + > + <xsl:output omit-xml-declaration = "yes" /> + + <xsl:template match="*" mode="content" > + <xsl:choose> + <xsl:when test=" @class = 'char' " > + <xsl:if test="not( child::*[ + (@class = 'ch 2032') or (@class = 'ch 2033') + or (@class = 'ch 2034') + ] )"> + <xsl:text>x</xsl:text> + </xsl:if> + </xsl:when> + <xsl:when test=" not( + (@title = 'speech-extra') or (@class = 'accent-char') + ) " > + <xsl:apply-templates select="*|text()" mode="content" /> + </xsl:when> + </xsl:choose> +</xsl:template> + + <xsl:template match=" div[ @class='split-side' ] +" > + <xsl:variable name="content"> + <xsl:apply-templates select="*" mode="content" /> + </xsl:variable> + <xsl:if test=" + string-length( normalize-space( $content )) != 0 + " > + <xsl:copy> + <xsl:apply-templates select=" *|@*|text()|comment() " /> + </xsl:copy> + </xsl:if> +</xsl:template> + + <xsl:template match="*|@*|text()|comment()" > + <xsl:copy> + <xsl:apply-templates select="*|@*|text()|comment()" /> + </xsl:copy> + </xsl:template> + </xsl:stylesheet> +]]> + + </set> + <xslt name="." xml="." xsl="clean-split" /> +</script> + + <script element="div::newtheorem" > + <set name="newtheorem" > + <![CDATA[ + <xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + > + <xsl:output omit-xml-declaration = "yes" /> + + <xsl:template match=" + div[ (@class='newtheorem') + and + descendant::*[ self::p ][1] + / descendant::*[ self::span ][1] + [ @class = 'theorem-head' ] + ] +" > + <xsl:copy> + <xsl:apply-templates select="*|@*|text()|comment()" /> + <div class="begin-end" title="speech-extra"> + <BREAK SIZE="small"/> + <xsl:value-of select=" + concat( ' end ', + substring-before(concat( + normalize-space( + string( + descendant::*[ self::p ][1] + / descendant::*[ self::span ][1] + [ @class = 'theorem-head' ] + ) ) + , ' ' +) +, ' ') + ) " /> + </div> + </xsl:copy> +</xsl:template> + + + <xsl:template match="*|@*|text()|comment()" > + <xsl:copy> + <xsl:apply-templates select="*|@*|text()|comment()" /> + </xsl:copy> + </xsl:template> + </xsl:stylesheet> +]]> + + </set> + <xslt name="." xml="." xsl="newtheorem" /> +</script> + + <script element="br" > + <set name="br" > + <![CDATA[ + <xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + > + <xsl:output omit-xml-declaration = "yes" /> + + <xsl:template match="br" > + <xsl:copy> + <xsl:apply-templates select="@*" /> + </xsl:copy> + <BREAK SIZE="small"/> +</xsl:template> + + <xsl:template match="*|@*|text()|comment()" > + <xsl:copy> + <xsl:apply-templates select="*|@*|text()|comment()" /> + </xsl:copy> + </xsl:template> + </xsl:stylesheet> +]]> + + </set> + <xslt name="." xml="." xsl="br" /> +</script> + + <script element="BREAK" > + <set name="BREAK" > + <![CDATA[ + <xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + > + <xsl:output omit-xml-declaration = "yes" /> + + <xsl:template match="BREAK" > + <xsl:copy> + <xsl:apply-templates select="@*" /> + </xsl:copy> +</xsl:template> + + <xsl:template match="*|@*|text()|comment()" > + <xsl:copy> + <xsl:apply-templates select="*|@*|text()|comment()" /> + </xsl:copy> + </xsl:template> + </xsl:stylesheet> +]]> + + </set> + <xslt name="." xml="." xsl="BREAK" /> +</script> + + </sax> +</xtpipes> + diff --git a/Master/texmf-dist/tex4ht/xtpipes/oo-math.4xt b/Master/texmf-dist/tex4ht/xtpipes/oo-math.4xt new file mode 100755 index 00000000000..5cf25daddf7 --- /dev/null +++ b/Master/texmf-dist/tex4ht/xtpipes/oo-math.4xt @@ -0,0 +1,118 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE xtpipes SYSTEM "xtpipes.dtd" > +<xtpipes preamble="yes" signature="oo-math.4xt (2008-02-20-10:22)"> + <sax content-handler="xtpipes.util.ScriptsManager,tex4ht.OomFilter" + lexical-handler="xtpipes.util.ScriptsManagerLH" > + <script element="math:mtable" > + <dom name="." xml="." method="mtable" class="tex4ht.OoUtilities" /> + + </script> + <script element="math:math" > + <set name="math:mo" > + <![CDATA[ + <xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:math="http://www.w3.org/1998/Math/MathML" + xmlns:xlink="http://www.w3.org/1999/xlink" + > + <xsl:output omit-xml-declaration = "yes" /> + + <xsl:template match=" math:mo" > + <xsl:choose> + <xsl:when test=" + (preceding-sibling::math:mn or preceding-sibling::math:mi) + and not(following-sibling::*) +" > + <math:mtext> + <xsl:apply-templates select="*|@*|text()" /> + </math:mtext> +</xsl:when> +<xsl:when test=" + not((preceding-sibling::*) or following-sibling::*) +" > + <math:mtext> + <xsl:apply-templates select="*|@*|text()" /> + </math:mtext> +</xsl:when> +<xsl:when test=" + (.='{') or (.='}') +" > + <math:mtext> + <xsl:apply-templates select="*|@*|text()" /> + </math:mtext> +</xsl:when> +<xsl:when test=" . = '='" > + <xsl:choose> + <xsl:when test=" not(preceding-sibling::*) + or not(following-sibling::*) + or preceding-sibling::*[1] / self::math:mo + "> + <math:mtext> + <xsl:apply-templates select="*|@*|text()" /> + </math:mtext> + </xsl:when> + <xsl:otherwise> + <math:mo> + <xsl:apply-templates select="*|@*|text()" /> + </math:mo> + </xsl:otherwise> + </xsl:choose> + +</xsl:when> + + <xsl:when test=" string-length() > 1 " > + <math:mtext> + <xsl:value-of select="normalize-space(.)" /> + </math:mtext> +</xsl:when> + + <xsl:otherwise> + <math:mo> + <xsl:apply-templates select="@*" /> + <xsl:value-of select="normalize-space(.)" /> + </math:mo> + </xsl:otherwise> + </xsl:choose> + </xsl:template> + <xsl:template match="*|@*|text()|comment()" > + <xsl:copy> + <xsl:apply-templates select="*|@*|text()|comment()" /> + </xsl:copy> + </xsl:template> + </xsl:stylesheet> +]]> + +</set> +<xslt name="." xml="." xsl="math:mo" /> + + + <set name="math:mspace" > + <![CDATA[ + <xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:math="http://www.w3.org/1998/Math/MathML" + xmlns:xlink="http://www.w3.org/1999/xlink" + > + <xsl:output omit-xml-declaration = "yes" /> + + <xsl:template match="math:mspace" > + <math:mtext> + <xsl:text> </xsl:text> + </math:mtext> +</xsl:template> + + <xsl:template match="*|@*|text()|comment()" > + <xsl:copy> + <xsl:apply-templates select="*|@*|text()|comment()" /> + </xsl:copy> + </xsl:template> + </xsl:stylesheet> +]]> + +</set> +<xslt name="." xml="." xsl="math:mspace" /> + + </script> + </sax> +</xtpipes> + diff --git a/Master/texmf-dist/tex4ht/xtpipes/oo-text.4xt b/Master/texmf-dist/tex4ht/xtpipes/oo-text.4xt new file mode 100755 index 00000000000..163f35bde5f --- /dev/null +++ b/Master/texmf-dist/tex4ht/xtpipes/oo-text.4xt @@ -0,0 +1,181 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE xtpipes SYSTEM "xtpipes.dtd" > +<xtpipes preamble="yes" signature="oo-text.4xt (2008-02-20-10:22)"> + <sax content-handler="xtpipes.util.ScriptsManager,tex4ht.OoFilter" + lexical-handler="xtpipes.util.ScriptsManagerLH" > + <script element="table:table" > + <dom name="." xml="." method="table" class="tex4ht.OoUtilities" /> + + </script> + <script element="text:p" > + <set name="text-p" > + <![CDATA[ + <xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + + xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" + xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" + xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" + xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" + xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" + xmlns:fo="http://www.w3.org/1999/XSL/Format" + xmlns:xlink="http://www.w3.org/1999/xlink" + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" + xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" + xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" + xmlns:math="http://www.w3.org/1998/Math/MathML" + xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" + xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" + xmlns:ooo="http://openoffice.org/2004/office" + xmlns:ooow="http://openoffice.org/2004/writer" + xmlns:oooc="http://openoffice.org/2004/calc" + xmlns:dom="http://www.w3.org/2001/xml-events" + xmlns:xforms="http://www.w3.org/2002/xforms" + xmlns:xsd="http://www.w3.org/2001/XMLSchema" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + > + <xsl:output omit-xml-declaration = "yes" /> + + <xsl:template match="text:p[ (count(child::*)=1) + and child::draw:frame + and parent::text:p + ]" > + <xsl:apply-templates select="child::draw:frame" /> +</xsl:template> +<xsl:template match="text:p[ + child::text:p + and + (count(child::text:p) = count(child::*)) + ]" > + <xsl:copy> + <xsl:attribute name="text:style-name"> + <xsl:text>start_</xsl:text> + <xsl:value-of select="@text:style-name" /> + </xsl:attribute> + <xsl:comment> + <xsl:text>start </xsl:text> + <xsl:value-of select=" @text:style-name " /> + </xsl:comment> + </xsl:copy> + <xsl:apply-templates select="*|text()|comment()" mode="nested-p" /> + <xsl:copy> + <xsl:attribute name="text:style-name"> + <xsl:text>end_</xsl:text> + <xsl:value-of select="@text:style-name" /> + </xsl:attribute> + <xsl:comment> + <xsl:text>end </xsl:text> + <xsl:value-of select=" @text:style-name " /> + </xsl:comment> + </xsl:copy> +</xsl:template> +<xsl:template match="*[not(text:p)]|text()|comment()" mode="nested-p" > + <xsl:copy/> +</xsl:template> +<xsl:template match="text:p" mode="nested-p" > + <xsl:copy> + <xsl:attribute name="text:style-name"> + <xsl:value-of select="parent::text:p/@text:style-name" /> + <xsl:text>_</xsl:text> + <xsl:value-of select="@text:style-name" /> + <xsl:text>_</xsl:text> + <xsl:value-of select="child::*[1]/@text:style-name" /> + </xsl:attribute> + <xsl:apply-templates select="@*[ name() != 'text:style-name' ]" /> + <xsl:apply-templates select="*|text()|comment()" /> + </xsl:copy> +</xsl:template> + + <xsl:template match="text:p[ child::text:span[ + starts-with(@text:style-name, 'multicolumn-') + ] ]" > + <xsl:copy> + <xsl:apply-templates + select="child::text:span[ + starts-with(@text:style-name, 'multicolumn-') ] + /@* + " /> + <xsl:apply-templates select="*|text()|comment()" /> + </xsl:copy> +</xsl:template> +<xsl:template match="text:span[ + starts-with(@text:style-name, 'multicolumn-') ]" /> + + <xsl:template match="*|@*|text()|comment()" > + <xsl:copy> + <xsl:apply-templates select="*|@*|text()|comment()" /> + </xsl:copy> + </xsl:template> + </xsl:stylesheet> +]]> + +</set> +<xslt name="." xml="." xsl="text-p" /> + + </script> + <script element="text:h" > + <set name="algorithmic" > + <![CDATA[ + <xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + + xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" + xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" + xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" + xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" + xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" + xmlns:fo="http://www.w3.org/1999/XSL/Format" + xmlns:xlink="http://www.w3.org/1999/xlink" + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" + xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" + xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" + xmlns:math="http://www.w3.org/1998/Math/MathML" + xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" + xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" + xmlns:ooo="http://openoffice.org/2004/office" + xmlns:ooow="http://openoffice.org/2004/writer" + xmlns:oooc="http://openoffice.org/2004/calc" + xmlns:dom="http://www.w3.org/2001/xml-events" + xmlns:xforms="http://www.w3.org/2002/xforms" + xmlns:xsd="http://www.w3.org/2001/XMLSchema" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + > + <xsl:output omit-xml-declaration = "yes" /> + + <xsl:template match="text:h[@text:style-name='algorithmic-dt']" > + <xsl:copy> + <xsl:apply-templates select="@*" /> + <xsl:apply-templates select="*|text()|comment()" mode="algorithmic"/> + </xsl:copy> +</xsl:template> +<xsl:template match="*|@*|comment()" mode="algorithmic" > + <xsl:copy> + <xsl:apply-templates select="@*" /> + <xsl:apply-templates select="*|text()|comment()" mode="algorithmic"/> + </xsl:copy> +</xsl:template> +<xsl:template match="text()" mode="algorithmic" > + <xsl:value-of select="translate(.,' ',' ')"/> +</xsl:template> + + <xsl:template match="*|@*|text()|comment()" > + <xsl:copy> + <xsl:apply-templates select="*|@*|text()|comment()" /> + </xsl:copy> + </xsl:template> + </xsl:stylesheet> +]]> + +</set> +<xslt name="." xml="." xsl="algorithmic" /> + + </script> + </sax> +</xtpipes> + diff --git a/Master/texmf-dist/tex4ht/xtpipes/xhtml.4xt b/Master/texmf-dist/tex4ht/xtpipes/xhtml.4xt new file mode 100755 index 00000000000..c4c53bb8467 --- /dev/null +++ b/Master/texmf-dist/tex4ht/xtpipes/xhtml.4xt @@ -0,0 +1,514 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE xtpipes SYSTEM "xtpipes.dtd" > +<xtpipes preamble="yes" signature="xhtml.4xt (2007-12-01-14:50)"> + <sax content-handler="xtpipes.util.ScriptsManager" + lexical-handler="xtpipes.util.ScriptsManagerLH" > + <script element="table::tabular" > + <set name="tabular" > + <![CDATA[ + <xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + > + <xsl:output omit-xml-declaration = "yes" method="xml" /> + + <xsl:template match=" table[ @class='tabular' ] + / tr[ (normalize-space(.)='') ] " > + +<xsl:message terminate="no"> +OK 1 +</xsl:message> + + <xsl:if test=" normalize-space(following-sibling::*) != '' "> + <xsl:copy> + <xsl:apply-templates select="*|@*|text()|comment()" /> +<xsl:message terminate="no"> +OK 2 +</xsl:message> + </xsl:copy> + </xsl:if> +</xsl:template> +<xsl:template match=" tr[ (normalize-space(.)='') + and + (parent::table[ @class='tabular' ]) + ] " > + +<xsl:message terminate="no"> +OK 1 +</xsl:message> + + <xsl:if test=" normalize-space(following-sibling::*) != '' "> + <xsl:copy> + <xsl:apply-templates select="*|@*|text()|comment()" /> +<xsl:message terminate="no"> +OK 2 +</xsl:message> + </xsl:copy> + </xsl:if> +</xsl:template> + + <xsl:template match="*|@*|text()|comment()" > + <xsl:copy> + <xsl:apply-templates select="*|@*|text()|comment()" /> + </xsl:copy> + </xsl:template> + </xsl:stylesheet> +]]> + + </set> + <xslt name="." xml="." xsl="tabular" /> +</script> + + <script element="table::longtable" > + <set name="longtbl" > + <![CDATA[ + <xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + > + <xsl:output omit-xml-declaration = "yes" method="xml" /> + + <xsl:template match=" table[ @class='longtable' ] + / tr[ (normalize-space(.)='') ] " > + <xsl:if test=" normalize-space(following-sibling::*) != '' "> + <xsl:copy> + <xsl:apply-templates select="*|@*|text()|comment()" /> + </xsl:copy> + </xsl:if> +</xsl:template> + + <xsl:template match="*|@*|text()|comment()" > + <xsl:copy> + <xsl:apply-templates select="*|@*|text()|comment()" /> + </xsl:copy> + </xsl:template> + </xsl:stylesheet> +]]> + + </set> + <xslt name="." xml="." xsl="longtbl" /> +</script> + + <script element="span::email" > + <sax name="." xml="." content-handler="tex4ht.XhtmlEmails" /> + +</script> + + <script element="meta" > + <set name="meta" > + <![CDATA[ + <xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + > + <xsl:output omit-xml-declaration = "yes" method="xml" /> + + <xsl:template match="meta" > + <xsl:text disable-output-escaping="yes"><meta</xsl:text> + <xsl:apply-templates select="@*" mode="attrs" /> + <xsl:text disable-output-escaping="yes">/></xsl:text> + </xsl:template> + <xsl:template match="@*" mode="attrs" > + <xsl:text> </xsl:text> + <xsl:value-of select="name()" /> + <xsl:text>="</xsl:text> + <xsl:value-of select="." /> + <xsl:text>"</xsl:text> +</xsl:template> + + <xsl:template match="*|@*|text()|comment()" > + <xsl:copy> + <xsl:apply-templates select="*|@*|text()|comment()" /> + </xsl:copy> + </xsl:template> + </xsl:stylesheet> +]]> + + </set> + <xslt name="." xml="." xsl="meta" /> +</script> +<script element="area" > + <set name="area" > + <![CDATA[ + <xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + > + <xsl:output omit-xml-declaration = "yes" method="xml" /> + + <xsl:template match="area" > + <xsl:text disable-output-escaping="yes"><area</xsl:text> + <xsl:apply-templates select="@*" mode="attrs" /> + <xsl:text disable-output-escaping="yes">/></xsl:text> + </xsl:template> + <xsl:template match="@*" mode="attrs" > + <xsl:text> </xsl:text> + <xsl:value-of select="name()" /> + <xsl:text>="</xsl:text> + <xsl:value-of select="." /> + <xsl:text>"</xsl:text> +</xsl:template> + + <xsl:template match="*|@*|text()|comment()" > + <xsl:copy> + <xsl:apply-templates select="*|@*|text()|comment()" /> + </xsl:copy> + </xsl:template> + </xsl:stylesheet> +]]> + + </set> + <xslt name="." xml="." xsl="area" /> +</script> +<script element="base" > + <set name="base" > + <![CDATA[ + <xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + > + <xsl:output omit-xml-declaration = "yes" method="xml" /> + + <xsl:template match="base" > + <xsl:text disable-output-escaping="yes"><base</xsl:text> + <xsl:apply-templates select="@*" mode="attrs" /> + <xsl:text disable-output-escaping="yes">/></xsl:text> + </xsl:template> + <xsl:template match="@*" mode="attrs" > + <xsl:text> </xsl:text> + <xsl:value-of select="name()" /> + <xsl:text>="</xsl:text> + <xsl:value-of select="." /> + <xsl:text>"</xsl:text> +</xsl:template> + + <xsl:template match="*|@*|text()|comment()" > + <xsl:copy> + <xsl:apply-templates select="*|@*|text()|comment()" /> + </xsl:copy> + </xsl:template> + </xsl:stylesheet> +]]> + + </set> + <xslt name="." xml="." xsl="base" /> +</script> +<script element="basefont" > + <set name="basefont" > + <![CDATA[ + <xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + > + <xsl:output omit-xml-declaration = "yes" method="xml" /> + + <xsl:template match="basefont" > + <xsl:text disable-output-escaping="yes"><basefont</xsl:text> + <xsl:apply-templates select="@*" mode="attrs" /> + <xsl:text disable-output-escaping="yes">/></xsl:text> + </xsl:template> + <xsl:template match="@*" mode="attrs" > + <xsl:text> </xsl:text> + <xsl:value-of select="name()" /> + <xsl:text>="</xsl:text> + <xsl:value-of select="." /> + <xsl:text>"</xsl:text> +</xsl:template> + + <xsl:template match="*|@*|text()|comment()" > + <xsl:copy> + <xsl:apply-templates select="*|@*|text()|comment()" /> + </xsl:copy> + </xsl:template> + </xsl:stylesheet> +]]> + + </set> + <xslt name="." xml="." xsl="basefont" /> +</script> +<script element="br" > + <set name="br" > + <![CDATA[ + <xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + > + <xsl:output omit-xml-declaration = "yes" method="xml" /> + + <xsl:template match="br" > + <xsl:text disable-output-escaping="yes"><br</xsl:text> + <xsl:apply-templates select="@*" mode="attrs" /> + <xsl:text disable-output-escaping="yes">/></xsl:text> + </xsl:template> + <xsl:template match="@*" mode="attrs" > + <xsl:text> </xsl:text> + <xsl:value-of select="name()" /> + <xsl:text>="</xsl:text> + <xsl:value-of select="." /> + <xsl:text>"</xsl:text> +</xsl:template> + + <xsl:template match="*|@*|text()|comment()" > + <xsl:copy> + <xsl:apply-templates select="*|@*|text()|comment()" /> + </xsl:copy> + </xsl:template> + </xsl:stylesheet> +]]> + + </set> + <xslt name="." xml="." xsl="br" /> +</script> +<script element="col" > + <set name="col" > + <![CDATA[ + <xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + > + <xsl:output omit-xml-declaration = "yes" method="xml" /> + + <xsl:template match="col" > + <xsl:text disable-output-escaping="yes"><col</xsl:text> + <xsl:apply-templates select="@*" mode="attrs" /> + <xsl:text disable-output-escaping="yes">/></xsl:text> + </xsl:template> + <xsl:template match="@*" mode="attrs" > + <xsl:text> </xsl:text> + <xsl:value-of select="name()" /> + <xsl:text>="</xsl:text> + <xsl:value-of select="." /> + <xsl:text>"</xsl:text> +</xsl:template> + + <xsl:template match="*|@*|text()|comment()" > + <xsl:copy> + <xsl:apply-templates select="*|@*|text()|comment()" /> + </xsl:copy> + </xsl:template> + </xsl:stylesheet> +]]> + + </set> + <xslt name="." xml="." xsl="col" /> +</script> +<script element="frame" > + <set name="frame" > + <![CDATA[ + <xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + > + <xsl:output omit-xml-declaration = "yes" method="xml" /> + + <xsl:template match="frame" > + <xsl:text disable-output-escaping="yes"><frame</xsl:text> + <xsl:apply-templates select="@*" mode="attrs" /> + <xsl:text disable-output-escaping="yes">/></xsl:text> + </xsl:template> + <xsl:template match="@*" mode="attrs" > + <xsl:text> </xsl:text> + <xsl:value-of select="name()" /> + <xsl:text>="</xsl:text> + <xsl:value-of select="." /> + <xsl:text>"</xsl:text> +</xsl:template> + + <xsl:template match="*|@*|text()|comment()" > + <xsl:copy> + <xsl:apply-templates select="*|@*|text()|comment()" /> + </xsl:copy> + </xsl:template> + </xsl:stylesheet> +]]> + + </set> + <xslt name="." xml="." xsl="frame" /> +</script> +<script element="hr" > + <set name="hr" > + <![CDATA[ + <xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + > + <xsl:output omit-xml-declaration = "yes" method="xml" /> + + <xsl:template match="hr" > + <xsl:text disable-output-escaping="yes"><hr</xsl:text> + <xsl:apply-templates select="@*" mode="attrs" /> + <xsl:text disable-output-escaping="yes">/></xsl:text> + </xsl:template> + <xsl:template match="@*" mode="attrs" > + <xsl:text> </xsl:text> + <xsl:value-of select="name()" /> + <xsl:text>="</xsl:text> + <xsl:value-of select="." /> + <xsl:text>"</xsl:text> +</xsl:template> + + <xsl:template match="*|@*|text()|comment()" > + <xsl:copy> + <xsl:apply-templates select="*|@*|text()|comment()" /> + </xsl:copy> + </xsl:template> + </xsl:stylesheet> +]]> + + </set> + <xslt name="." xml="." xsl="hr" /> +</script> +<script element="img" > + <set name="img" > + <![CDATA[ + <xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + > + <xsl:output omit-xml-declaration = "yes" method="xml" /> + + <xsl:template match="img" > + <xsl:text disable-output-escaping="yes"><img</xsl:text> + <xsl:apply-templates select="@*" mode="attrs" /> + <xsl:text disable-output-escaping="yes">/></xsl:text> + </xsl:template> + <xsl:template match="@*" mode="attrs" > + <xsl:text> </xsl:text> + <xsl:value-of select="name()" /> + <xsl:text>="</xsl:text> + <xsl:value-of select="." /> + <xsl:text>"</xsl:text> +</xsl:template> + + <xsl:template match="*|@*|text()|comment()" > + <xsl:copy> + <xsl:apply-templates select="*|@*|text()|comment()" /> + </xsl:copy> + </xsl:template> + </xsl:stylesheet> +]]> + + </set> + <xslt name="." xml="." xsl="img" /> +</script> +<script element="input" > + <set name="input" > + <![CDATA[ + <xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + > + <xsl:output omit-xml-declaration = "yes" method="xml" /> + + <xsl:template match="input" > + <xsl:text disable-output-escaping="yes"><input</xsl:text> + <xsl:apply-templates select="@*" mode="attrs" /> + <xsl:text disable-output-escaping="yes">/></xsl:text> + </xsl:template> + <xsl:template match="@*" mode="attrs" > + <xsl:text> </xsl:text> + <xsl:value-of select="name()" /> + <xsl:text>="</xsl:text> + <xsl:value-of select="." /> + <xsl:text>"</xsl:text> +</xsl:template> + + <xsl:template match="*|@*|text()|comment()" > + <xsl:copy> + <xsl:apply-templates select="*|@*|text()|comment()" /> + </xsl:copy> + </xsl:template> + </xsl:stylesheet> +]]> + + </set> + <xslt name="." xml="." xsl="input" /> +</script> +<script element="isindex" > + <set name="isindex" > + <![CDATA[ + <xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + > + <xsl:output omit-xml-declaration = "yes" method="xml" /> + + <xsl:template match="isindex" > + <xsl:text disable-output-escaping="yes"><isindex</xsl:text> + <xsl:apply-templates select="@*" mode="attrs" /> + <xsl:text disable-output-escaping="yes">/></xsl:text> + </xsl:template> + <xsl:template match="@*" mode="attrs" > + <xsl:text> </xsl:text> + <xsl:value-of select="name()" /> + <xsl:text>="</xsl:text> + <xsl:value-of select="." /> + <xsl:text>"</xsl:text> +</xsl:template> + + <xsl:template match="*|@*|text()|comment()" > + <xsl:copy> + <xsl:apply-templates select="*|@*|text()|comment()" /> + </xsl:copy> + </xsl:template> + </xsl:stylesheet> +]]> + + </set> + <xslt name="." xml="." xsl="isindex" /> +</script> +<script element="link" > + <set name="link" > + <![CDATA[ + <xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + > + <xsl:output omit-xml-declaration = "yes" method="xml" /> + + <xsl:template match="link" > + <xsl:text disable-output-escaping="yes"><link</xsl:text> + <xsl:apply-templates select="@*" mode="attrs" /> + <xsl:text disable-output-escaping="yes">/></xsl:text> + </xsl:template> + <xsl:template match="@*" mode="attrs" > + <xsl:text> </xsl:text> + <xsl:value-of select="name()" /> + <xsl:text>="</xsl:text> + <xsl:value-of select="." /> + <xsl:text>"</xsl:text> +</xsl:template> + + <xsl:template match="*|@*|text()|comment()" > + <xsl:copy> + <xsl:apply-templates select="*|@*|text()|comment()" /> + </xsl:copy> + </xsl:template> + </xsl:stylesheet> +]]> + + </set> + <xslt name="." xml="." xsl="link" /> +</script> +<script element="param" > + <set name="param" > + <![CDATA[ + <xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + > + <xsl:output omit-xml-declaration = "yes" method="xml" /> + + <xsl:template match="param" > + <xsl:text disable-output-escaping="yes"><param</xsl:text> + <xsl:apply-templates select="@*" mode="attrs" /> + <xsl:text disable-output-escaping="yes">/></xsl:text> + </xsl:template> + <xsl:template match="@*" mode="attrs" > + <xsl:text> </xsl:text> + <xsl:value-of select="name()" /> + <xsl:text>="</xsl:text> + <xsl:value-of select="." /> + <xsl:text>"</xsl:text> +</xsl:template> + + <xsl:template match="*|@*|text()|comment()" > + <xsl:copy> + <xsl:apply-templates select="*|@*|text()|comment()" /> + </xsl:copy> + </xsl:template> + </xsl:stylesheet> +]]> + + </set> + <xslt name="." xml="." xsl="param" /> +</script> + + </sax> +</xtpipes> + diff --git a/Master/texmf-dist/tex4ht/xtpipes/xtpipes-default.4xt b/Master/texmf-dist/tex4ht/xtpipes/xtpipes-default.4xt new file mode 100755 index 00000000000..b847f1de210 --- /dev/null +++ b/Master/texmf-dist/tex4ht/xtpipes/xtpipes-default.4xt @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE xtpipes PUBLIC "-//GURARI//DTD xtpipes//EN" "xtpipes.dtd" > +<xtpipes /> + diff --git a/Master/texmf-dist/tex4ht/xtpipes/xtpipes-map.dtd b/Master/texmf-dist/tex4ht/xtpipes/xtpipes-map.dtd new file mode 100755 index 00000000000..483e38f8b79 --- /dev/null +++ b/Master/texmf-dist/tex4ht/xtpipes/xtpipes-map.dtd @@ -0,0 +1,30 @@ +<!-- xtpipes-map.dtd (2008-01-26-00:38) --> +<!ELEMENT xtpipes-map (when | processing-instruction + | select + | command-line)* > +<!ELEMENT when (when | select + | processing-instruction + | command-line )* > +<!ELEMENT select EMPTY > +<!ELEMENT processing-instruction EMPTY > +<!ELEMENT command-line EMPTY > +<!ATTLIST xtpipes-map + signature CDATA #IMPLIED +> +<!ATTLIST when + name ( + system-id + | public-id + | dtd-root + | root + | ext + | meta-type + | content-type + | prefix ) "public-id" + value CDATA #IMPLIED + case-sensitive (yes|no) "no" +> +<!ATTLIST select + name CDATA #REQUIRED +> + diff --git a/Master/texmf-dist/tex4ht/xtpipes/xtpipes.dtd b/Master/texmf-dist/tex4ht/xtpipes/xtpipes.dtd new file mode 100755 index 00000000000..3fe1c156357 --- /dev/null +++ b/Master/texmf-dist/tex4ht/xtpipes/xtpipes.dtd @@ -0,0 +1,77 @@ +<!ELEMENT xtpipes (#PCDATA | set +| get +| print +| return +| if +| xslt +| dom +| sax +)* > +<!ATTLIST xtpipes + preamble CDATA #IMPLIED DEFAULT (yes | no) "no" + signature CDATA #IMPLIED > +<!ELEMENT set (#PCDATA) > +<!ATTLIST set + name CDATA #REQUIRED > +<!ELEMENT get EMPTY > +<!ATTLIST get + name CDATA #REQUIRED + file CDATA #REQUIRED +> +<!ELEMENT print EMPTY > +<!ATTLIST print + name CDATA #REQUIRED + file CDATA #IMPLIED +> +<!ELEMENT return EMPTY > +<!ATTLIST return + name CDATA #REQUIRED +> +<!ELEMENT if (#PCDATA | set +| get +| print +| return +| if +| xslt +| dom +| sax +)* > +<!ATTLIST if + xml CDATA #REQUIRED + dtd CDATA #REQUIRED + root CDATA #REQUIRED +> +<!ELEMENT xslt EMPTY > +<!ATTLIST xslt + name CDATA #IMPLIED + xml CDATA #REQUIRED + xsl CDATA #REQUIRED +> +<!ELEMENT dom EMPTY > +<!ATTLIST dom + name CDATA #REQUIRED + xml CDATA #REQUIRED + method CDATA #REQUIRED + class CDATA #REQUIRED + dcl CDATA #IMPLIED DEFAULT (yes | no) "no" +> +<!ELEMENT sax (#PCDATA | script)* > +<!ELEMENT script (#PCDATA | set +| get +| print +| return +| if +| xslt +| dom +| sax + )* > +<!ATTLIST sax + name CDATA #IMPLIED + xml CDATA #IMPLIED + content-handler CDATA #REQUIRED + lexical-handler CDATA #IMPLIED +> +<!ATTLIST script + element CDATA #REQUIRED +> + |