blackberry / webworks-gui

GUI Tool for WebWorks 2.0
https://developer.blackberry.com/html5/
Apache License 2.0
3 stars 5 forks source link

Comment line in config.xml breaks the Save feature in GUI #231

Open thtro opened 10 years ago

thtro commented 10 years ago

Hi, I manually added a line in my config.xml like this:

which I kept there for testing purposes, but when I modified the id of the app from the GUI > Configuration it messed up the entire config.xml, making the xml invalid.

kflores772 commented 10 years ago

Where did you add the comment line? I tried to reproduce this by placing that comment on different lines but every time I saved the Configuration in the GUI, it would rewrite the entire config. This would erase the comment line (which is a separate issue) but the xml was still valid.

This is probably related to #223

thtro commented 10 years ago

Unfortunately I can't reproduce it myself...strange. I looked at the #223, but the corruption I saw didn't resemble that... What I saw was some malformed CDATA tags, that contained the initial comment, but those CDATA was added at the end of the config.xml

Basically the line was added right beneath the default content tag.

http://pastebin.com/zeJSz5GB

jsoref commented 10 years ago

The other form of corruption I've seen is that if you have two tags in the same container, you're likely to be unhappy. I fully intend to replace the xml handler thing we're using in the GUI.

This is the buggy component we're using:

> var x=require('xml-mapping');
undefined

Here's normal input:

> y='<a><b/></a>'
'<a><b/></a>'
> x.load(y)
{ a: { b: {} } }
> x.toxml(x.load(y))
'<a><b/></a>'

Here's #223:

> y1='<!-- hi -->'+y
'<!-- hi --><a><b/></a>'
> x.toxml(x.load(y1))
'<row><!--hi--><a><b/></a></row>'

This is probably what you saw:

> y2='<a><!--he--><b/><!--lo--></a>'
'<a><!--he--><b/><!--lo--></a>'
> x.toxml(x.load(y2))
'<a><b/><:c><![CDATA[he]]></:c><:c><![CDATA[lo]]></:c></a>'
thtro commented 10 years ago

That's exactly what I saw, yes. I suppose this issue can be closed, given that it's totally related to #223. Thanks for the explanation!