History entry has quote character that fouls up XML

This forum is now locked, since Gold Support is no longer offered.

Moderator: SourceGear

Locked
dwayne_davis
Posts: 34
Joined: Mon Jan 26, 2004 5:12 pm

History entry has quote character that fouls up XML

Post by dwayne_davis » Mon Jul 26, 2004 11:52 am

For some reason, the history entry for one of our files has a quote in the description. This is a file that we VSS Imported into vault. Here is a snippet of the xml we receive from the Vault client (we're on 2.0.3 for client and server):

Code: Select all

<item txid="2014" date="12/23/2003 10:36:08 AM" name="Client/Igt/Nbg/Client/AvEngine/Factories/CFactoryBase.cs" type="60" version="10" user="Athai" comment="Added in a const define for attribute name NAME = "name". Also, put some code to ensure that config must have child node and throw more detail exception on invalid config." />
 
I can't see any way to fix this file. Other history entries have the quote character represented properly (i.e. '&quote;')

This is fouling up our Cruise Control parsing of the xml. Any help would be appreciated.

dan
Posts: 2448
Joined: Wed Dec 17, 2003 5:03 pm
Location: SourceGear
Contact:

Post by dan » Mon Jul 26, 2004 12:57 pm

Yea, this is a problem in the command line client (see http://support.sourcegear.com/viewtopic.php?t=1451 for another complaint about it).

We have this logged as a request, and we'll add your name to it. In the meantime, you could try addressing it by creating a custom version of the command line client to parse out the xml-like results, and return real XML.

dwayne_davis
Posts: 34
Joined: Mon Jan 26, 2004 5:12 pm

Post by dwayne_davis » Mon Jul 26, 2004 1:44 pm

This is very strange, since some history items are xml-escaped in the resulting 'xml-like' output.

dan
Posts: 2448
Joined: Wed Dec 17, 2003 5:03 pm
Location: SourceGear
Contact:

Post by dan » Mon Jul 26, 2004 1:58 pm

Perhaps it depends on the character - is the quote char ever escaped in other output strings?

dwayne_davis
Posts: 34
Joined: Mon Jan 26, 2004 5:12 pm

Post by dwayne_davis » Mon Jul 26, 2004 2:08 pm

Other files have quotes and are escaped in the xml output. This file is not escaped. I just noticed, however, that this file has an alternate quotation mark for it.

Where other quotations are as follows:

Code: Select all

"fonts"
this file has the following:

Code: Select all

“name”
Which explains why some are escaped where others are not.

dwayne_davis
Posts: 34
Joined: Mon Jan 26, 2004 5:12 pm

Post by dwayne_davis » Tue Jul 27, 2004 3:06 pm

I have updated our Command Line Client to fix this issue. It's not the most elegant solution, butI updated the WriteTag method and added the following two lines:

Code: Select all

        strValueSafe = strValueSafe.Replace("“", """);
        strValueSafe = strValueSafe.Replace("”", """);
[/code]

dan
Posts: 2448
Joined: Wed Dec 17, 2003 5:03 pm
Location: SourceGear
Contact:

Post by dan » Tue Jul 27, 2004 3:16 pm

That's great Dwayne. Thanks for taking the initiative. It will still be a few more months before we would have been able to release a fix for it...

Locked