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
When an element stores its text content via the empty-string CodingKey (""), XMLEncoder pretty printing splits the intrinsic value onto its own line instead of keeping the element inline.
Minimal example:
structMeasurement:Codable{@Attributevarref:String?varvalue:DoubleenumCodingKeys:String,CodingKey{case ref
case value =""}}letencoder=XMLEncoder()
encoder.outputFormatting =[.prettyPrinted]
encoder.prettyPrintIndentation =.spaces(4)
When an element stores its text content via the empty-string CodingKey (
""),XMLEncoderpretty printing splits the intrinsic value onto its own line instead of keeping the element inline.Minimal example:
Actual output:
Expected output:
This also affects the same intrinsic-value shape when the element has no attributes.