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

Load Balancing in Bluemix using custom domain and DNS SRV records -

oracle - pls-00402 alias required in select list of cursor to avoid duplicate column names -

python - Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>] error -