Open KaiTeuber opened 4 years ago
If I change CodingKey enum to
enum CodingKeys: String, CodingKey { case int case bool case string = "#CDATA" } }
value gets read.
Glad you found a workaround here! Do you get the expected behavior with <![CDATA[string]]>
(extra ]
) ? Or is there still an issue
same behavior with the extra ] - if I use "#CDATA" as coding key it works too
It doesn't look like an error, it's just undocumented. @MaxDesiatov, please add an example to the Readme. Thanks. P.S.: cool project!
FYI, I am pretty sure this was fixed with https://github.com/CoreOffice/XMLCoder/pull/261
Hi, I'm trying to parse the following XML:
<Model int="123" bool="true"> <![CDATA[string]> </Model>
Into this struct:
struct Model: Codable { let string: String let int: Int let bool: Bool enum CodingKeys: String, CodingKey { case int case bool case string = "" } }
But string stays empty. If I replace <![CDATA[string]> with string all things work as expected.