Test results for Linux

test_001050_option_fieldnumbers

Test description

Test for field numbers being suffixed at the end of level 2 element names
starting at number 1 and increasing sequentially with every level 2 element
encountered within the same parent element, otherwise resetting back to 1.

Test status

 Pass

Run command

cat _INPUT_DATA_ ¦ xmlfy -f

Input data

Team Won Lost Drawn
Barcelona 5 1 2
Manchester 4 2 2
 
Milan 2 2 4

Output result

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xmlfy SYSTEM "xmlfy.dtd">
<xmlfy>
  <line>
    <field1>Team</field1>
    <field2>Won</field2>
    <field3>Lost</field3>
    <field4>Drawn</field4>
  </line>
  <line>
    <field1>Barcelona</field1>
    <field2>5</field2>
    <field3>1</field3>
    <field4>2</field4>
  </line>
  <line>
    <field1>Manchester</field1>
    <field2>4</field2>
    <field3>2</field3>
    <field4>2</field4>
  </line>
  <line>
    <field1>Milan</field1>
    <field2>2</field2>
    <field3>2</field3>
    <field4>4</field4>
  </line>
</xmlfy>

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