Changeset 24806 for main/trunk/gli

Show
Ignore:
Timestamp:
09.11.2011 15:04:26 (8 years ago)
Author:
sjm84
Message:

Fixed a problem that was causing two <format> tags to appear

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/gli/src/org/greenstone/gatherer/cdm/CollectionConfigXMLReadWrite.java

    r24805 r24806  
    640640        { // not an empty format statement 
    641641            String gsf_text = XMLTools.xmlNodeToStringWithoutIndenting(format); 
    642  
    643             /* 
    644              * if (gsf_text.startsWith("<") && (gsf_text.indexOf("<") != 
    645              * gsf_text.lastIndexOf("<"))) { gsf_text = 
    646              * gsf_text.substring(gsf_text.indexOf("<gsf"), 
    647              * gsf_text.indexOf(StaticStrings.FORMAT_END_TAG)); } 
    648              */ 
     642             
     643            //We don't want the <format> elements in the string 
     644            int startFormatIndex = gsf_text.indexOf(StaticStrings.FORMAT_START_TAG) + StaticStrings.FORMAT_START_TAG.length(); 
     645            int endFormatIndex = gsf_text.lastIndexOf(StaticStrings.FORMAT_END_TAG); 
     646            gsf_text = gsf_text.substring(startFormatIndex, endFormatIndex); 
    649647 
    650648            XMLTools.setNodeText(format_element, gsf_text);