List<Content> contents = new LinkedList<Content>();
Element adapter = XMLTools.getUniqueChild(scriptElt, ADAPTER_TAG, false);
String scriptPath = parseOptString(scriptElt, "path");
if (scriptPath != null) {
contents.add(new Content(scriptPath));
} else if (adapter != null) {
NodeList childs = adapter.getChildNodes();
for (int i = 0; i < childs.getLength(); i++) {
Node item = childs.item(i);
if (item instanceof Element) {
Element include = (Element) item;
if (INCLUDE_TAG.equals(include.getTagName())) {
contents.add(new Content(XMLTools.asString(include, true)));
}
} else if (item.getNodeType() == Node.TEXT_NODE) {
contents.add(new Content(item.getNodeValue().trim(), false));
}
}
}
Content[] tmp = contents.toArray(new Content[contents.size()]);