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