Skip to content
This repository has been archived by the owner on Jan 7, 2021. It is now read-only.

toXml converts all the child nodes to attributes #188

Open
hussain1368 opened this issue Jan 14, 2020 · 1 comment
Open

toXml converts all the child nodes to attributes #188

hussain1368 opened this issue Jan 14, 2020 · 1 comment

Comments

@hussain1368
Copy link

hussain1368 commented Jan 14, 2020

when I convert an xml string to json and convert it back to xml all the child nodes are converted to attributes
initial xml string:

<CBNA_v5> <formhub> <uuid>022b0937ab2c48cea6df4e1db2bb0318</uuid> </formhub> <CommunityBased> <EnteredBy>Bashir Laly</EnteredBy> <EntryDate>2020-01-06</EntryDate> <AssessmentDate>2019-12-15</AssessmentDate> <ADM1Code>AF01</ADM1Code> <ADM2Code>AF0113</ADM2Code> <SettlementCode>AF0113_V_0013</SettlementCode> <SupervisorName>Aziz Rahman</SupervisorName> <Enumerator>Nasrin</Enumerator> <PathType>Asphalt</PathType>
....

convert to json and back to xml:

<CBNA_v5 end="2020-01-06T14:52:35.439+05:30" today="2020-01-06" deviceid="961416219268458"> <formhub uuid="022b0937ab2c48cea6df4e1db2bb0318" /> <CommunityBased EnteredBy="Bashir Laly" EntryDate="2020-01-06" AssessmentDate="2019-12-15" ADM1Code="AF01" ADM2Code="AF0113" SettlementCode="AF0113_V_0013" SupervisorName="Aziz Rahman" Enumerator="Nasrin" PathType="Asphalt" CDCRepName="Aminullah" CDCRepTitle="Village Elder">
.....

@xamgore
Copy link

xamgore commented Jan 21, 2020

Have you tried the reversible option? json ⟺ xml conversion is not bijective by default.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants