Skip to content

Adding Support for XML #5108

Description

@ErfanThinker

Hey there,
I crossed a problem and I guess a new feature should be added to realm. consider this XML:

   "Content":{
      "ContentDetail":[
         {
            "FileName":"test.mp3",
            "ContentTypeID":3,
            "ContentDetailMetadata":{
               "Metadata":[
                  {
                     "ID":2,
                     "Value":"2017-08-02 09:40:30"
                  },
                  {
                     "ID":1,
                     "Value":"35.73876557934912,51.50785446166992"
                  }
               ]
            }
         },
         {
            "FileName":"2.jpg",
            "ContentTypeID":2,
            "ContentDetailMetadata":[
               {
                  "Metadata":{
                     "ID":2,
                     "Value":"2017-08-02 09:40:30"
                  }
               },
               {
                  "Metadata":{
                     "ID":1,
                     "Value":"35.73876557934912,51.50785446166992"
                  }
               }
            ]
         }
      ]
   }
}

in which all nodes except Content can exist or be 1 of them or more than one of them. mapping this to Json and createObjectFromJson() won't work since it produces JsonObject or JsonArray base on number of sub-nodes. if there was a method like createObjectFromXML() which would handle this problem would be very nice.

Related SO Question.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions