ios - How do I format XML files in swift? -


i creating xml file using gdataxmldocument library. creating xml file below image:

but create file in proper format below image:

how format xml files using swift?

ok, solved question myself.

edit gdataxmlnode.m make pretty-print xml default

open gdataxmlnode.m, , find method - (nsstring *)xmlstring

replace: int format = 0 int format = 1;

then write code below in swift:

let document : gdataxmldocument = gdataxmldocument(rootelement: rootelement) let xmlstring : string = gdataxmldocument.prettyprintxml(nsstring(string:document.rootelement().xmlstring()) string) 

this working fine.


Comments

Popular posts from this blog

c++ - What's the differece between of link to a dynamic file and as a input object? -

javascript - Feed FileReader from server side files -

Android Unit Testing / Mockito: android.location.Location not mocked -