Hi, I'm attempting to create a regular expression that removes redundancy in empty XML elements. For example:
<root></root> The regular expression would convert the XML above into: <root/> And another complex example: <root><frame type="image"><action></action></frame></root> would be: <root><frame type="image"><action/></frame></root> So far I've been unsuccessful in creating a regular expression to do this. Below are outlined various guarantees: - The XML to be parsed shall have NO comments in it - The XML to be parsed shall have NO whitespace (spaces, tabs, carriage returns, etc) between elements. The examples above represent what this means. Thanks.
-- http://mail.python.org/mailman/listinfo/python-list