views:

569

answers:

1

Hey,

I have an XML exported from Oracle DB, which will be downloaded into my application main bundle.

i would like to convert this XML file into .plist file so i can assign the values into NSDictionary and NSArrays..

Is there a way to get this to work? or is there a better way to work with an external XML file?

note that one of the fields in the XML is a full HTML content

example:

<main>
    <DATA_RECORD>
      <ID>ID1</ID>
      <NO>1234512</NO>
      <TYPE>NEW</TYPE>
      <TYPE_NO>0</TYPE_NO>
      <TEXT_ID>TEXT1</TEXT_ID>
      <TEXT><HTML>some html goes here</HTML></TEXT>
    </DATA_RECORD>
  </main>
A: 

What about this?

You can try plutil

plutil -convert xml1 il_tuo_file_binario.plist

PS: I've edited because I did read .plist to XML in my mind the first time.

dierre
Nope, got empty results when i put my XML into.
Dror Sabbag
Yeah, I've edited. I've read the opposite the first time. Try plutil.
dierre
am not sure yet how this should work, basicly i want to get the XML file as is into my app, (download it from a server) and then manipulate it.how hard is it to work with the XML as is? assign to variables (Dictionaries, Arrays...)is it better to transfer it to a Plist?
Dror Sabbag
Well this is a software, not a library sono basically you should convert the .plist using a system function surely present in the language you are using.In my opinion, though, if you can download the XML, you should work using the XML. In my opinion it is easy but if you feel more confortable with a .plist then use a .plist. It really does depend on what you are skilled for.
dierre
Well, Thanks dierre,i'll do some more research, and learn the way to work with XMLs in Iphone SDK.Thanks.
Dror Sabbag
Look for XPath. I think it's really easy to use.
dierre