Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><strong>When this XSLT:</strong></p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;xsl:stylesheet xmlns="http://www.w3.org/1998/Math/MathML" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:m="http://www.w3.org/1998/Math/MathML" exclude-result-prefixes="m" version="1.0"&gt; &lt;xsl:output omit-xml-declaration="no" indent="yes" /&gt; &lt;xsl:strip-space elements="*" /&gt; &lt;xsl:template match="@*|node()"&gt; &lt;xsl:copy&gt; &lt;xsl:apply-templates select="@*|node()" /&gt; &lt;/xsl:copy&gt; &lt;/xsl:template&gt; &lt;xsl:template match="m:mfenced"&gt; &lt;msup&gt; &lt;mfenced&gt; &lt;xsl:apply-templates /&gt; &lt;/mfenced&gt; &lt;xsl:apply-templates select="following-sibling::m:sup/*" /&gt; &lt;/msup&gt; &lt;/xsl:template&gt; &lt;xsl:template match="m:mfrac/m:mrow"&gt; &lt;mrow&gt; &lt;msub&gt; &lt;xsl:apply-templates /&gt; &lt;/msub&gt; &lt;/mrow&gt; &lt;/xsl:template&gt; &lt;xsl:template match="m:sub"&gt; &lt;xsl:apply-templates /&gt; &lt;/xsl:template&gt; &lt;xsl:template match="m:sup" /&gt; &lt;/xsl:stylesheet&gt; </code></pre> <p><strong>...is applied to the provided XML:</strong></p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;chapter xmlns="http://www.w3.org/1998/Math/MathML"&gt; &lt;math display="block"&gt; &lt;mfenced&gt; &lt;mrow&gt; &lt;mfrac&gt; &lt;mrow&gt; &lt;mi&gt;v&lt;/mi&gt; &lt;sub&gt; &lt;mrow&gt; &lt;mi&gt;n&lt;/mi&gt; &lt;/mrow&gt; &lt;/sub&gt; &lt;/mrow&gt; &lt;mrow&gt; &lt;mi&gt;v&lt;/mi&gt; &lt;sub&gt; &lt;mrow&gt; &lt;mi&gt;d&lt;/mi&gt; &lt;/mrow&gt; &lt;/sub&gt; &lt;/mrow&gt; &lt;/mfrac&gt; &lt;/mrow&gt; &lt;/mfenced&gt; &lt;sup&gt; &lt;mrow&gt; &lt;mn&gt;2&lt;/mn&gt; &lt;/mrow&gt; &lt;/sup&gt; &lt;/math&gt; &lt;/chapter&gt; </code></pre> <p><strong>...the wanted result is produced:</strong></p> <pre><code>&lt;?xml version="1.0"?&gt; &lt;chapter xmlns="http://www.w3.org/1998/Math/MathML"&gt; &lt;math display="block"&gt; &lt;msup&gt; &lt;mfenced&gt; &lt;mrow&gt; &lt;mfrac&gt; &lt;mrow&gt; &lt;msub&gt; &lt;mi&gt;v&lt;/mi&gt; &lt;mrow&gt; &lt;mi&gt;n&lt;/mi&gt; &lt;/mrow&gt; &lt;/msub&gt; &lt;/mrow&gt; &lt;mrow&gt; &lt;msub&gt; &lt;mi&gt;v&lt;/mi&gt; &lt;mrow&gt; &lt;mi&gt;d&lt;/mi&gt; &lt;/mrow&gt; &lt;/msub&gt; &lt;/mrow&gt; &lt;/mfrac&gt; &lt;/mrow&gt; &lt;/mfenced&gt; &lt;mrow&gt; &lt;mn&gt;2&lt;/mn&gt; &lt;/mrow&gt; &lt;/msup&gt; &lt;/math&gt; &lt;/chapter&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload