1e41f4b71Sopenharmony_ci# ArkTS Subsystem Changelog 2e41f4b71Sopenharmony_ci 3e41f4b71Sopenharmony_ci## cl.arkts.1 Behavior of convertToJSObject of the convertXml Module Changed in Scenarios with Consecutive CDATA Tags 4e41f4b71Sopenharmony_ci 5e41f4b71Sopenharmony_ci**Access Level** 6e41f4b71Sopenharmony_ci 7e41f4b71Sopenharmony_ciPublic API 8e41f4b71Sopenharmony_ci 9e41f4b71Sopenharmony_ci**Reason for Change** 10e41f4b71Sopenharmony_ci 11e41f4b71Sopenharmony_ciIn specific scenarios, data with consecutive CDATA tags is incorrectly parsed into the same element. 12e41f4b71Sopenharmony_ci 13e41f4b71Sopenharmony_ci**Change Impact** 14e41f4b71Sopenharmony_ci 15e41f4b71Sopenharmony_ciThe bug is fixed so that data with consecutive CDATA tags is parsed into different elements. 16e41f4b71Sopenharmony_ci 17e41f4b71Sopenharmony_ci**Start API Level** 18e41f4b71Sopenharmony_ci 19e41f4b71Sopenharmony_ci9 20e41f4b71Sopenharmony_ci 21e41f4b71Sopenharmony_ci**Change Since** 22e41f4b71Sopenharmony_ci 23e41f4b71Sopenharmony_ciOpenHarmony SDK 5.0.0.19 24e41f4b71Sopenharmony_ci 25e41f4b71Sopenharmony_ci**Key API/Component Changes** 26e41f4b71Sopenharmony_ci 27e41f4b71Sopenharmony_ciconvertToJSObject(xml: string, options?: ConvertOptions): Object; 28e41f4b71Sopenharmony_ci 29e41f4b71Sopenharmony_ci**Adaptation Guide** 30e41f4b71Sopenharmony_ci 31e41f4b71Sopenharmony_ci```ts 32e41f4b71Sopenharmony_cilet xml = '<?xml version="1.0" encoding="utf-8"?><![CDATA[ \t data\n]]><![CDATA[< > " and & \t ]]>'; 33e41f4b71Sopenharmony_cilet conv = new convertxml.ConvertXML(); 34e41f4b71Sopenharmony_cilet options = {trim : false, declarationKey:"_declaration", 35e41f4b71Sopenharmony_ci instructionKey : "_instruction", attributesKey : "_attributes", 36e41f4b71Sopenharmony_ci textKey : "_text", cdataKey:"_cdata", doctypeKey : "_doctype", 37e41f4b71Sopenharmony_ci commentKey : "_comment", parentKey : "_parent", typeKey : "_type", 38e41f4b71Sopenharmony_ci nameKey : "_name", elementsKey : "_elements"} 39e41f4b71Sopenharmony_cilet result: ESObject = conv.convertToJSObject(xml, options); 40e41f4b71Sopenharmony_ci 41e41f4b71Sopenharmony_ci// Before change: 42e41f4b71Sopenharmony_ci//let cdata = result._elements[0]._cdata; // cdata is' \\t data\\n< > \" and & \\t'. 43e41f4b71Sopenharmony_ci 44e41f4b71Sopenharmony_ci// After change: 45e41f4b71Sopenharmony_cilet cdata1 = result._elements[0]._cdata; // cdata1 is '\\t data\\n' 46e41f4b71Sopenharmony_cilet cdata2 = result._elements[1]._cdata; // cdata2 is '< > \" and & \\t'. 47e41f4b71Sopenharmony_ci``` 48e41f4b71Sopenharmony_ci 49e41f4b71Sopenharmony_ciData with consecutive CDATA tags is parsed into different elements. 50e41f4b71Sopenharmony_ci 51e41f4b71Sopenharmony_ciYou need to make adaptation to the obtained **_cdata** when both of the following conditions are met: 52e41f4b71Sopenharmony_ci1. **convertToJSObject** is used to parse XML data. 53e41f4b71Sopenharmony_ci2. Two consecutive CDATA tags exist in the XML data, and there is no space or line feed character between the two CDATA tags. 54