Ignore:
Timestamp:
08/25/10 19:15:28 (21 months ago)
Author:
kasper
Message:

Ticket #392: Fixed

File:
1 edited

Legend:

Unmodified
Added
Removed
  • DataCleaner/trunk/DataCleaner-core/src/main/java/dk/eobjects/datacleaner/util/DomHelper.java

    r746 r977  
    6767        public static String getAttributeValue(Node node, String attributeName) { 
    6868                Attr attr = (Attr) node.getAttributes().getNamedItem(attributeName); 
     69                if (attr == null) { 
     70                        return null; 
     71                } 
    6972                return attr.getValue(); 
    7073        } 
     
    7376                        Column[] columns) { 
    7477                for (Column column : columns) { 
    75                         Element columnElement = doc.createElement("column"); 
    76                         columnElement.setTextContent(column.getName()); 
    77  
    78                         Table table = column.getTable(); 
    79                         if (table != null && table.getName() != null) { 
    80                                 columnElement.setAttribute("table", table.getName()); 
    81                         } 
    82  
    83                         Schema schema = table.getSchema(); 
    84                         if (schema != null && schema.getName() != null) { 
    85                                 columnElement.setAttribute("schema", schema.getName()); 
    86                         } 
    87  
    88                         superNode.appendChild(columnElement); 
     78                        if (column != null) { 
     79                                Element columnElement = doc.createElement("column"); 
     80                                columnElement.setTextContent(column.getName()); 
     81                                 
     82                                Table table = column.getTable(); 
     83                                if (table != null) { 
     84 
     85                                        if (table.getName() != null) { 
     86                                                columnElement.setAttribute("table", table.getName()); 
     87                                        } 
     88                                 
     89                                        Schema schema = table.getSchema(); 
     90                                        if (schema != null && schema.getName() != null) { 
     91                                                columnElement.setAttribute("schema", schema.getName()); 
     92                                        } 
     93                                } 
     94                                 
     95                                superNode.appendChild(columnElement); 
     96                        } 
    8997                } 
    9098        } 
Note: See TracChangeset for help on using the changeset viewer.