Changeset 24806 for main/trunk/gli/src


Ignore:
Timestamp:
2011-11-09T15:04:26+13:00 (12 years ago)
Author:
sjm84
Message:

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

File:
1 edited

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);
Note: See TracChangeset for help on using the changeset viewer.