Thomas Lehmann wrote: > Hi! > > Is there a way to recognize short tags in a XML? > I'm implementing a SAX handler... > > Problem: storing the XML code I would need this information > in the startElement ... > > How can I handle this? > > <element id="abc" /> > <element id="xyz" >any text</element>
So ... are you writing as you read? If so, I'm not sure you can know which form to write out immediately. Best bet would be to delay write until the next SAX event. The next SAX event will tell if the element should be written as <element /> or <element>. --David -- http://mail.python.org/mailman/listinfo/python-list