[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Tag for every column in every row
Yihpyng Kuan ask about redundancy in xml documents: > I am new to XML, I have a question here, I wonder if > anyone can shed some light on it, many thanks. > > If I have a table T1(F1 char(10), F2 char(10)); > I have 3 rows for this table. > The XML representation of this would like this - > > <Table>T1 > <Metadata> > <Column>F1 > <Datatype>CHAR > <Length>10 > </Length> > </Datatype> > </Column> > <Column>F2 > <Datatype>CHAR > <Length>10 > </Length> > </Datatype> > </Column> > </Metadata> > <Data> > <Row 1> > <F1>data 1</F1> > <F2>data 2</F2> > </Row> > <Row 2> > <F1>data 3</F1> > <F2>data 4</F2> > </Row> > <Row 3> > <F1>data 3</F1> > <F2>data 4</F2> > </Row> > </Data> > </Table> > > I probably have some typo here. But, the problem I see > here is "if I have 100 rows of data, the above XML > would repeat this row information with those redundant > tags 100 times", isn't this a waste ? or, it actually > is not efficient ? Any better alternative ? > Yes, there is redundancy. XML was developed for other purposes, but not for maximum compaction. XML was intended to 1) make it fairly easy to describe structure in data, 2) make it fairly easy to extract that structure, and 3) be reasonably human-readable (among other things). There have been ongoing discussions on this list about various approaches to compressing xml data. There is no single, definitive answer. But for many purposes, there is no need for the utmost in redundancy reduction. If you want smaller structures, of course, there are many ways to go. But you would have found it hard to type an example for us to look at in, say, ASN.1 binary form. Or your tables could have been cast into comma-separated form. But then, it would be hard to have structure inside of table cells, for example, which you could easily have with XML. Tom Passin *************************************************************************** This is xml-dev, the mailing list for XML developers. To unsubscribe, mailto:majordomo@x...&BODY=unsubscribe%20xml-dev List archives are available at http://xml.org/archives/xml-dev/ ***************************************************************************
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|