Test results for Linux

test_010023_example_ps_4

Test description

Test for correct functionality of the examples used in the xmlfy documentation.

Test status

 Pass

Run command

cat _INPUT_DATA_ ¦ xmlfy -S schema.dtd -F3 :

Input data

     UID   PID  PPID   C    STIME TTY         TIME CMD
    root   683   680   0 11:41:26 pts/4       0:00 bash
    root   763   683   0 12:00:54 pts/4       0:00 ps -f

Schema

<!ELEMENT ps (heading), (process*)>
<!ELEMENT heading (p, p, p, p, p, p, p, p)>
<!ELEMENT process (uid, pid, ppid, c, stime, tty, time, command, arg*)>
<!ELEMENT stime (hours, minutes, seconds)>
<!ELEMENT time (minutes, seconds)>
<!ELEMENT p (#PCDATA)>
<!ELEMENT uid (#PCDATA)>
<!ELEMENT pid (#PCDATA)>
<!ELEMENT ppid (#PCDATA)>
<!ELEMENT c (#PCDATA)>
<!ELEMENT tty (#PCDATA)>
<!ELEMENT command (#PCDATA)>
<!ELEMENT arg (#PCDATA)>
<!ELEMENT hours (#PCDATA)>
<!ELEMENT minutes (#PCDATA)>
<!ELEMENT seconds (#PCDATA)>

Output result

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE ps SYSTEM "schema.dtd">
<ps>
  <heading>
    <p>UID</p>
    <p>PID</p>
    <p>PPID</p>
    <p>C</p>
    <p>STIME</p>
    <p>TTY</p>
    <p>TIME</p>
    <p>CMD</p>
  </heading>
  <process>
    <uid>root</uid>
    <pid>683</pid>
    <ppid>680</ppid>
    <c>0</c>
    <stime>
      <hours>11</hours>
      <minutes>41</minutes>
      <seconds>26</seconds>
    </stime>
    <tty>pts/4</tty>
    <time>
      <minutes>0</minutes>
      <seconds>00</seconds>
    </time>
    <command>bash</command>
  </process>
  <process>
    <uid>root</uid>
    <pid>763</pid>
    <ppid>683</ppid>
    <c>0</c>
    <stime>
      <hours>12</hours>
      <minutes>00</minutes>
      <seconds>54</seconds>
    </stime>
    <tty>pts/4</tty>
    <time>
      <minutes>0</minutes>
      <seconds>00</seconds>
    </time>
    <command>ps</command>
    <arg>-f</arg>
  </process>
</ps>

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