public static SourceDataQuality fromXML(Element domElement){
  NodeList fields=domElement.getChildNodes();
  int fieldsCount=fields.getLength();
  String fieldName;
  String fieldValueString;
  Node fieldNode;
  SourceDataQuality result=new SourceDataQuality();
  for (int i=0; i != fieldsCount; i++) {
    fieldNode=fields.item(i);
    if (fieldNode.getNodeType() == Node.ELEMENT_NODE) {
      fieldName=fieldNode.getNodeName();
      Node fieldValueNode=fieldNode.getFirstChild();
      if (fieldValueNode != null) {
        fieldValueString=fieldValueNode.getNodeValue();
      }
 else {
        fieldValueString="";
      }
      if (fieldName.equals(XML_ELEMENT_QUALITY_CODE)) {
        result.qualityCode=Short.parseShort(fieldValueString);
      }
 else       if (fieldName.equals(XML_ELEMENT_QUALITY_DESC)) {
        result.description=fieldValueString;
      }
    }
  }
  return result;
}

public static SourceDataQuality fromXML ( Element domElement ) { NodeList fields = domElement . getChildNodes ( ) ; int fieldsCount = fields . getLength ( ) ; String fieldName ; String fieldValueString ; Node fieldNode ; SourceDataQuality result = new SourceDataQuality ( ) ; for ( int i = 0 ; i != fieldsCount ; i ++ ) { fieldNode = fields . item ( i ) ; if ( fieldNode . getNodeType ( ) == Node . ELEMENT_NODE ) { fieldName = fieldNode . getNodeName ( ) ; Node fieldValueNode = fieldNode . getFirstChild ( ) ; if ( fieldValueNode != null ) { fieldValueString = fieldValueNode . getNodeValue ( ) ; } else { fieldValueString = "" ; } if ( fieldName . equals ( XML_ELEMENT_QUALITY_CODE ) ) { result . qualityCode = Short . parseShort ( fieldValueString ) ; } else if ( fieldName . equals ( XML_ELEMENT_QUALITY_DESC ) ) { result . description = fieldValueString ; } } } return result ; }
create a sourcedataquality object from its xml representation . the format of the xml required is determined by the output of the toxml ( ) method .
