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

Re: newbie - XML Services


  • Subject: Re: newbie - XML Services
  • From: Jeff Martirano <email@hidden>
  • Date: Fri, 26 Apr 2002 17:54:07 -0700

//create an NSDictionary and initialize with whatever is in file.xml
yourDictionary = [NSDictionary dictionaryWithContentsOfURL:[NSURL URLWithString:@"http://www.yourdomain.com/file.xml";]];

Look at the docs for what you can do with NSDictionary and NSMutableDictionary. It's basically a storage class that works like an array but with keys rather than indexes.

so if your xml file was like this:

<dict>

<key>Favorite Movie</key>
<string>Warrior and the Princess</string>

<key>Least Favorite Movie</key>
<string>Anything in the theatres today</string>

</dict>

you could extract the string value with a function like this:

//create a string then set it to the value of the string of key "Favorite Movie"
NSString *movieTaste;
movieTaste = [yourDictionary objectForKey:@"Favorite Movie"]




On Friday, April 26, 2002, at 04:03 , Michiel Roding (parse.nl) wrote:

Hi there,

I'm pretty much new to this Obj-C/Cocoa thing, but have quite some experience in PHP.

I want to create (eventually) an application which runs in the dock; checks an XML file online (http) and local; parses them; checks if anything changed between them; if so, find & report it to the user in some way;store the data (part of it) locally for later evaluation;

At the moment, I'm just looking at how to open and parse an XML file.

I found the XML Services API docs, but can't find a good, clean sample of how one can open an XML file remotely and parse it.

Could anyone give me some pointers on this, a tutorial would suffice, but some example code wouldn't be bad either :)

thanks for any help,

Michiel.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.



On Friday, April 26, 2002, at 04:03 , Michiel Roding (parse.nl) wrote:

email@hidden
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >newbie - XML Services (From: Michiel Roding (parse.nl) <email@hidden>)

  • Prev by Date: NSImage GetPixel Function?
  • Next by Date: Re: DO Client can't connect, problem with code or Airport firewall?
  • Previous by thread: newbie - XML Services
  • Next by thread: Re: newbie - XML Services
  • Index(es):
    • Date
    • Thread