xml question

JYOUNG79 at kc.rr.com JYOUNG79 at kc.rr.com
Wed Sep 12 15:21:22 EDT 2007


Just curious if there's any python xml parsing tools built into the Mac (OS 10.4.10 Tiger)?  If so, 
could anyone 
share some simple code (or maybe point me to a web-site) of how to parse xml data from a 
file?  For example,  if I 
had a file that contained this:

		<colors>
			<color base="DeviceGray" />
			<color alt="DeviceCMYK" base="Separation">Black</color>
			<color alt="Lab" base="Separation">Light Blue</color>
			<color alt="ICCBased" base="Separation">Green</color>
		</colors>

I'd want to look in the 'colors' xml element, then look at each 'color' xml element inside and 
pull any that have 
values (which would be Black, Light Blue and Green).  I'd like to know how to pull 'attributes' 
too.

Thanks very much for your help.

Jay



More information about the Python-list mailing list