if (links.size() == 0) {
return;
}
Category parent = null;
NodeIterator iter = links.elements();
while (iter.hasMoreNodes()) {
LinkTag link = (LinkTag)iter.nextNode();
Category category = new Category();
category.setTitle(NodeUtils.getTextData(link));
category.setId(link.getLink().replaceAll(".*/movieGenres/(.*?)", "$1"));
if (category.getId().indexOf('/') == -1) {
//it is a root category
parent = category;
}
if (parent != null && parent != category) {