use of com.liferay.portal.kernel.xml.Attribute in project liferay-ide by liferay.
the class MediaWikiImporter method readSpecialNamespaces.
protected List<String> readSpecialNamespaces(Element root) throws ImportFilesException {
List<String> namespaces = new ArrayList<String>();
Element siteinfoElement = root.element("siteinfo");
if (siteinfoElement == null) {
throw new ImportFilesException("Invalid pages XML file");
}
Element namespacesElement = siteinfoElement.element("namespaces");
List<Element> namespaceElements = namespacesElement.elements("namespace");
for (Element namespaceElement : namespaceElements) {
Attribute attribute = namespaceElement.attribute("key");
String value = attribute.getValue();
if (!value.equals("0")) {
namespaces.add(namespaceElement.getText());
}
}
return namespaces;
}
Aggregations