- Timestamp:
- 2020-07-04T06:33:15+12:00 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/gli/src/org/greenstone/gatherer/cdm/CollectionConfigXMLReadWrite.java
r34243 r34245 42 42 import org.greenstone.gatherer.metadata.MetadataElement; 43 43 import org.greenstone.gatherer.metadata.MetadataTools; 44 import org.greenstone.gatherer.util.Codec; 44 45 import org.greenstone.gatherer.util.StaticStrings; 45 46 import org.greenstone.gatherer.util.Utility; … … 98 99 // Sadly, XMLTools.getNodeText(item) returns empty for any HTML in displayItem 99 100 // so we have to do it the hard way 101 // We can't take a shortcut like format statements, which also need to keep their 102 // tags intact in collConfig.xml, because we know in advance the format tag name 103 // Can't guess at what html tag names the user uses, and there may be several at 104 // the same level inside collDescription (e.g. multiple paragraphs) 100 105 String text = isCollDescr ? preserveHTMLInDescriptionDisplayItem(item) 101 106 : XMLTools.getNodeText(item); // else as before for all other displayItems … … 1473 1478 if(!lang_value.equals("")) { 1474 1479 e.setAttribute(lang_att, lang_value); 1480 1481 // Handle collection description displayItems specially again: these are allowed to go 1482 // into collConfig.xml file containing tag markers, to preserve any user-added html 1483 // in a format easy to edit in collConfig (rather than filled with entities) 1484 if(element_name.equals(StaticStrings.DISPLAYITEM_STR) && name_value.equals(StaticStrings.DESCRIPTION_STR)) { 1485 //System.err.println("@@@ Before internal coll description converted to collConfig:\n" + text); 1486 // special case again: the following is going to be undone shortly again, 1487 // mirroring the inverse of going from collConfig.xml to internal collConfig format 1488 // upon parse() 1489 // but this is what works to preserve the ampersands for output to XML context 1490 // past the next line 1491 //text = text.replaceAll("&", "&"); 1492 //text = Codec.transform(text, Codec.ESCAPEDHTML_TO_UNESCAPED); 1493 text = Codec.transform(text, Codec.REINSTATE_HTML_TAGS); 1494 //System.err.println("@@@ After coll description converted to collConfig:\n" + text); 1495 } 1475 1496 XMLTools.setNodeText(e, text); 1497 1476 1498 } 1477 1499 if(!key.equals("")) {
Note:
See TracChangeset
for help on using the changeset viewer.