public static XMLTableDefinition load(Element definition){
  XMLTableDefinition answer=new XMLTableDefinition();
  answer.setRowExpression(definition.attributeValue("select"));
  for (Iterator<Element> iter=definition.elementIterator("column"); iter.hasNext(); ) {
    Element element=iter.next();
    String expression=element.attributeValue("select");
    String name=element.getText();
    String typeName=element.attributeValue("type","string");
    String columnXPath=element.attributeValue("columnNameXPath");
    int type=XMLTableColumnDefinition.parseType(typeName);
    if (columnXPath != null) {
      answer.addColumnWithXPathName(columnXPath,expression,type);
    }
 else {
      answer.addColumn(name,expression,type);
    }
  }
  return answer;
}

public static XMLTableDefinition load ( Element definition ) { XMLTableDefinition answer = new XMLTableDefinition ( ) ; answer . setRowExpression ( definition . attributeValue ( "select" ) ) ; for ( Iterator < Element > iter = definition . elementIterator ( "column" ) ; iter . hasNext ( ) ; ) { Element element = iter . next ( ) ; String expression = element . attributeValue ( "select" ) ; String name = element . getText ( ) ; String typeName = element . attributeValue ( "type" , "string" ) ; String columnXPath = element . attributeValue ( "columnNameXPath" ) ; int type = XMLTableColumnDefinition . parseType ( typeName ) ; if ( columnXPath != null ) { answer . addColumnWithXPathName ( columnXPath , expression , type ) ; } else { answer . addColumn ( name , expression , type ) ; } } return answer ; }
loads an xml table definition from an xml definition document
