(XML) A list of class instances - how do I get them to reference each other?

Spitfire 1500 s1500 at nospam.sihope.com
Thu Mar 14 17:06:57 CET 2002

I'm currently trying to bring XML data into a format that Python can

For the XML document,  I want to have it eventually(thru minidom or the
like) parsed over into a list of class instances. Each tag would get its
class instance, which could be a specific class for its tag.

I was sucessful making a list of class instances, but I want to add
attributes to each class such as "parentof" "Nextsibling",
"previoussibling', "childof" and so forth. basically, attributes that
reference different class instances to represent XML in a linked list. The
"root" ement(in this case, it would be <svg>), would be the first item in
the list.

The question is, how would I go about with the method of referencing each of
those class instances in relation to each other? Would I just use the list
index # in relation to each other, or is ther something better to represent
a unique class instance in the list?

Take note, on what I have so far, it's not hooked up to an XML parser yet.
I'm just trying to get the stucture down first.


More information about the Python-list mailing list