chenyunguiMilook / SwiftyXML

The most swifty way to deal with XML data in swift 5.
MIT License
101 stars 27 forks source link

Construct XML not work correctly #10

Open kiri11ko opened 5 years ago

kiri11ko commented 5 years ago
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>
chenyunguiMilook commented 5 years ago

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