Ignore:
Timestamp:
2010-12-14T17:15:30+13:00 (13 years ago)
Author:
sjb48
Message:

Working on saving a format statement to the config file. This looks like it should work but changes in FormatAction have caused major issues with Document/Node violations. This is because saving required the format statement as a Document rather than a string (which did work). Added a check to GSXML for xmlNodeToString to check that attrs is not null (attrs will be null unless the node is an element).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/GSXML.java

    r23360 r23489  
    921921    sb.append(e.getNodeName());
    922922    NamedNodeMap attrs = e.getAttributes();
    923     for (int i = 0; i < attrs.getLength(); i++) {
    924       Node attr = attrs.item(i);
    925       sb.append(' ');
    926       sb.append(attr.getNodeName());
    927       sb.append("=\"");
    928       sb.append(attr.getNodeValue());
    929       sb.append('"');
     923    if(attrs != null)
     924    {
     925        for (int i = 0; i < attrs.getLength(); i++) {
     926            Node attr = attrs.item(i);
     927            sb.append(' ');
     928            sb.append(attr.getNodeName());
     929            sb.append("=\"");
     930            sb.append(attr.getNodeValue());
     931            sb.append('"');
     932        }
    930933    }
    931934   
Note: See TracChangeset for help on using the changeset viewer.