Apart from that, it appears that a lot of the xml structure is involved with typesetting/formatting of the content: tags like "OrderedList", "ItemizedList", "ListItem", "Style", "Emphasis", "Strong", etc, indicate stuff that is intended for CSS handling, rather than database construction. Some of these tags are only vaguely "structural" (in the sense of describing the logical/semantic organization of the data), while others may be purely "cosmetic". I don't see any obvious way to transform this xml into a coherent csv.
So you need a more informed specification of your goal: what exactly should the csv file contain (i.e. how many fields are needed, and what are their names)? And with that in mind, how can the csv rows and columns be filled in, based on the clues available in the xml data? Some manual analysis of the data will be needed in order to write the code.
Actually, it's possible (likely?) that a proper solution will involve two or more relational tables rather than just one table. And while you're at it, you'll need to worry about making sure your csv output is well formed: quote fields where necessary, escape quotes and apostrophes within fields as needed, and watch out for newlines embedded within field values (maybe normalize these to spaces).
In reply to Re: XML to CSV
by graff
in thread XML to CSV
by Blue_eyed_son
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |