Note that there are some explanatory texts on larger screens.

plurals
  1. PO- and /> in xml document (with php trying to create the same document as in example)
    primarykey
    data
    text
    <p>I have example of xml document and with php trying to create the same xml.</p> <p>This is part of example of xml document (as it appears if open with web browser)</p> <pre><code>-&lt;DeclarationFile&gt; -&lt;Declaration Id="DEC"&gt; -&lt;DokPVNv4&gt; </code></pre> <p>Need to create the same. My php code</p> <pre><code>$DOM = new DOMDocument('1.0','UTF-8'); $root = $DOM-&gt;createElement('DeclarationFile'); $DOM-&gt;appendChild($root); $child_declaration_id = $DOM-&gt;createElement('Declaration'); $root-&gt;appendChild($child_declaration_id); $child_declaration_id_att = $DOM-&gt;createAttribute('Id'); $child_declaration_id-&gt;appendChild($child_declaration_id_att); $att_child_declaration_id_text = $DOM-&gt;createTextNode('DEC'); $child_declaration_id_att-&gt;appendChild($att_child_declaration_id_text); $DokPVNv4 = $DOM-&gt;createElement('DokPVNv4'); $root-&gt;appendChild($DokPVNv4); </code></pre> <p>In output (web browser) get this</p> <pre><code>-&lt;DeclarationFile&gt; &lt;Declaration Id="DEC"/&gt; &lt;DokPVNv4/&gt; &lt;/DeclarationFile&gt; </code></pre> <ol> <li><p>In example of xml there are <code>-</code> before <code>&lt;Declaration Id="DEC"&gt;</code> and <code>&lt;DokPVNv4&gt;</code>. With my php code do not have. What means these <code>-</code> and how to create them with php?</p></li> <li><p>In example of xml in <code>&lt;Declaration Id="DEC"&gt;</code> and <code>&lt;DokPVNv4&gt;</code> there are no <code>/</code>. With my code I get <code>/</code>. How to remove them (and what these <code>/</code> mean)?</p></li> </ol> <p>I suppose all differences are related with root element? </p> <p>Update. What understand at the moment from answers: if for some element/tag has no closing tag, then element ends with <code>/</code>. And <code>-</code> <code>+</code>, yes, browser creates them.</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. 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