Re: NSXML assistance please
Re: NSXML assistance please
- Subject: Re: NSXML assistance please
- From: Chris Hanson <email@hidden>
- Date: Sun, 04 May 2008 16:29:21 -0700
On May 4, 2008, at 3:53 PM, Damien Cooke wrote:
<Item Name="01.Image.JPG" PhysicalFilePath="C:\Documents and Settings
\M01.Image.JPG" Title="Bridge" Category="Structures" SubCategory=""
Region="South Australia" MediaType="Photo">
<Keywords>
<Keyword>multi-laned</Keyword>
<Keyword>non-water-based</Keyword>
</Keywords>
</Item>
I can easily get the keywords out but have found no way of getting
the attributes out of the <Item> tag. Can someone make some
suggestions?
If you're using NSXMLDocument to represent your XML, each Item is an
NSXMLElement and you can therefore use NSXMLElement's attribute
methods to get at its attributes. Pretty basic, just read the docs on
NSXMLElement:
<http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSXMLElement_Class/Reference/Reference.html
>
Also, if you're going to work with XML documents on Mac OS X, it's
well worth reading the Tree-Based XML Programming Guide for Cocoa <http://developer.apple.com/documentation/Cocoa/Conceptual/NSXML_Concepts/NSXML.html
>.
Read that document first and it'll give you a pretty good overview of
what's available and where to look for figuring this sort of thing out.
-- Chris
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden