are you using PyXML?
If this is a simple one to one relationship with dependence on order,
I'd forgo the whole PyXML, read the file line by line, and replace tags
as appropriate.  You may have to do some simple checkin, in case there
is n <object> <name>object</name>


Otherwise, have fun with the parsers - nothing is painless is SAX or
DOM.

as far as simple translation?  once you have tokenized or used PyXML to
get the elements, something like?

for tag in listofTags:
  if tagDictionary.has_key(tag):
      doSomething(tagDictionary[tag])


IMHO - PyXML is a great tool, but for something like simple
substitution, it's so so much overkill. For simple processing tasks
like this I almost always just treat it as a text file.  I resort to
PyXML when things like heirarchy are important.  Hope this  helps

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to