Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


writing good xml

From: Ronald Kent Gibson <Kent.Gibson@--------.-->
To: "'xml-dev@-----.---.---'" <-------@-----.---.--->
Date: 2/24/2004 12:26:00 PM
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


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent