[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Omaha.pm] database -> XML



Quoting Rob Townley <rob.townley@gmail.com>:

Several years ago, elements were better.

There's no good answer, I believe it depends what you are trying to do. Elements are nice because they are extendible/readable ... but lengthy at times. Take a look at the link Jay provided, the author makes good sense.

An example,

<records>
  <record>
    <id>0</id>
    <fields>
      <field>
        <name>lastname</name>
        <length>20</length>
      </field>
      <field>
        <name>city</name>
        <length>28</length>
      </field>
      <field>
        <name>zipcode</name>
        <length>5</length>
      </field>
    </fields>
  </record>
</records>

I find overkill. But apparently the M$ tools ('code generators') slurp the above xml without having to write a lick of code. I would prefer something in the middle.

<records>
  <record id="0">

    <field name="lastname">
      <length>20</length>
    </field>

    <field name="city">
      <length>28</length>
    </field>

    <field name="zipcode">
      <length>5</length>
    </field>

  </record>
</records>


Later,
George.