• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
best way to store XML data?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

best way to store XML data?


  • Subject: best way to store XML data?
  • From: Ben Kazez <email@hidden>
  • Date: Mon, 24 Oct 2005 14:29:10 -0500

On Oct 24, 2005, at 2:02 PM, Michael Hanna <email@hidden> wrote:

I have XML data that I need to store in an obj-c data structure.
What's the best way to keep all the attributes and data?

for example:

<parent attrib1="foo" attrib2='"bar">

At this level you could add an NSDictionary like this:

<attributes>
    <key>attrib1</key>
    <value>foo</value>
    <key>attrib2</key>
    <value>bar</value>
</attributes>

Or, for more flexibility, an array of dictionaries (à la Sync Services schema plist):

<attributes>
    <dict>
        <key>Name</key>
        <value>attrib1</value>
...
</attributes>

I think you could do similar things for <header>.

    <header>
       <title xml:lang="en">Title</title>
       <desc xml:lang="en">desc</desc>
    </header>

    <data>
       <options>
          <style link="yes" color="auto">
       </options>
       <field>foo</field>
       <field>bar</field>
    </data>

</parent>

Ben -- Ben Kazez http://www.benkazez.com _______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Prev by Date: best way to store XML data?
  • Next by Date: Strange behavior of stringWithFormat and accented characters
  • Previous by thread: Re: best way to store XML data?
  • Next by thread: Strange behavior of stringWithFormat and accented characters
  • Index(es):
    • Date
    • Thread