best way to store XML data?
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