Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Storing arrays in XML

Name: Anonymous 2006-12-28 15:37

Hay guys!

I have an array of items I wish to store in XML (since showing XML on teh intarweb is easy). Does anonymous have a good suggestion as to how?

My current implementation is simply separating each item with a semicolon, i.e. "item1;item2;item3;item4", but this is (a) annoying to split into items, and (b) annoying to put back into XML. Suggestions pl0x!

Name: Anonymous 2006-12-30 18:12

Benefits of XML:
*You can read it in a text editor, no MACHINE CODE involved
*PHP: domxml_open_file() <- native support for XML
*Python: xml.sax.parse() <- native support for XML
*Perl: CPAN XML <- lots of CPAN modules for Perl
*C++: xmllib + lots more.
*The four previous points also mean that it's very good for sharing data between software and the web, and so on.

Not enough? How about this:

*Being able to read your input/output data makes debugging a whole lot easier. You could then move over to a format with better serialization whenever you wish.
*Being able to WRITE "serialized" data for your program allows you to test the program in all sorts of ways that might not be possible when you have to rely on other software to create that data for you.

Now I know what kind of replies this post is going to get, I mean, this is /prog/, about 99% of you are elitist faggots. Its up to the rest of us to attempt serious debate, and to inform others.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List