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

Re: bad output format design issue: svn log -v format is not parseable :-(

From: Bruce Elrick <bruce_at_elrick.ca>
Date: 2004-04-04 01:32:55 CEST

Ack. My webmail interface butchered the whitespace in my example. Sigh

 

Bruce Elrick writes:

> The XML standard states that all whitespace *between* tags, including line
> feeds, is to be preserved by the parser. It is up to the application to
> decide what to do. If your xml viewer is collapsing spaces then it is not
> following the standard
>
> I'm not sure what the standard says about spaces in tags, but I think that
> can be changed without changing the semantic meaning of the XML.
>
> So
> <path
> action=">
>
> can be changed to <path action="A"> because the carriage return is *in*
> the tag, but
>
> <sometag>
> Contents of the
> tag
> </sometag>
>
> Is such that the string representing the contents of the tag would be
> "\n Contents of the\n tag\n"
>
> The application could then choose to manipulate the string. The initial
> line feed comes as a suprise to some people.
>
> Cheers...
> Bruce
>
> C.A.T.Magic writes:
>
>> Edmund Horner wrote:
>>
>>> -----BEGIN PGP SIGNED MESSAGE-----
>>> Hash: SHA1
>>>
>>> C.A.T.Magic wrote:
>>> | how can I tell, by looking at the output
>>> | A \branches\release-0.28.0 (from \trunk:6846)
>>> | if this means the filename
>>> | "\branches\release-0.28.0 (from \trunk:6846)"
>>> | or the file
>>> | "\branches\release-0.28.0"
>>> | ???
>>> | this is evil!
>>>
>>> What about "svn log --xml" ? Hopefully it should output something that
>>> is unambiguously machine readable (though requiring an XML parser, of
>>> course).
>>
>> as far as i can see it the XML output has similar issues:
>> space characters are not escaped and the filenames are
>> not defined as string attributes but just as plaintext
>> between tags.
>> afaik, most XML parsers collapse multiple spaces into a
>> single space.
>>
>> when i look at the xml with an xml-viewer the SVN output
>> <path
>> action="A">/trunk/ a file with 2 spaces</path>
>> </paths>
>> displays as
>> <path action="A">/trunk/ a file with 2 spaces</path>
>>
>> but i also tried it with the ruby-xml parser
>> and the parsed string was correct
>> ( "/trunk/ a file with 2 spaces" )
>>
>> i'm not sure what the xml standard defines
>> for multiple spaces in this case or how other xml
>> parsers handle this.
>>
>> i noticed that other characters are escaped,
>> for example semicolons ';' are handled,
>> umlauts 'ö' remain as utf-8.
>> <path
>> action="A">/trunk/a&amp;b-ö;2 3.txt</path>
>> </paths>
>>
>>
>> but even IF i could use --xml for svn log,
>> there are several other commands
>> which fail in the same way:
>> svn status -v
>> 8 8 cat release-0.28.0 (from trunk6846)
>> 11 11 cat a file with spaces
>> 10 10 cat a&b-ö;2 3.txt
>> 12 12 administrator johnMyFile.c
>> 12 12 administrator johnMy spaced File.c
>> ---
>> and these commands cannot output xml.
>>
>> ======
>> c.a.t.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
>> For additional commands, e-mail: dev-help@subversion.tigris.org
>>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: dev-help@subversion.tigris.org
>
 

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sun Apr 4 01:33:18 2004

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

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