• 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
Re: NSXML assistance please
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >NSXML assistance please (From: Damien Cooke <email@hidden>)

  • Prev by Date: Re: List Running apps and windows
  • Next by Date: Re: Newbie Question: Controls not redrawing on changes
  • Previous by thread: NSXML assistance please
  • Next by thread: Re: Cocoa-dev Digest, Vol 5, Issue 727
  • Index(es):
    • Date
    • Thread