1
我有一个XML,我下面将数据传输到格式:解析XML嵌套的标签
<Question>
<QuestionID>1</QuestionID>
<QuestionType>Logic</QuestionType>
<QuestionImage>http://mobilecms.hiteshi.com/IQ/xml/Logic/1/Question/q.jpg</QuestionImage>
<QuestionText>1 Which is the Next image?</QuestionText>
<AnswerImages Count="4">
<Image>http://mobilecms.hiteshi.com/IQ/xml/Logic/1/Answer/a.jpg</Image>
<Image>http://mobilecms.hiteshi.com/IQ/xml/Logic/1/Answer/b.jpg</Image>
<Image>http://mobilecms.hiteshi.com/IQ/xml/Logic/1/Answer/c.jpg</Image>
<Image>http://mobilecms.hiteshi.com/IQ/xml/Logic/1/Answer/d.jpg</Image>
</AnswerImages>
<Answer>d</Answer>
<Score>1</Score>
<DifficultyLevel>1</DifficultyLevel>
</Question>
我要读的是XML和所有的标签数据存储到源码的两个不同的表。我可以轻松阅读QuestionID,QuestionType等Main标签,并将其存储到tableOne中。
现在我想读取正在计数的AnswerImages标签,并根据该计数变量读取名为<Image>
的子标签。在这里,我想将所有<Image>
标签数据存储到tableTwo中。
如何将数据同时存储到tableOne和tableTwo中?
请更正链接。如果您不知道如何操作,请在发布前先检查。并且亲自,最好将这个xml粘贴到链接上。 – Gandi
你使用哪种语言,以及什么平台?我们是否通过您的用户名假设这是一款iPhone应用程序?了解这些问题的答案将有助于人们推荐哪些解析器可用,以便您不必推出自己的解析器。 – DavidO
是的,它的iPhone应用程序。 –