[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Action request: mime-type of xml-dtd should be treated as text

From: John Aldridge <john.aldridge_at_informatix.co.uk>
Date: Tue, 05 Feb 2008 18:22:48 +0000

John Peacock wrote:
> Mark Irving wrote:
>> An XML DTD is often, but not always, prepared with a text editor or a
>> syntax-aware text editor. Exactly the same claim can be made about,
>> say, a C++ source file. If SVN presents C++ source as text, shouldn't
>> it do the same for application/xml-dtd? The argument is weaker for
>> application/xml, which is more likely to be edited with a specialized
>> program, but is often text.
>
> I've already responded several times to these threads explaining that in
> the generic case, all XML files are not "text documents" from the point
> of view of Subversion (or ordinary diff tools for that matter). So far,
> no one seems to believe me, perhaps because I have not been using the
> appropriate language. Let me try again.
>
> XML documents are *structured* documents that just so happen to be
> [usually] stored as textual files. By this I mean that the actual
> makeup of the documents themselves are ASCII (or possibly UTF-8)
> characters (which would normally be considered "text"); I'm ignoring
> CDATA blocks for the moment. But the overall structure of any XML
> document is not necessarily fixed; there are transformations of the
> textual representation that are equivalent XML documents.

I do believe you, honest! I just don't see why it matters :-)

As (my colleague) Mark pointed out, it's also true of C++ source files
(added whitespace is often semantically neutral, for example), and
no-one's arguing that C++ source should be treated as binary. For
another example, consider files with mime-type "text/html". Subversion
does regard these as text -- thank goodness -- although there are lots
of semantically neutral reformattings which can be applied.

Granted there will be cases where the text representing the XML infoset
is changed radically although the infoset itself remains constant. Even
though regarding the file as text is not useful in those circumstances,
I don't see what harm is done. The worst would be that an inappropriate
merge happened which resulted in the file becoming invalid XML -- again,
I don't see a difference between that and a merge which renders C++ code
uncompilable.

> Some of the future development of Subversion will probably include a way
> to map a specific external tool to a specific MIME file type. This
> would allow you to use an XML diff tool for comparing changes to files,
> just as it would allow you to use an image editing tool to compare
> changes to jpeg's for example.

That would be splendid, but in the meantime treating XML as text would
be an improvement for anyone who either uses a text editor to edit XML
files, or consistently uses an single editing tool which writes a
reasonable canonical representation.

-- 
Cheers,
John
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: users-help_at_subversion.tigris.org
Received on 2008-02-05 19:23:12 CET

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.