Plain old SAX and minidom useable? But how then?

Stefan Behnel stefan.behnel-n05pAM at web.de
Wed Aug 1 08:26:51 EDT 2007


Hi,

calm down, minidom is not easy to use, but it can solve your problem.

Dobedani wrote:
> I guess I don't know where to look for the right information. I hope
> you guys can help me on the way. I want to retrieve a string from an
> XML-file. If Python were to have XPath available, my problem would be
> solved. The xquery string would be enough and I have already obtained
> that the string. The problem is that I cannot use any add-on - like
> xmllib, sax2 or elementtree - as my customers only have the so-called
> stock Python install - i.e. version 2.4.1.

Too bad, that rules out lxml.etree (which has XPath and loads of other goodies).


> Please: where then can I find examples of such use? If I cannot use
> xpath, I would not mind to browse a bit - e.g. using functions like
> getElementByTag() but I don't even know how to use those. TIA

Try one of these (I looked for "minidom example"):

http://www.faqs.org/docs/diveintopython/kgp_parse.html
http://docs.python.org/lib/dom-example.html
http://www.cutthecrap.biz/software/whitepapers/minidom.html

Maybe that helps?

Stefan



More information about the Python-list mailing list