Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The basic structure of XML is quite simple:</p> <pre><code>&lt;tagname [attribute[="value"] ...]&gt;content&lt;/tagname&gt; </code></pre> <p>where the content may contain both normal text and more XML structures, or the special form</p> <pre><code>&lt;tagname [attribute[="value"] ...]/&gt; </code></pre> <p>which is equivalent to</p> <pre><code>&lt;tagname [attribute[="value"] ...]&gt;&lt;/tagname&gt; </code></pre> <p>that is,. empty content.</p> <p>So if you don't need to interpret a DTD or do other fancy things, you can do the following:</p> <ol> <li><p>Check that the first non-whitespace character is <code>&lt;</code>. If not, you don't have XML and can just give an error and exit.</p></li> <li><p>Now follows the tag name, until the first whitespace, or the <code>/</code> or the <code>&gt;</code> character. Store that.</p></li> <li><p>If the next non-whitespace character is <code>/</code>, check that it is followed by <code>&gt;</code>. If so, you've finished parsing and can return your result. Otherwise, you've got malformed XML, and can exit with an error.</p></li> <li><p>If the character is <code>&gt;</code>, then you've found the end of the begin tag. Now follows the content. Continue at step 6.</p></li> <li><p>Otherwise what follows is an argument. Parse that, store the result, and continue at step 3.</p></li> <li><p>Read the content until you find a <code>&lt;</code> character.</p></li> <li><p>If that character is followed by <code>/</code>, it's the end tag. Check that it is followed by the tag name and <code>&gt;</code>, and if yes, return the result. Otherwise, throw an error.</p></li> <li><p>If you get here, you've found the beginning of a nested XML. Parse that with this algorithm, and then continue at 6.</p></li> </ol>
    singulars
    1. This table or related slice is empty.
    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