Welcome to Soft32 Forums!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

XML in CoreFoundation

 
   Soft32 Home -> Mac -> Programmer Help RSS
Next:  Closing windows in RDC  
Author Message
Gobind

External


Since: Aug 10, 2009
Posts: 2



(Msg. 1) Posted: Mon Aug 10, 2009 11:27 am
Post subject: XML in CoreFoundation
Archived from groups: comp>sys>mac>programmer>help (more info?)

Hi, I have an XML file generated by CoreFoundation and written to the
disk. Now I am trying to read that XML in another program using
CoreFoundation again and I can't seem to find the right API for it.
Here is what I have:

Boolean status = CFURLCreateDataAndPropertiesFromResource
(kCFAllocatorDefault, url, &xmlData, NULL, NULL, &errorCode);
CFPropertyListRef xml = CFPropertyListCreateFromXMLData
(kCFAllocatorDefault, xmlData, kCFPropertyListImmutable, &error);

(of course all the variables are declared)

The funny thing is that my xmlData structure is filled with data
(equal to the size of the XML file I am trying to read). So, it seems
like that function worked. Then I want to extract the dictionary
sitting in this xmlData structure and tried to create a property list
from it and cast it to a CFDictionary. Apparently, when I perform
something like CFDictionaryGetValue with a key that I have in the XML,
I don't get the expected value back.

I am not sure what the problem is, can someone provide some sample
code for importing an XML file into CFDictionaryRef?

Thanks
Back to top
Login to vote
Gobind

External


Since: Aug 10, 2009
Posts: 2



(Msg. 2) Posted: Mon Aug 10, 2009 12:13 pm
Post subject: Re: XML in CoreFoundation [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Aug 10, 11:27 am, Gobind <gobind.jo....DeleteThis@gmail.com> wrote:
> Hi, I have an XML file generated by CoreFoundation and written to the
> disk. Now I am trying to read that XML in another program using
> CoreFoundation again and I can't seem to find the right API for it.
> Here is what I have:
>
> Boolean status = CFURLCreateDataAndPropertiesFromResource
> (kCFAllocatorDefault, url, &xmlData, NULL, NULL, &errorCode);
> CFPropertyListRef xml = CFPropertyListCreateFromXMLData
> (kCFAllocatorDefault, xmlData, kCFPropertyListImmutable, &error);
>
> (of course all the variables are declared)
>
> The funny thing is that my xmlData structure is filled with data
> (equal to the size of the XML file I am trying to read). So, it seems
> like that function worked. Then I want to extract the dictionary
> sitting in this xmlData structure and tried to create a property list
> from it and cast it to a CFDictionary. Apparently, when I perform
> something like CFDictionaryGetValue with a key that I have in the XML,
> I don't get the expected value back.
>
> I am not sure what the problem is, can someone provide some sample
> code for importing an XML file into CFDictionaryRef?
>
> Thanks

Never mind. I found the problem.

Thanks
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Getting a list of available fonts - I'm trying to write an app that makes a list of all the available fonts and then presents them in a popup menu. On th...

"reserve()" Doesn't Help std::vector Speed Very Much - Hi, I recently discovered vectors and containers, and find they're much more convenient than valarrays which I have..

[Q] a nib file can't be loaded? - Hello. I have some problem with the example code of the book, "Building Cocoa Applications", O'Reilly. In t...

smb hostnames in CFURL - Hello, Is it possible to specify an smb hostname in a url? I'd like to do something like CFStringRef theUncPathRef =...

Adding type ahead search to NSBrowser (as found in NSOpenP.. - Does anyone know how to add a type ahead search feature to NSBrowser? NSOpenPanel uses an NSBrowser as an interface..

How to determine the velocity of the mouse? - how do i determine the velocity of the mouse in mac os x? i need this for a little desktop game i am programming. unde...
       Soft32 Home -> Mac -> Programmer Help All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum

Categories:
 Windows
 Linux
  Mac
 PDA


[ Contact us | Terms of Service/Privacy Policy ]