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] XML to comma or tab separated file

[ Lists Home | Date Index | Thread Index ]


While one can always flatten a heirarchical file its not always prgamatic. What
I see, however, of what you are doing I would think its quite sufficient (maybe
even appropriate lacking other tools).

You are obviously trying to hammer it into some "relational" database. I would
suggest that you drop the goal of a single file and accept the liberation of
not just a bunch of commas or tabs but multiple files.

Your case appears pretty straightforward as it seems a product of a relational
model mapped into a heirarchical presentation (here some XMLish thing). You
now want to import it into some database so the logical step would be to
identify the "patterns" and design a database model (which can but need not
be the thought model behind the creation of the XMLish template you have in
your hands) and then convert your inputs into the one more more tables you need.

Here, for example, you have some concept of event and multiple sponsors and
sponsors probably have some descriptive info too like name, address, telephone
number, etc. 

Quoting Allison Bloodworth <abloodworth@berkeley.edu>:

> Hi,
> We are trying to determine the best way to convert an XML file into a comma
> or tab separated file. The problem is that the XML file contains multiple
> instances of many elements (e.g. there is one Event Title, but many Event
> Sponsors) so it would be hard to do an accurate mapping from field labels to
> the data. E.g., from http://www.ietf.org/rfc/rfc4180.txt: 
>        field_name,field_name,field_name CRLF
>        aaa,bbb,ccc CRLF
>        zzz,yyy,xxx CRLF
> We could calculate the maximum number of each field and use the maximum
> number of each element we found in the field_name line. E.g.
> Event_title, Event_Sponsor_1, Event_Sponsor_2, Event_Sponsor_3,
> Event_Location, etc.
> Aaa, bbb, ccc, ddd, eee, ... (for 3 Event Sponsors)
> Aaa, bbb, , , eee, ...		(for 1 Event Sponsor)
> However, I'm thinking that might result in an overly confusing file for
> simpler events.

Confusing to software?

> Any thoughts on this?
> Allison Bloodworth
> Principal Administrative Analyst
> e-Berkeley Program Office
> University of California, Berkeley
> (415) 377-8243
> abloodworth@berkeley.edu

Edward C. Zimmermann, Basis Systeme netzwerk, Munich
Office Leo (R&D):
   Leopoldstrasse 53-55, D-80802 Munich,
   Federal Republic of Germany


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

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