Trying to fix the loading of documents that do not contain xlink namespace declaration but instead rely on external DTD subset to supply it (bugs 1042161 and 1102678), I replaced the xmlParseFile call to the newer xmlReadFile call with these options:
doc = xmlReadFile (localFilename, NULL, XML_PARSE_RECOVER | XML_PARSE_NOENT | XML_PARSE_DTDLOAD)
in sp_repr_read_file. This fixed the namespace bug. However this resulted in loading the external DTD across the network for ALL regular Inkscape files too! This is because all our files contain
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN" "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
which is really not necessary at all and even non-compliant (because with our extension elements, we will likely fail validation with that DTD). However that DTD reference is being inserted since Sodipodi times and is now in all old files. And this means that these files will now have a delay on load while libxml fetches the DTD from the net, and will generate an error if you try to load them while network is not available.
So, I did not commit this change, and I'm really not sure what to do about it. Should we try to supply our own catalog to the parser, which would force it to use a local copy of the DTD (which we also must therefore supply)? This sounds like a lot of hassle. Or just forbid the parser to access the net and suppress the error (this is possible)? But then the xlink namespace bugs will remain unfixed.
And can/should we, at least, stop inserting the DOCTYPE in the files we create? It really serves no useful purpose, IMHO.