FROM : Mr. Gecko
DATE : Sat May 03 19:20:25 2008
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
DATE : Sat May 03 19:20:25 2008
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
| Related mails | Author | Date |
|---|---|---|
| Mr. Gecko | May 3, 19:20 | |
| John Calsbeek | May 3, 19:41 |






Cocoa mail archive

