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

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Re: [xml-dev] Penance for misspent attributes

[ Lists Home | Date Index | Thread Index ]

[Simon St.Laurent]

> 
> A lot of people have been storing data in attributes rather than in
> element content.  There are lot of reasons for this, ranging from a more
> compact form to simpler processing in SAX.  (Attributes are presented as
> a convenient group, while you have to wait for child elements)
> 
> The problem with using attributes for data is that there is no direct
> way to associate metadata with attribute content.  There is a very easy
> direct way to associate metadata with element content - it's called
> attributes.  Adding additional information about attributes requires
> either external sources (DTDs, schemas) or XPath (which I believe XForms
> uses) or various ad-hocery.  Direct serialization of any of this gets
> ugly very quickly.
> 

Just think how you could switch things around!

<rowset>
    <metadata>
        <att name='col1'>
            <type>integer</type>
            <appinfo>....</appinfo>
            <data_dictionary><range>0..123</range></data_dictionary>
        </att>
        ...
    </metadata>
<row col1='1' col2='dog' col3='123.45.67'>
</row>
</rowset>

Cheers,

Tom P




 

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

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