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