开发者

Convert XML to .plist

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 开发者_如何学JAVAassign 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>


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.


You could use a program like Oxygen (free 30-day trial at oxygenxml.com) to convert your XML file to JSON, and then use the OSX Terminal command line to convert the JSON file to PLIST.

 plutil -convert xml1 blahblah.json -o blahblah.plist

That should do it.... :)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜