Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 620313
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T18:45:00+00:00 2026-05-13T18:45:00+00:00

I have an XML file which contains lists of stores, a simplified version is

  • 0

I have an XML file which contains lists of stores, a simplified version is below. What I would like help with is some high-level ideas on the simplest ways to move this data into objects for storage in Core Data. I see suggestions around key-value pairs but as you can see in my example below, I have child elements with the same name/key and there can be an arbitrary number of these for each store element.

I intend to store these objects within the app for future use (they will be annotations on a map). So, each duplicate field needs to be stored, one of them will not suffice. I know how to model it in Core Data I believe, I’ll have a phone-number entity and a store entity and will just relate the two based on <store-id>. I’m just trying to use a simple method to move them from XML to Core Data via some other data structure.

XML sample:

<stores>
  <store>
   <store-id>1</store-id>
   <city>Dublin</city>
   <phone>011234567</phone>
   <phone>011234566</phone>
   <owner>Joe Bloggs</owner>
  </store>
  <store>
   <store-id>2</store-id>
   <city>Cork</city>
   <phone>019876543</phone>
   <phone>019876542</phone>
   <owner>Joe Bloggs</owner>
  </store>
<stores>

If key-value pairs are the way to go, please point me to a method where I can account for the duplicate elements. If there’s another way, I’m all ears.

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T18:45:00+00:00Added an answer on May 13, 2026 at 6:45 pm

    The harder part is going to be designing a data model that makes sense. You’ll probably need an entity for store, one for phone, and probably one for owner. Store should be one-to-many with phone number, and one-to-one with owner (just looking at your data).

    Once you have the data model laid out, then you can use either NSXMLParser or a third party library like TouchXML to parse the XML. Start with your element. For each item in there, create an object based on the store entity. For each phone in the element, create a phone entity, and so on.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have written xml file which contains html tags as element like <component> <input
I have an XML file which has many section like the one below: <Operations>
I have a file frequencies.xml which contains lines with this form: <?xml version=1.0?> <!DOCTYPE
Good morning. I have an XML file which contains lists of warning and errors
I have an xml file which contains query details like <queries> <query> <name>GetStudentById</name> <statement>select
I have a xml file which contains arabic characters.When i try to parse a
I have an XML file of(30GB) which contains 2 classes of data, The data
I have a XML-file, which contains the data of a calendar. I want to
I have a large XML file which in the middle contains the following: <ArticleName>Article
I have an XML file which I'd like to parse into a non-XML (text)

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.