snipt

Ctrl+h for KB shortcuts

Java

open xml document with JDOM

1
2
3
4
5
6
// Build the document with SAX and Xerces, no validation
SAXBuilder builder = new SAXBuilder();
// Create the document
Document doc = (Document) builder.build(file);
// Output the document, use standard formatter
Element root = doc.getRootElement();
https://snipt.net/embed/5764e8a5cab74aa2aea1046bbfb71408/
https://snipt.net/raw/5764e8a5cab74aa2aea1046bbfb71408/
5764e8a5cab74aa2aea1046bbfb71408
java
Java
6
2016-09-26T01:03:39
True
False
False
/api/public/snipt/11843/
open-xml-document-with-jdom
<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="c1">// Build the document with SAX and Xerces, no validation</span> </span><span id="L-2"><a name="L-2"></a><span class="n">SAXBuilder</span> <span class="n">builder</span> <span class="o">=</span> <span class="k">new</span> <span class="n">SAXBuilder</span><span class="o">();</span> </span><span id="L-3"><a name="L-3"></a><span class="c1">// Create the document</span> </span><span id="L-4"><a name="L-4"></a><span class="n">Document</span> <span class="n">doc</span> <span class="o">=</span> <span class="o">(</span><span class="n">Document</span><span class="o">)</span> <span class="n">builder</span><span class="o">.</span><span class="na">build</span><span class="o">(</span><span class="n">file</span><span class="o">);</span> </span><span id="L-5"><a name="L-5"></a><span class="c1">// Output the document, use standard formatter</span> </span><span id="L-6"><a name="L-6"></a><span class="n">Element</span> <span class="n">root</span> <span class="o">=</span> <span class="n">doc</span><span class="o">.</span><span class="na">getRootElement</span><span class="o">();</span> </span></pre></div> </td></tr></table>
document, jdom, open

JavaScript

.Code.JavaScript.Tiny.CreateElement.Dc

1
2
3
dc=function(tag){
	return(document.createElement(tag));
}
https://snipt.net/embed/112471269e5b74e95e6d4e334775ed2e/
https://snipt.net/raw/112471269e5b74e95e6d4e334775ed2e/
112471269e5b74e95e6d4e334775ed2e
js
JavaScript
3
2016-09-26T06:56:15
True
False
False
/api/public/snipt/3676/
codejavascripttinycreateelementdc
<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></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a><span class="nx">dc</span><span class="o">=</span><span class="kd">function</span><span class="p">(</span><span class="nx">tag</span><span class="p">){</span> </span><span id="L-2"><a name="L-2"></a> <span class="k">return</span><span class="p">(</span><span class="nb">document</span><span class="p">.</span><span class="nx">createElement</span><span class="p">(</span><span class="nx">tag</span><span class="p">));</span> </span><span id="L-3"><a name="L-3"></a><span class="p">}</span> </span></pre></div> </td></tr></table>
a3lyphe, create, createelement, dc, document, ecma, element, general, javascript, return, short, tag, universal

JavaScript

.Code.JavaScript.Tiny.GetElement.$

1
2
3
$=function(id){
	return(document.getElementById(id.toString()));
}
https://snipt.net/embed/8d4ad096072970dbe92896f8553e9f69/
https://snipt.net/raw/8d4ad096072970dbe92896f8553e9f69/
8d4ad096072970dbe92896f8553e9f69
js
JavaScript
3
2016-09-26T17:54:06
True
False
False
/api/public/snipt/3675/
codejavascripttinygetelement
<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></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a><span class="nx">$</span><span class="o">=</span><span class="kd">function</span><span class="p">(</span><span class="nx">id</span><span class="p">){</span> </span><span id="L-2"><a name="L-2"></a> <span class="k">return</span><span class="p">(</span><span class="nb">document</span><span class="p">.</span><span class="nx">getElementById</span><span class="p">(</span><span class="nx">id</span><span class="p">.</span><span class="nx">toString</span><span class="p">()));</span> </span><span id="L-3"><a name="L-3"></a><span class="p">}</span> </span></pre></div> </td></tr></table>
$, a3lyphe, document, dollar, ecma, element, function, general, get, getelementbyid, id, javascript, notstring, short, tiny, tostring, universal
Copyrighted, illegal, or inappropriate content? Email support@snipt.net.