On Dec 13, 8:46 pm, Waldemar Osuch <[EMAIL PROTECTED]> wrote: > On Dec 13, 7:52 pm, Sean DiZazzo <[EMAIL PROTECTED]> wrote:> I have a another > question... > > > using elementtree, is there a proper way to get at the data > > '123456789' in this tag? > > > '<id 123456789 />' > > > I tried making it an element, but the only attribute that returns > > anything is the "tag" attribute. Does that section of a tag have any > > proper name that I'm missing? Or is it just bad XML style? > > It is not even legal xml. > This may work. > > >>> from xml.etree import ElementTree as ET > >>> elm = ET.fromstring('<atag id="123456789" />') > >>> elm > > <Element atag at 1ba2f80> > > >>> elm.attrib > {'id': '123456789'}
Thanks. I was afraid of that. Yet another hack for my code. argggh -- http://mail.python.org/mailman/listinfo/python-list