XML - Are parsing APIs too complex? 

I just analyzed my design work for the past day.

It turns out that I implemented simple two level hierarchy in strings, rather than XML, which is strange for my liking.

I had to implement this: A, where A has children a1, a2, ..., an, B, where B has children b1, b2, ..., bm, C, where ... and so on. Had to save the definition somewhere.

What was the first implementation like?

"A:a1:a2:a3|B:b1:b2:b3:b4:b5|C:c1:c2:c3:c4:c5:c6", where first-level node was always array[i][0] if I just parsed the string with is-everywhere split() method, passing "|" as the second parameter.

This is how it went:

var firstLevel = split(array, "|");
var secondLevel = split(firstLevel[i], ":");
var item = secondLevel(j);

Why?

My <insert worship preference>, it is still easier to parse strings than XML in JavaScript.

Categories:  XML
Monday, 11 December 2006 17:53:39 (Central Europe Standard Time, UTC+01:00)  #    Comments

 

Copyright © 2003-2024 , Matevž Gačnik
Recent Posts
RD / MVP
Feeds
RSS: Atom:
Archives
Categories
Blogroll
Legal

The opinions expressed herein are my own personal opinions and do not represent my company's view in any way.

My views often change.

This blog is just a collection of bytes.

Copyright © 2003-2024
Matevž Gačnik

Send mail to the author(s) E-mail