View Issue Details

IDProjectCategoryView StatusLast Update
0008420Multi Theft Auto : San AndreasScriptingpublic2014-08-04 18:01
ReporterCheezAssigned ToJusonex 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product Version 
Target Version1.4.1Fixed in Version1.4.1 
Summary0008420: Cannot add CDATA tags using xmlNodeSetValue(node), node:setValue() or node.value
Description

The <, > and & characters are illegal in XML and the must be escaped using CDATA tags, but unfortunately, when you try to do node.value = "<![CDATA[VALUE]]>", inside the XML file, the < and the > get replaced with < and > like this:
http://i.imgur.com/EwHXfa8.png
This way you can't add CDATA tags using xmlNodeSetValue(node), node:setValue() or node.value.
I made a workaround using file functions and a pattern(string:gsub("(<)(!%[CDATA%[)(.-)(%]%])(>)","<%2%3%4>")) for replacing those character codes with < and >, but I think this should be fixed.

NOTE: The same thing applies to the ampersand.

Additional Information

List of converted characters:
< = <

= >
& = &

TagsNo tags attached.

Activities

Cheez

2014-08-02 12:36

viewer   ~~0021621

It looks like the character codes got converted to characters:
< = & lt;

= & gt;
& = & amp;
Remove the spaces.

Jusonex

2014-08-04 11:37

administrator   ~~0021658

What do you think of a new parameter named "useCDATA"?

Cheez

2014-08-04 15:02

viewer   ~~0021660

Last edited: 2014-08-04 15:03

View 2 revisions

That would be ok, but I think that a parameter like convertIllegalCharacters would be better, if it's possible.

Jusonex

2014-08-04 18:01

administrator   ~~0021661

Fixed in https://code.google.com/p/mtasa-blue/source/detail?r=6782

Issue History

Date Modified Username Field Change