• 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: Accessing attributes of XML
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Accessing attributes of XML


  • Subject: Re: Accessing attributes of XML
  • From: Jens Alfke <email@hidden>
  • Date: Mon, 5 May 2008 09:28:46 -0700


On 5 May '08, at 5:34 AM, Christian Graus wrote:

NSXMLElement *node2  = [array objectAtIndex:nodeCount];

NSXMLElement *name = [node2 attributeForName:@"Name"];

'name' should be declared as NSXMLNode*, or you'll get a compiler type- mismatch warning. (But that doesn't explain why its -stringValue would be nil.) Try setting a breakpoint after this line in the debugger, then in the debug console enter "po name" and it should print the XML corresponding to that node*.


I cannot work out how to access the inner Text of the node

[node2 stringValue]. (NSXMLElement inherits that from NSXMLNode.)

The attributes collection should be 15 odd objects, and it's 0.

Hm, I don't see why that wouldn't work. Again, at your breakpoint type "po node2" and see what XML it contains; you might not have gotten the element you expected.


—Jens

* The 'po' (Print Object) command is your friend. It calls - description on the object you give it and prints the result, so it's a great way to look at the values of Obj-C objects.

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

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

  • Follow-Ups:
    • Re: Accessing attributes of XML
      • From: "Christian Graus" <email@hidden>
References: 
 >Accessing attributes of XML (From: "Christian Graus" <email@hidden>)

  • Prev by Date: Re: Flash'In'App ? Free Cocoa Framework
  • Next by Date: Re: Images in NSPopupMenu items when binded to a NSArrayController
  • Previous by thread: Accessing attributes of XML
  • Next by thread: Re: Accessing attributes of XML
  • Index(es):
    • Date
    • Thread