snipt

Ctrl+h for KB shortcuts

XSLT

Basic XML Output with Indent

1
2
3
4
5
6
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:output method="xml" indent="yes" media-type="text/xml" omit-xml-declaration="yes" encoding="utf-8" />
	<xsl:template match="/">
    	<xsl:copy-of select="*"/>
	</xsl:template>
</xsl:stylesheet>
https://snipt.net/embed/edb402db6ce5f1b230c04c5a1fa17604/
https://snipt.net/raw/edb402db6ce5f1b230c04c5a1fa17604/
edb402db6ce5f1b230c04c5a1fa17604
xslt
XSLT
6
2016-09-22T19:29:53
True
False
False
May 31, 2013 at 08:20 AM
/api/public/snipt/61088/
basic-xml-output-with-indent
<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> <a href="#L-6">6</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a><span class="k">&lt;xsl:stylesheet</span> <span class="na">version=</span><span class="s">&quot;1.0&quot;</span> <span class="na">xmlns:xsl=</span><span class="s">&quot;http://www.w3.org/1999/XSL/Transform&quot;</span><span class="nt">&gt;</span> </span><span id="L-2"><a name="L-2"></a> <span class="k">&lt;xsl:output</span> <span class="na">method=</span><span class="s">&quot;xml&quot;</span> <span class="na">indent=</span><span class="s">&quot;yes&quot;</span> <span class="na">media-type=</span><span class="s">&quot;text/xml&quot;</span> <span class="na">omit-xml-declaration=</span><span class="s">&quot;yes&quot;</span> <span class="na">encoding=</span><span class="s">&quot;utf-8&quot;</span> <span class="nt">/&gt;</span> </span><span id="L-3"><a name="L-3"></a> <span class="k">&lt;xsl:template</span> <span class="na">match=</span><span class="s">&quot;/&quot;</span><span class="nt">&gt;</span> </span><span id="L-4"><a name="L-4"></a> <span class="k">&lt;xsl:copy-of</span> <span class="na">select=</span><span class="s">&quot;*&quot;</span><span class="nt">/&gt;</span> </span><span id="L-5"><a name="L-5"></a> <span class="k">&lt;/xsl:template&gt;</span> </span><span id="L-6"><a name="L-6"></a><span class="k">&lt;/xsl:stylesheet&gt;</span> </span></pre></div> </td></tr></table>
XML, XSLT

XSLT

Default XForms to XHTML XSLT Stylesheet

1
2
3
4
5
6
7
8
<xsl:stylesheet version="1.0" 
    xmlns="http://www.w3.org/1999/xhtml" 
    xmlns:xf="http://www.w3.org/2002/xforms" 
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:output omit-xml-declaration="yes" />
    <xsl:template match = "/">
    </xsl:template>
</xsl:stylesheet>
https://snipt.net/embed/c3a732421b3d8b451e5f8e016b215ef0/
https://snipt.net/raw/c3a732421b3d8b451e5f8e016b215ef0/
c3a732421b3d8b451e5f8e016b215ef0
xslt
XSLT
8
2016-09-26T15:47:47
True
False
False
May 31, 2013 at 08:20 AM
/api/public/snipt/39575/
default-xforms-to-xhtml-xslt-stylesheet
<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> <a href="#L-6">6</a> <a href="#L-7">7</a> <a href="#L-8">8</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a><span class="k">&lt;xsl:stylesheet</span> <span class="na">version=</span><span class="s">&quot;1.0&quot;</span> </span><span id="L-2"><a name="L-2"></a> <span class="na">xmlns=</span><span class="s">&quot;http://www.w3.org/1999/xhtml&quot;</span> </span><span id="L-3"><a name="L-3"></a> <span class="na">xmlns:xf=</span><span class="s">&quot;http://www.w3.org/2002/xforms&quot;</span> </span><span id="L-4"><a name="L-4"></a> <span class="na">xmlns:xsl=</span><span class="s">&quot;http://www.w3.org/1999/XSL/Transform&quot;</span><span class="nt">&gt;</span> </span><span id="L-5"><a name="L-5"></a> <span class="k">&lt;xsl:output</span> <span class="na">omit-xml-declaration=</span><span class="s">&quot;yes&quot;</span> <span class="nt">/&gt;</span> </span><span id="L-6"><a name="L-6"></a> <span class="k">&lt;xsl:template</span> <span class="na">match =</span> <span class="s">&quot;/&quot;</span><span class="nt">&gt;</span> </span><span id="L-7"><a name="L-7"></a> <span class="k">&lt;/xsl:template&gt;</span> </span><span id="L-8"><a name="L-8"></a><span class="k">&lt;/xsl:stylesheet&gt;</span> </span></pre></div> </td></tr></table>
XForms, XML, XSL
Copyrighted, illegal, or inappropriate content? Email support@snipt.net.