• 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
Reading XML
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Reading XML


  • Subject: Reading XML
  • From: "Mr. Gecko" <email@hidden>
  • Date: Sat, 3 May 2008 12:20:25 -0500

Ok I have been searching for hours.
Here is exact details.
I have an xml file on the web for files and I use it for flash I don't want to make an xml plist on the web because I don't want to have two sources.
I need to read it in cocoa here is the layout of the cocoa file.
<?xml version="1.0" encoding="iso-8859-1"?>
<profile>
<files>
<file url="http://www.example.com/file1"; size="522656" name="File Number 1"/>
<file url="http://www.example.com/file2"; size="4533" name="File Number 2"/>
</files>
</profile>
I heard about NSXMLDocument but I got no exact way to read objects in it.
I want to beable to just do something like this.
NSXML *xml = [NSXML initWithXMLData:[NSData dataWithContentsOfUrl: [NSURL URLWithString:@"http://www.example.com/xmlfile.xml";]]];
NSArray *data = [xml elementsForName:@"files"];
NSDictionary *stuff = [data objectAtIndex:0]
NSLog(@"Url is %@\nSize is %@\nName is %@", [stuff objectForKey:@"url"], [stuff objectForKey:@"size"], [stuff objectForKey:@"name"]);


Is there any like framework that will let you do that?
Is there an example for how to read xml?
Is there a tutorial?

Thanks,
Mr. Gecko
_______________________________________________

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: Reading XML
      • From: John Calsbeek <email@hidden>
  • Prev by Date: Re: NSImageView blocking drag -- solved
  • Next by Date: Re: Saving/restoring PDFAnnotationTextWidget stringValues with PDFKit 10.5
  • Previous by thread: Re: NSImageView blocking drag -- solved
  • Next by thread: Re: Reading XML
  • Index(es):
    • Date
    • Thread