Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XMLGenerator: nice <empty/> elements #45684

Closed
panzi mannequin opened this issue Oct 27, 2007 · 16 comments
Closed

XMLGenerator: nice <empty/> elements #45684

panzi mannequin opened this issue Oct 27, 2007 · 16 comments
Labels
easy topic-XML type-feature A feature request or enhancement

Comments

@panzi
Copy link
Mannequin

panzi mannequin commented Oct 27, 2007

BPO 1343
Nosy @loewis, @merwok, @bitdancer
Files
  • python-xml-sax-saxutils.zip
  • xml.sax.saxutils.patch
  • _xmlplus.sax.saxutils.patch
  • xml.sax.saxutils.patch
  • test.test_sax.py.patch
  • short_empty_tag.patch
  • xml_short_empty_elements_py3k.diff
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2010-10-17.22:48:55.213>
    created_at = <Date 2007-10-27.13:33:55.008>
    labels = ['expert-XML', 'easy', 'type-feature']
    title = 'XMLGenerator: nice <empty/> elements'
    updated_at = <Date 2010-10-17.22:48:55.206>
    user = 'https://bugs.python.org/panzi'

    bugs.python.org fields:

    activity = <Date 2010-10-17.22:48:55.206>
    actor = 'r.david.murray'
    assignee = 'none'
    closed = True
    closed_date = <Date 2010-10-17.22:48:55.213>
    closer = 'r.david.murray'
    components = ['XML']
    creation = <Date 2007-10-27.13:33:55.008>
    creator = 'panzi'
    dependencies = []
    files = ['8630', '8631', '8632', '10261', '10262', '10264', '18104']
    hgrepos = []
    issue_num = 1343
    keywords = ['patch', 'easy', 'needs review']
    message_count = 16.0
    messages = ['56849', '56850', '56851', '57202', '66551', '66552', '66556', '104573', '104574', '110591', '111057', '111070', '112979', '115680', '118861', '118988']
    nosy_count = 9.0
    nosy_names = ['loewis', 'ggenellina', 'panzi', 'Neil Muller', 'vhata', 'eric.araujo', 'r.david.murray', 'ken.ganong', 'BreamoreBoy']
    pr_nums = []
    priority = 'normal'
    resolution = 'accepted'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue1343'
    versions = ['Python 3.2']

    @panzi
    Copy link
    Mannequin Author

    panzi mannequin commented Oct 27, 2007

    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.

    @panzi panzi mannequin added topic-XML type-feature A feature request or enhancement labels Oct 27, 2007
    @panzi
    Copy link
    Mannequin Author

    panzi mannequin commented Oct 27, 2007

    patch for xml/sax/saxutils.py

    @panzi
    Copy link
    Mannequin Author

    panzi mannequin commented Oct 27, 2007

    patch for _xmlplus.sax.saxutils.py

    @ggenellina
    Copy link
    Mannequin

    ggenellina mannequin commented Nov 7, 2007

    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/>)

    @tiran tiran added the easy label Jan 20, 2008
    @vhata
    Copy link
    Mannequin

    vhata mannequin commented May 10, 2008

    The attached patch makes this new feature optional, by passing the
    "empty_element_tag" option to the constructor.

    @vhata
    Copy link
    Mannequin

    vhata mannequin commented May 10, 2008

    I have also added some unit tests to test the feature with the option
    turned on, and off - patch attached.

    @vhata
    Copy link
    Mannequin

    vhata mannequin commented May 10, 2008

    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.

    @kenganong
    Copy link
    Mannequin

    kenganong mannequin commented Apr 29, 2010

    This bug is tagged as easy and appears to already have a patch and a test posted from two years ago. What is still to be done here?

    @merwok
    Copy link
    Member

    merwok commented Apr 29, 2010

    I added the “needs review” keyword, to make this easy to find for reviewers, changed the version (new features don’t go in older versions; check if your patches still apply), and added MvL as nosy, since he’s listed as expert for the xml package in py3k/Misc/maintainers.rst

    @BreamoreBoy
    Copy link
    Mannequin

    BreamoreBoy mannequin commented Jul 17, 2010

    I believe 3.2 is still open for new features.

    @NeilMuller
    Copy link
    Mannequin

    NeilMuller mannequin commented Jul 21, 2010

    Updated version of the patch against current py3k svn (r83022) attached.

    This is a combined patch, including the previous xml.sax.saxutil changes (including the 'short_empty_elements' keyword) and the new tests.

    @BreamoreBoy
    Copy link
    Mannequin

    BreamoreBoy mannequin commented Jul 21, 2010

    The patch looks clean to me, applied small edits to change it from git to svn. Changed test_sax got 7 errors on run. Changed saxutils 53 tests all passed. Can this please be committed.

    @BreamoreBoy
    Copy link
    Mannequin

    BreamoreBoy mannequin commented Aug 5, 2010

    Can a committer look at this please.

    @merwok
    Copy link
    Member

    merwok commented Sep 6, 2010

    Patch looks good to me.

    @NeilMuller
    Copy link
    Mannequin

    NeilMuller mannequin commented Oct 16, 2010

    So what still needs to happen to get this in?

    Patch still applies to current python 3.2 trunk (r85564).

    @bitdancer
    Copy link
    Member

    Committed Neil's patch (after adding docs) in r85671. Thanks.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    easy topic-XML type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants