• 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: Trying to capture XML data and convert to a String...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Trying to capture XML data and convert to a String...


  • Subject: Re: Trying to capture XML data and convert to a String...
  • From: Sherm Pendley <email@hidden>
  • Date: Thu, 19 Aug 2010 03:38:50 -0400

On Wed, Aug 18, 2010 at 3:11 PM, R <email@hidden> 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 (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: Trying to capture XML data and convert to a String...
      • From: R <email@hidden>
References: 
 >Trying to capture XML data and convert to a String... (From: R <email@hidden>)

  • Prev by Date: Core Animation. issue with scaling
  • Next by Date: Re: NSImageView and ZoomFactors
  • Previous by thread: Trying to capture XML data and convert to a String...
  • Next by thread: Re: Trying to capture XML data and convert to a String...
  • Index(es):
    • Date
    • Thread