Different Formats of XML????

E

Eric

Hi Folks,
Can someone point me in the direction of some info on the differences
between the following two formats of XML? I work in an ORG that
utilizes both so I'd like to start gathering some data on which one is
better so that we may consolidate.

Any help would be much appreciated. Thanks!

<DATASET>
<DATAROW FNAME="Eric" LNAME="Langland" />
<DATAROW FNAME="Larry" LNAME="Ellison" />
</DATASET>

<DATASET>
<DATAROW>
<FNAME>Eric</FNAME>
<LNAME>Langland</LNAME>
</DATAROW>
<DATAROW>
<FNAME>Larry</FNAME>
<LNAME>Ellison</LNAME>
</DATAROW>
</DATASET>
 
A

Andy Dingley

Can someone point me in the direction of some info on the differences
between the following two formats of XML?

You're standing in it. Do some Google on subject lines of "element
vs. attribute"
 
S

Stefan Ram

Can someone point me in the direction of some info on the differences
between the following two formats of XML?
<DATAROW FNAME="Eric" LNAME="Langland" />
<DATAROW>
<FNAME>Eric</FNAME>
<LNAME>Langland</LNAME>
</DATAROW>

In XML, there is a discrepancy between the semantics and
syntactical restrictions. The result is that today no one can
answer this question with certainity.

Usually, there are two kinds of predicates: Unary predicates
P, written as Px, and binary relations R, written as xRy.

The assertion you want to notate is:

x is a data row and
The FNAME of x is "Eric" and
The LNAME of x is "Langland" .

In a more formal notation, using unary predicates and binary
relations this would mean:

data_row(x) ^
FNAME(x,"Eric") ^
LNAME(x,"Langland") .

Using the guideline that it enhances readability and
usability when syntactic structures are related to
semantics, this suggest to use element types for unary
predicates and attributes for binary relations, so:

<DATAROW FNAME="Eric" LNAME="Langland" />

But - this is not always possible in XML, because type and
attributes can not always be repeated as needed and the values
of attributes may not be structured.

So, some suggest to always use subelements and to ignore
attributes, while others flip wildly between attributes and
subelements with out any clear rules or even use attributes
whenever posssible just because it is easier to enter them
with their current XML-editor.

My own solution is to use "Unotal" instead of XML. Unotal
allows repeated types and attributes and it allows structured
attributes. So I can tell between subelements and attributes
by their meaning and not by arbitrary syntactical
restrictions. Thus, I have a "clean source notation". If
needed, I than can convert that to XML or whatever else is
required. See also:

http://www.purl.org/stefan_ram/pub/unotal_en
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,566
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top