Subversion is Xmlish

time to read 6 min | 1015 words

You know that it is a bad day when you start parsing XML using regular expressions.

When I started working on SvnBridge, I expected to have a lot of issues with TFS. What I didn't expect was to get hit by a Subversion WTF of gigantic magnitude.

Take a look at the following XML:

<?xml version="1.0" encoding="utf-8" ?>
<D:propertyupdate xmlns:D="DAV:" 
            <C:bugtraq:label>Work Item:</C:bugtraq:label>
            <C:bugtraq:message> Work Item: %BUGID%</C:bugtraq:message>

Check the properties, and look closely. Despite the so-called xml header, this is not valid XML, yet this is produce (and consumed) by Subversion. This raise some interesting questions about what parser they are using, but that is beside the point.

This is wrong, period.