Changeset 28798 for main/trunk


Ignore:
Timestamp:
2014-01-23T16:38:37+13:00 (10 years ago)
Author:
ak19
Message:

2 fixes to open GS2 collections in GLI: quotes surrounding attributes should not be escaped and following Dr Bainbridge's advise to escape special html chars with entities, so that open br tags are still xml compliant. (We will be later running html tidy over these to fix them up).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/bin/script/convert_coll_from_gs2.pl

    r28780 r28798  
    1111
    1212use colcfg;
     13use docprint; # for sub escape_text
    1314use util;
    1415use parsargv;
     
    755756    my ($writer, $old_format, $node_type) = @_;
    756757
    757     if($convert_format_stmts) {
    758 
    759758    # replace \' with '
    760759    $old_format =~ s/\\\'/\'/g;
    761760    # replace \" with "
    762761    $old_format =~ s/\\\"/\"/g;
     762
     763    if($convert_format_stmts) {
     764
    763765    #convert [] to <gsf:...>
    764766    # now handles nested {If} and {Or}
     
    791793    # so that formatconverter can convert them and users can oversee the conversion in GLI,
    792794    # but nest the GS2 statements here in an xml tag that won't be processed by GS3
     795
     796    $old_format = &docprint::escape_text($old_format); # escape html entities inside the format statement since the <br> and <p> may not be correct for xml
    793797    $old_format = "<gsf:format-gs2>" . $old_format . "</gsf:format-gs2>";
     798   
    794799    }
    795800
Note: See TracChangeset for help on using the changeset viewer.