Мой класс активности выглядит так:
AssetManager assetmgr= getAssets();
String list[] = assetmgr.list("subdir");
if (list != null) {
DocumentBuilder builder =DocumentBuilderFactory.newInstance().newDocumentBuilder();
Document doc = builder.parse(getAssets().open("subdir/fullSurvey.xml"));
Класс объекта XML выглядит следующим образом:
NodeList root = doc.getElementsByTagName("root");
NodeList nlQuestions = root.item(0).getChildNodes();
QuestionObject[] allQuestions = new QuestionObject[nlQuestions.getLength()];
for (int i = 0; i < nlQuestions.getLength(); i++) {
Node question = nlQuestions.item(i);
NodeList childNodes = question.getChildNodes();
QuestionObject x = new QuestionObject();
for (int j = 0; j < childNodes.getLength(); j++) {
Node child = childNodes.item(j);
if (child.getNodeName() !="#text") {
Questions t = Questions.valueOf(child.getNodeName());
// etc.
Я не знаю, как проанализировать XML-файл в соответствии со значением атрибута