English 中文(简体)
等量
原标题:Parse xml data sequentially
  • 时间:2010-09-14 18:20:01
  •  标签:
  • blackberry

Hi BB开发商 我在使用OMM对Xml数据进行分类时有问题。 xml数据格式是:

<stimulus name="Question" type="0">
<card>
<no>1</no>
<text><![CDATA[What is your primary goal, challenge or problem?]]></text>
</card>-----------------------
<stimulus name="Noun" type="0">
<card>
<no>12</no>
<text><![CDATA[Evaluation Criteria]]></text>
</card>

以下代码表用于对数据进行分类。

    NodeList nl = element.getElementsByTagName("stimulus");

    if (nl != null && nl.getLength() > 0) {
        for (int i = 0; i < nl.getLength(); i++) {
            Element ele = (Element) nl.item(i);
            Data card = getQuestions(ele);
            dataList.addElement(card);
        }
    }

当我通过使用根标“stimulus”来复制数据时,我没有按顺序获得数据。 我需要按顺序对数据进行分类。 我在哪里犯错误?

最佳回答

参看<代码><stimulus> 内容在您的源文件中没有被封闭,这可能在座标上造成问题。 添加“<代码>和>;/stimulus>,以结束每一组。

问题回答

暂无回答




相关问题
How does AlertListener work on Blackberry API 5.0?

Does the AlertListener interface works globally on all alerts on the blackberry device, or does it only work with alerts generated by your application? In other words, can I use this interface to ...

How to buffer audio in Blackberry?

I need to learn how to buffer audio stream from a remote server in Blackberry. There is a sample buffered playback app with Blackberry api but can you tell what url may I use to test the application?

Blackberry push notification implementation

How does one implement a push notification for a blackberry app? I heard that in order to do so I need to purchase a Blackberry Enterprise Server which costs me 1400 per year. Is this true? Where is ...

热门标签