OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   writing good xml

[ Lists Home | Date Index | Thread Index ]



Dear All

A general question and a specific one.

Someone once told me that you should only used attributes when you know that
you will never need another attribute. (Case 1)

And then I read somewhere to forget about attributes except for the
exception of an id attribute. (Case 2)

Does anyone care to comment and clarify this.

And to add a specific question.

I want to define a set of 64 bit flags, and I want to only define ones that
are true.

What do you reckon is the best ways to do this:


Case 1

<x flag0="true" flag4="true"/>

or 

Case 2

<x>
<flag0>true</flag0>
<flag4>true</flag4>
</x>


or something like:

Case 3

<Flags><2></2><7></7><18></18></Flags>


or 

Case 4

<Flags Value="20"> <!- Binary 10100 -->
 <flag3/>
 <flag5/>
</Flags>


or 


Case 5

<FlagDef>
 <Serif>2</Serif>
 <Italic>7</Italic>
 <SmallCap>18</SmallCap>
</FlagDef>

<Flags Value="9">
 <Serif>true</Serif>
 <Italic>true</Italic>
</Flags>

or something better? Can anyone see any problems with any of the
propositions?


I would like the resulting XML to be easy to parse and to transform ( ie not
tricky xpath or recursion required).


I haven't decided whether to use events such as those found in sax. 

any comments or suggestions would be gladly appreciated.


regards

kent gibson




 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS