随机xml节点android

时间:2017-08-23 09:08:33

标签: java android xml xmlpullparser

我有这个xml文档,我想随机提取每个节点(laquestion)所以我可以使用android studio进行测验:

String questionXml = "<?xml version=\"1.0\" encoding=\"utf-8\"?>"

                +"<question>"
                +"<laquestion>Quelle est la capitale des blabla?</laquestion>"
                + "<repv>" + "Mo" + "</repv>"
                + "<repf>" + "Mu" + "</repf>"
                + "<rep>" + "Mi" + "</rep>"
                +"</question>"
                +"<question>"
                +"<laquestion>Quelle est la langue officielle des blabla?</laquestion>"
                + "<repv>" + "F" + "</repv>"
                + "<repf>" + "c" + "</repf>"
                + "<rep>" + "Ar" + "</rep>"
                +"</question>"
                +"<question>"
                +"<laquestion>L'île la plus grande des blabla est:</laquestion>"
                + "<repv>" + "N" + "</repv>"
                + "<repf>" + "M" + "</repf>"
                + "<rep>" + "N" + "</rep>"
                +"</question>";

0 个答案:

没有答案