[thelist] n00b XML Question

Luther, Ron ron.luther at hp.com
Tue Dec 16 07:37:41 CST 2003

Marcus Andersson asked:

>>What are you using to parse the files? Is it something SAX-based or
>>DOM-based or something completely different?

Hi Marcus,

<RonL. turns a bit red in the face />

Uhhhh, actually, I'm doing a fairly simple analysis Marcus ... I'm 
just pulling the values of four elements out of each file (2 for 
reference and 2 to check the correlation between those values) ... 
I'm not attempting to parse or display the whole data set from each 
file. It's kind of a 'one off' quick and dirty analysis off some 
sample data.

Sooooooo ... I wrote a very simple perl script that treats each file 
as text [Yep - pretty much completely ignoring the benefits provided 
by the 'structure' of the XML. However, (since I'm dealing with 10s 
of 1000s of files), you can pretty much guess that they are 
'auto-generated' off a big iron box ... so it's not too terribly 
unreasonable to assume the format is predictable enough to treat 
as text.] and loops through all the files in the directory. Nothing 
fancy, extensible, modular, or reusable. Nope. It's a throwaway.

It worked. I have my data. I was just wondering what nulls were 
supposed to look like. In my data they appeared to be missing elements, 
as opposed to physical elements with missing values.

(Who _wanted_ to use the 'proper' tools (Win2k box) ... but all the 
tools I found tended to say things like 'download any 73.6 of the 
following 429 elements, fraginate them in your compiler, and use them 
to retile the floors in your kernel.' ... which is not anything *I'm* 
likely to be doing in the near future.)

More information about the thelist mailing list