Lists Home |
Date Index |
My comments will be on the proposed approaches, and I'm sure that others
will comment on SAX (takes me back to my days of breakpointing an OS and
verifying the set/cleared bits in the registers):
First, a question: Do you really need to work at the binary level?
Having said that:
Cases 1 and 2: Although these represent a possible approach, the issue I
see is that they do "more work" than is necessary - that is, they not
only list the flags, but a Boolean value of "true". If you really need
to list the Boolean value for the set flags, you might as well list all
flags, with a value of "false" for those that are cleared. Otherwise,
the best approach is (in general, separate from synxtax) to list only
Case 3: Would not recommend, as you are using empty elements to
represent data, which is not generally considered to be a sound approach
(elements should represent metadata about the data).
Case 4: If you list the base 10 equivalent of the binary value, there
should be no reason to list the individual flags - as with Cases 1 and
2, this is more work than necessary. If the receiving system can convert
(or can be made to convert) a base 10 number into its equivalent binary
representation, than simply providing the base 10 representation should
Case 5: Did not see any value in mixing fonts with the numeric values
Booz | Allen | Hamilton
Strategy and Technology Consultants to the World
Ronald Kent Gibson wrote:
> 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"/>
> Case 2
> or something like:
> Case 3
> Case 4
> <Flags Value="20"> <!- Binary 10100 -->
> Case 5
> <Flags Value="9">
> or something better? Can anyone see any problems with any of the
> 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.
> kent gibson
> The xml-dev list is sponsored by XML.org <http://www.xml.org>, an
> initiative of OASIS <http://www.oasis-open.org>
> The list archives are at http://lists.xml.org/archives/xml-dev/
> To subscribe or unsubscribe from this list use the subscription
> manager: <http://www.oasis-open.org/mlmanage/index.php>