Issue1343
Created on 2007-10-27 13:33 by panzi, last changed 2008-05-10 18:37 by vhata.
| msg56849 (view) |
Author: (panzi) |
Date: 2007-10-27 13:33 |
|
I modified xml.sax.saxutils.XMLGenerator,
_xmlplus.sax.saxutils.XMLGenerator, and
_xmlplus.sax.saxutils.LexicalXMLGenerator so that they do no longer
produce those
ugly close tags for empty elements, but use the short version. So instead of
<empty></empty> you get just <empty/>. :)
I used the version of saxutils.py that is shipped with python 2.5.1.
|
| msg56850 (view) |
Author: (panzi) |
Date: 2007-10-27 13:34 |
|
patch for xml/sax/saxutils.py
|
| msg56851 (view) |
Author: (panzi) |
Date: 2007-10-27 13:35 |
|
patch for _xmlplus.sax.saxutils.py
|
| msg57202 (view) |
Author: Gabriel Genellina (gagenellina) |
Date: 2007-11-07 15:56 |
|
Some (ugly) parsers insist on <container></
container> when the element is not declared to
be empty, so this should be optional (the
default being generate <container/>)
|
| msg66551 (view) |
Author: Jonathan Hitchcock (vhata) |
Date: 2008-05-10 18:11 |
|
The attached patch makes this new feature optional, by passing the
"empty_element_tag" option to the constructor.
|
| msg66552 (view) |
Author: Jonathan Hitchcock (vhata) |
Date: 2008-05-10 18:12 |
|
I have also added some unit tests to test the feature with the option
turned on, and off - patch attached.
|
| msg66556 (view) |
Author: Jonathan Hitchcock (vhata) |
Date: 2008-05-10 18:37 |
|
Acting on a comment (with which I agree) that the "empty_elements_tag"
wasn't such an obvious name, here's a (combined) patch which uses the
name "short_empty_elements" (which was my original gut-feeling idea for
the name, before I checked the W3C standard and found that they called
them "Empty-Elements tags") instead.
|
|
| Date |
User |
Action |
Args |
| 2008-05-10 18:37:25 | vhata | set | files:
+ short_empty_tag.patch messages:
+ msg66556 |
| 2008-05-10 18:12:35 | vhata | set | files:
+ test.test_sax.py.patch messages:
+ msg66552 |
| 2008-05-10 18:11:49 | vhata | set | files:
+ xml.sax.saxutils.patch nosy:
+ vhata messages:
+ msg66551 |
| 2008-01-20 20:34:44 | christian.heimes | set | priority: normal keywords:
+ patch, easy |
| 2007-11-07 15:56:55 | gagenellina | set | nosy:
+ gagenellina messages:
+ msg57202 |
| 2007-10-27 13:35:29 | panzi | set | files:
+ _xmlplus.sax.saxutils.patch messages:
+ msg56851 |
| 2007-10-27 13:34:58 | panzi | set | files:
+ xml.sax.saxutils.patch messages:
+ msg56850 |
| 2007-10-27 13:33:55 | panzi | create | |
|