Changeset 26334

Show
Ignore:
Timestamp:
18.10.2012 10:02:44 (7 years ago)
Author:
sjm84
Message:

Fixing the language setting not working correctly when getting collection text. Also correcting missing macrons in Maori

Location:
main/trunk/greenstone3/src/java/org/greenstone/gsdl3
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/src/java/org/greenstone/gsdl3/core/TransformingReceptionist.java

    r26325 r26334  
    654654        Element format_elem = (Element) GSXML.getChildByTagName(page_response, GSXML.FORMAT_ELEM); 
    655655 
     656        NodeList pageElems = doc.getElementsByTagName("page"); 
     657        if (pageElems.getLength() > 0) 
     658        { 
     659            Element pageElem = (Element) pageElems.item(0); 
     660            String langAtt = pageElem.getAttribute(GSXML.LANG_ATT); 
     661 
     662            if (langAtt != null && langAtt.length() > 0) 
     663            { 
     664                config_params.put("lang", langAtt); 
     665            } 
     666        } 
     667 
    656668        if (output.equals("formatelem")) 
    657669        { 
  • main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/XSLTUtil.java

    r26325 r26334  
    362362            if (result != null) 
    363363            { 
    364                 return docBuilder.parse(new ByteArrayInputStream(("<fragment>" + result + "</fragment>").getBytes())).getDocumentElement(); 
     364                return docBuilder.parse(new ByteArrayInputStream(("<fragment>" + result + "</fragment>").getBytes("UTF-8"))).getDocumentElement(); 
    365365            } 
    366366            return docBuilder.parse(new ByteArrayInputStream(("<fragment>" + "text:" + collection + ":" + key + "</fragment>").getBytes())).getDocumentElement();