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
Post a Comment