On Wed, Aug 18, 2010 at 3:11 PM, R <r4eem...@gmail.com> wrote:
> I'm new and in the process of learning Objective-C and Cocoa.
>
> I want to take some raw XML data, isolate, and convert to a string.  I seem 
> to be able to capture the data I want, but cannot seem to get into a string 
> format.  Actually, I will want in a NSMutableString format… but am keeping 
> things simple for now.
>
> Here is an excerpt of my code:
>
> The problem is at the end of the code below….  the string findAlerts is 
> empty.  The NSXMLElement specificAlert prints correctly.

...

>        myGames=[[gameStatusXML nodesForXPath:@"//alerts" error:&error]retain];

The alerts element in the document you pointed to is:

  <alerts text="Final score in Bronx: NY Yankees 6, Detroit 2"
brief_text="At NYY: Final - NYY 6, DET 2" type="status"/>

>        findAlerts=[specificAlert stringValue]; // attempting to create a 
> string

-stringValue returns the value of any text-node children, but the
alerts node has no such children. Try using -attributes to get an
array of all the attributes, or -attributeForName: to get one of them.

sherm--

-- 
Cocoa programming in Perl:
http://camelbones.sourceforge.net
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to