This is not really xdg-open's fault. For example, I believe it works in KDE (as per bug #7863); but it doesn't work in GNOME, because gvfs-open doesn't support it.
xdg-open should (as usual) paper over the cracks here, by detecting queries (and anchors) in file: URLs, and improving open_generic to open them with a browser. This can be achieved by improving is_file_url_or_path to be, as it were, is_plain_file_url_or_path.
This bug prevents xdg-open being used in some places, e.g. as Racket's launcher (www.racket-lang.org).