PDA

View Full Version : Girder 325pre8 corrupting .GML file


drobertson
October 13th, 2002, 03:55 PM
Ron,

I have a GML file created in 3.2.3 (called numbuilder.GML). When I load it into 3.2.5pre8 and do nothing but save it (as numbuilder3258.GML) the file is corrupted. If after saving it, I try File\Open (numbuilder3258.GML), I get the error "Cannot load datafile".

I have included the two files(I hope!!)

The original 3.2.3 file is called numbuilder.GML
The file saved by Girder 325pre8 is called numbuilder3258.GML

Hope you can understand this.

Also, it looks like the GML saved by 325pre8 is different.

David

Ron
October 13th, 2002, 03:55 PM
It's the quotes >"< in the name > if node=="a" <

I've upgraded the XML library probably it doesn't escape the values automagically anymore. Fixing it. Thanks for the report.

Ron
October 13th, 2002, 03:55 PM
Fixed in Girder 3.2.5pre9

MMcM
October 13th, 2002, 03:55 PM
In 3.2.5pre9, if you name a command with an & in it, it isn't escaped when saving the file. If you manually fix it to &amp; and read it back into Girder, it displays in the tree control as &.

I hope that you can configure the XML writer to do all this right and don't have to change each piece of code individually.

Ron
October 13th, 2002, 03:55 PM
There have been some complaints about this on the OpenXML list ( the code that I use ) Dieter's (the author) response was that the XML specs don't allow those chars in there. :(

I've replaced the previous code that only translated the quotes (single and double) by code that replaces all the default xml entities.

MMcM
October 13th, 2002, 03:55 PM
I'm not 100% sure I understand what the debate is. There are three things to consider: (1) what does Girder write to the file, (2) what will Girder accept when it reads the file, and (3) how does Girder treat the data when it executes.

(1) I don't think we really care, although there is no reason to go out of the way to make it ugly. Some whitespace indentation might help.

(2) Anything that another XML tool might write should work. In particular, both numeric and named character entities (the standard ones are lt, gt, amp, apos, and quot). Most of the common encodings in the <?xml part. And so on. If the file is hand-edited to not be legal XML, there is little the parser can do. So, & and < always need to be escaped. > rarely does. And ' and " when you've chosen to use that as the attribute delimiter (for instance, if you have a single value that contains both).

(3) That XML is used for externalization should make no difference at all. Whatever byte is in the character array is what is used. Girder has its own syntax that then takes over. [ for expanding variables in most strings. All of the LUA grammar. There is no provision for using XML character entities to enter or display funny characters in the UI. You use Windows facilities for that. There is no provision for Unicode outside the current code page; Delphi uses 8-bit strings.

Right?

josjojo
October 13th, 2002, 03:55 PM
How can I fix my GML file? My GML file is about 600 kb, so it's not an option to fix it by hand.

I can think of 2 possible fix options:
- With an XML editor: I have tried this, but without any results. Please tell me what software to use.
- Witch a regular expression to find the errors and fix it by hand: I'm not familiar with it. Can anybody make it for me?

The attachement is my GML file, maybe somebody can fix it :-?

Thanks

MMcM
October 13th, 2002, 03:55 PM
It's the same problem I had: some &'s need to be &amp;'s. It's quick to do with a text editor like Emacs that doesn't mind long lines too much. Would you like me to do that and email it back to you?

josjojo
October 13th, 2002, 03:55 PM
Yes! If you can do that, please.

I hope it's not too much to ask. :roll:

Thanks!

josjojo
October 13th, 2002, 03:55 PM
I fixed it myself, exactly as you said with Emacs.

But when I save the file again in Girder 3.2.5 Pre9 the file becomes corrupted again. I think it's a bug in Girder's xml parser or something.

Ron
October 13th, 2002, 03:55 PM
I'm releasing an update later today that fixes this problem, my appologies for the inconviniences.

josjojo
October 13th, 2002, 03:55 PM
Thanks!

It was a big problem for me that the GML file was corrupted because I never backed-up the GML file.

Ron
October 13th, 2002, 03:55 PM
Pre 10 has been released, please test it. Thanks!