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

php - Webix Data Loading from Laravel Link -

libGdx unable to find files in android application data directory -

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