【发布时间】:2012-11-19 08:06:37
【问题描述】:
亲爱的朋友,我想使用 xml 解析器中的属性来解析元素,这是我的 xml 格式
<LOB>Cars</LOB>
<PPL>Indica</PPL>
<REGION>West2</REGION>
<RETAIL>30</RETAIL>
<LOB>Cars</LOB>
<PPL>Indica</PPL>
<REGION>West1</REGION>
<RETAIL>175</RETAIL>
<LOB>Cars</LOB>
<PPL>Indica Vista</PPL>
<REGION>West2</REGION>
<RETAIL>267</RETAIL>
<LOB>Cars</LOB>
<PPL>Indica Vista</PPL>
<REGION>West1</REGION>
<RETAIL>1212</RETAIL>
more.....
<LOB>PCV - Venture</LOB>
<PPL>Venture</PPL>
<REGION>West2</REGION>
<RETAIL>2</RETAIL>
<LOB>PCV - Venture</LOB>
<PPL>Venture</PPL>
<REGION>West1</REGION>
<RETAIL>12</RETAIL>
more....
现在我只想要汽车零售计数,但这里 PCV-Venture 属性也在同一个 xml 文件中,所以我只能为属性做些什么是汽车然后解析零售元素而不是 PCV-Venture 的?
【问题讨论】:
-
你解决了thankq @Rajneesh071
标签: iphone attributes xml-parsing element