Snipt.net is closing on December 31st, 2016

For more information, please visit this blog post.

snipt

Ctrl+h for KB shortcuts

XSLT

Drop metadata elements

1
2
3
4
5
<xsl:template match="@*|node()">
    <xsl:copy>
        <xsl:apply-templates select="@*|node()[not(name()='metadata')))]]"/>
    </xsl:copy>
</xsl:template>
https://snipt.net/embed/e5ae5cf6c071a82a0f414ee3518c93d6/
https://snipt.net/raw/e5ae5cf6c071a82a0f414ee3518c93d6/
e5ae5cf6c071a82a0f414ee3518c93d6
xslt
XSLT
5
2016-12-04T03:09:56
True
False
False
/api/public/snipt/6756/
drop-metadata-elements
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a> <a href="#L-5">5</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="k">&lt;xsl:template</span> <span class="na">match=</span><span class="s">&quot;@*|node()&quot;</span><span class="nt">&gt;</span> </span><span id="L-2"><a name="L-2"></a> <span class="k">&lt;xsl:copy</span><span class="nt">&gt;</span> </span><span id="L-3"><a name="L-3"></a> <span class="k">&lt;xsl:apply-templates</span> <span class="na">select=</span><span class="s">&quot;@*|node()[not(name()=&#39;metadata&#39;)))]]&quot;</span><span class="nt">/&gt;</span> </span><span id="L-4"><a name="L-4"></a> <span class="k">&lt;/xsl:copy&gt;</span> </span><span id="L-5"><a name="L-5"></a><span class="k">&lt;/xsl:template&gt;</span> </span></pre></div> </td></tr></table>
metadata, xslt

Bash

Convert XML docs to HTML

// Assumes xalan is installed on machine
find . -name '*.xml' | xargs -I PARAM java org.apache.xalan.xslt.Process -IN PARAM -XSL dir/file.xsl -OUT PARAM.html
https://snipt.net/embed/d84e5b7b4f2ad3870576c11fca85ee3c/
https://snipt.net/raw/d84e5b7b4f2ad3870576c11fca85ee3c/
d84e5b7b4f2ad3870576c11fca85ee3c
bash
Bash
2
2016-12-07T14:34:37
True
False
False
/api/public/snipt/3028/
convert-xml-docs-to-html
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>// Assumes xalan is installed on machine </span><span id="L-2"><a name="L-2"></a>find . -name <span class="s1">&#39;*.xml&#39;</span> <span class="p">|</span> xargs -I PARAM java org.apache.xalan.xslt.Process -IN PARAM -XSL dir/file.xsl -OUT PARAM.html </span></pre></div> </td></tr></table>
find, html, xalan, xargs, xml, xsl, xslt
Copyrighted, illegal, or inappropriate content? Email [email protected].