You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import Foundation
import XMLCoder
struct CData: Codable {
let string: String
let int: Int
let bool: Bool
}
let example = CData(string: "string", int: 123, bool: true)
let xmlEncoder = XMLEncoder()
xmlEncoder.stringEncodingStrategy = .cdata
xmlEncoder.outputFormatting = .prettyPrinted
let encoded = xmlEncoder.encode(example)
let encodedAsString = String(data: encoded, encoding: .utf8)
print(encodedAsString!)
Example:
Produces:
Expected:
The text was updated successfully, but these errors were encountered: