Node xmlnode = (Node)object;
if(!xmlnode.getAttributes().containsKey("node"))return null;
Label labelObj = group.findLabel(labelName,"xml",labelName);
if(labelObj == null ){
labelObj = Label.newLabel(group,labelName,labelName,key,singular);
}
if(labelObj.isCached())return labelObj;
labelObj.setCached(true);
for(Node xmltag : xmlnode.getTags()){
String node = xmltag.getAttributes().get("node");
String type = xmltag.getAttributes().get("type");
String subType = xmltag.getAttributes().get("subType");
// First check if this is just a tag wrapping the dataload file. If so,
// just claim it is a List.
if(type==null){
node = "object";
type = "list";
subType = "object";
}
if(node.equals("primitive")){
type = xmltag.getName();
subType = "";
}
IAttribute a = new XMLAttribute(
xmltag.getName(),
labelObj,
type, subType,
xmltag.getAttributes());
labelObj.getAttributes().add(a);
}
return labelObj;
}