Skip to main content
Apollo102
Inspiring
May 14, 2014
Question

Fundamental question about XML and tables

  • May 14, 2014
  • 1 reply
  • 537 views

Hi,

I have a general fundamental question about XML and tables.

Why should XML already concretely map tables in its structure XML markup data? I think "tables" already represent a kind of formatting. Normally one does not want any format-related markup data in XML. Is this not a contradiction to the basic idea of XML? Is this a compromise, so that there are no complex r/w rules required and it will be technically easier?

Thanks for your reply.


Apollo102

This topic has been closed for replies.

1 reply

Inspiring
May 16, 2014

Hi Apollo,

if you look at the example below, you will see, that the structure of a table simply represents the structure of data in a natural way:

<mydata>

  <sometitle>This is the Heading</sometitle>

  <containerofallmydata>

  <data>

  <dataentry>

  <name>My name</name>

  <address>My address</address>

  </dataentry>

  <dataentry>

  <name>Your name</name>

  <address>Your address</address>

  </dataentry>

  </data>

  </containerofallmydata>

</mydata>

<table>

  <title>This is the Heading</title>

  <tgroup>

  <tbody>

  <row>

  <col>My name</col>

  <col>My address</col>

  </row>

  <row>

  <col>Your name</col>

  <col>Your address</col>

  </row>

  </tbody>

  </tgroup>

</table>

You could translate that table to some completely different presentation format, but the structure itself is well defined.

So there's no real difference in XML between "table" data and well structured content.

Apollo102
Apollo102Author
Inspiring
May 16, 2014

Hi Gorly,

thank you for your reply.

In this case I agree with you totaly.

We often use a FM table to do some formating. Less because of providing data which is structured like a table.

For example:

FM-Layout of a safety note:

col 1: saftey symbol/sign                  col. 2 with two rows:      1st row in col 2: Title of a saftey note

                                                                                                2 nd row in col 2: Detail text for the saftey note.


XML data could then look like this:


<safety note type = "1">   /* the type indicates the symbol */
       <filter>
             <device type="A"/>   /* to be able to do some filtering via attribut
             <device type="B"/>
      </filter>
      <title>blbababbabab</title>
      <description>bssasaslasasalsa</description>
</safety note>


In this case the XML markup data is fare away from the table structure. But in FM we are using tables for the layout.

Regards

Apollo102

Inspiring
May 16, 2014

Hi,

now I see where you're coming from

The table representation in this case is only the workaround of the shortcomings of FM.

It would be completely suitable to pre- or postprocess these informations into a rudimentary structure.

This is where the EDD and the DTD for the same information type may differ.

It is also not completely possible to separate information and layout completely, as you there is also information stored in layout elements (some information just doesn't make much sense if not presented in a table, i.e.)

You could see every inline element already as layout information. But if you take it away, you actually will lose information.

By the way, your example of a safety note can also be represented in quite some other ways, than as a table (I know that the tekom does see this this differently).

-Alex