Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><strong>Whitelist</strong> those elements:</p> <pre><code>&lt;xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"&gt; &lt;xsl:output omit-xml-declaration="yes" indent="yes"/&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="*[not(self::description or self::p or self::i or self::em or self::strong or self::b or self::ol or self::ul or self::li or self::a)]"/&gt; &lt;/xsl:stylesheet&gt; </code></pre> <p>Note that this removes the undesired elements <em>and</em> anything below them. To just strip the <code>font</code> element itself, for example, but allow its children, modify the last template like this:</p> <pre><code>&lt;xsl:template match="*[not(self::description or self::p or self::i or self::em or self::strong or self::b or self::ol or self::ul or self::li or self::a)]"/&gt; &lt;xsl:apply-templates/&gt; &lt;/xsl:template&gt; </code></pre> <p>An equivalent (and slightly cleaner) solution:</p> <pre><code>&lt;xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"&gt; &lt;xsl:output omit-xml-declaration="yes" indent="yes"/&gt; &lt;xsl:template match="@*|node()" priority="-3"&gt; &lt;xsl:copy/&gt; &lt;/xsl:template&gt; &lt;xsl:template match="description|p|i|em|strong|b|ol|ul|li|a"&gt; &lt;xsl:copy&gt; &lt;xsl:apply-templates select="@*|node()"/&gt; &lt;/xsl:copy&gt; &lt;/xsl:template&gt; &lt;xsl:template match="*"/&gt; &lt;/xsl:stylesheet&gt; </code></pre> <p>The opposite approach is to <strong>blacklist</strong> the unwanted elements:</p> <pre><code>&lt;xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"&gt; &lt;xsl:output omit-xml-declaration="yes" indent="yes"/&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="font|span"/&gt; &lt;/xsl:stylesheet&gt; </code></pre> <p>Again, add an <code>apply-templates</code> to the final template if you want to allow children of the skipped elements.</p>
    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. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      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