XML解析为plist iPhone SDK

时间:2010-05-25 13:30:30

标签: iphone xml parsing plist nsxmlparser

请帮助我解析这个XML代码:

 <?xml version="1.0" encoding="utf-8"?>
    <stuff>
      <parts>
        <part id='327'>
          <name>Logitech MX500</name>
          <serial>618163558491989</serial>
          <account>ASDALSKD</account>
          <number>987 789 456</number>
          <alarm>alarm1</alarm>
        </part>
        <part id='846'>
          <name>Logitech MX510</name>
          <serial>871351434945431</serial>
          <account>KJSDAKLJFA</account>
          <number>454 564 131</number>
          <alarm>alarm2</alarm>
        </part>
      </parts>
    <info>Information</info>  
    </stuff>

以这种格式将数据保存到plist文件stuff.plist:

327   NSArray
  Name  NSString  Logitech MX500
  Serial  NSString  618163558491989
  Account  NSString  ASDALSKD
  Number  NSString  987 789 456
  Alarm  NSString  alarm1
846   NSArray
  Name  NSString  Logitech MX510
  Serial  NSString  871351434945431
  Account  NSString  KJSDAKLJFA
  Number  NSString  454 564 131
  Alarm  NSString  alarm2

0 个答案:

没有答案