Test results for Linux

test_001705_option_unxml_emptyelement

Test description

Test for the conversion to normal text of a XML input stream
containing empty elements. The empty elements should be ignored.

Test status

 Pass

Run command

cat _INPUT_DATA_ ¦ xmlfy -U -F2 : -F3 ", "

Input data

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xmlfy SYSTEM "xmlfy.dtd">
<xmlfy>
  <line>
    <field>admin</field>
    <field>use_crypt</field>
    <field>500</field>
    <field_emptyelement/>
    <field>544</field>
    <!-- BOFH --> <field>Administrator</field>
    <field>/home/admin</field>
    <field>/bin/bash</field>
  </line>
  <!-- old <line>
    <field>Ro</field>
    <field>use_crypt</field>
    <field>211</field>
    <field>544</field>
    <field>Ro</field>
    <field>/export/home/Ro</field>
    <field_emptyelement />
    <field>/bin/sh</field>
  </line>
</xmlfy -->
  <line_emptyelement/>
  <line>
    <field>Ro</field>
    <field></field>
    <field_emptyelement
        rec="3"
        type="emptyelement" subtype="none"
        field="three" 
    />
    <field>649</field>
    <field>544</field>
    <field>"<Ro¦&Ro's>"</field>
    <field>/home/Ro</field>
    <field>/bin/bash</field>
  </line>
</xmlfy>
this line is orphaned data
<xmlfy>
  <line>
    <field>al0</field>
    <field>*</field>
    <field>650</field>
    <field>777</field>
    <field><name>Another Level 0</name><ph>12345678</ph><loc>6th floor</loc></field>
    <field>/home/al0</field>
    <field>/bin/sh</field>
  </line>
  <line_emptyelement abc="def" />
</xmlfy>

Output result

admin:use_crypt:500:544:Administrator:/home/admin:/bin/bash
Ro::649:544:"<Ro¦&Ro's>":/home/Ro:/bin/bash
al0:*:650:777:Another Level 0, 12345678, 6th floor:/home/al0:/bin/sh

Goto:   Top of page.   Section "Environment".   Section "Summary".   Section "Test cases".