chenyunguiMilook / SwiftyXML

The most swifty way to deal with XML data in swift 5.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Construct XML not work correctly

kiri11ko opened this issue · comments

let newXML = LocalDataModelXML.newTasksXML!
            newXML.addChild(XML(string: tasks))

If construct XML from existing XML new tag added new tag and not parse new tag.
After parse final xml view one first tag

<Doc StatusDoc="new" >
	<clientsTasks>
		<clientTask description="Dsdsd" persone="Гребенкина Анастасия" date="1562290361.0" id_client="000006383" name="Dodd’s" />
	</clientsTasks>
	<clientsTasks>
		<clientTask description="Dsdsd" date="1562463999.0" id_client="000006383" persone="Гребенкина Анастасия" name="dsdsdds" />
	</clientsTasks>
	<clientsTasks>
		<clientTask name="dsdsdds" description="Dsdsd" date="1562463999.0" id_client="000006383" persone="Гребенкина Анастасия" />
	</clientsTasks>
	<clientsTasks>
		<clientTask date="1562463999.0" persone="Гребенкина Анастасия" description="Dsdsd" id_client="000006383" name="dsdsdds" />
	</clientsTasks>
	<clientsTasks>
		<clientTask id_client="000006383" name="dsdsdds" date="1562463999.0" persone="Гребенкина Анастасия" description="Dsdsd" />
	</clientsTasks>
	<clientsTasks>
		<clientTask persone="Гребенкина Анастасия" date="1562207178.0" description="dsdsd" id_client="000006383" name="dsdsd" />
	</clientsTasks>
	<clientsTasks>
		<clientTask date="1562121435.0" description="Hello" persone="Казакова Анастасия" name="test update view" id_client="000006383" />
	</clientsTasks>
</Doc>
commented

Hi, @kiri11ko, can you post full code, so I can better understand your question!