Changeset 30584

Show
Ignore:
Timestamp:
20.06.2016 12:38:26 (4 years ago)
Author:
kjdon
Message:

added GSLIB namespace to the list. Also created strings and methods for adding namespaces to XML (string or Node) so that all places get the same default namespaces

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/GSXML.java

    r30552 r30584  
    304304    public static final String XSL_NAMESPACE = "http://www.w3.org/1999/XSL/Transform"; 
    305305    public static final String GSF_NAMESPACE = "http://www.greenstone.org/greenstone3/schema/ConfigFormat"; 
     306  public static final String GSLIB_NAMESPACE = "http://www.greenstone.org/skinning"; 
    306307    public static final String JAVA_NAMESPACE = "http://xml.apache.org/xslt/java"; 
    307308    public static final String UTIL_NAMESPACE = "xalan://org.greenstone.gsdl3.util.XSLTUtil"; 
     309 
     310  // all the namespaces in a string for easy addition to a string 
     311  public  static final String ALL_NAMESPACES_ATTS = "xmlns:gsf='" + GSF_NAMESPACE + "' xmlns:xsl='" + XSL_NAMESPACE + "' xmlns:gslib='" + GSLIB_NAMESPACE + "' xmlns:java='" + JAVA_NAMESPACE + "' xmlns:util='" + UTIL_NAMESPACE +"' "; 
     312  public static final String STD_NAMESPACES_ATTS = "xmlns:gsf='" + GSF_NAMESPACE + "' xmlns:xsl='" + XSL_NAMESPACE + "' xmlns:gslib='" + GSLIB_NAMESPACE +"' "; 
    308313 
    309314    //Groups configuration 
     
    514519    } 
    515520 
     521  public static boolean addGSNamespaces(Element elem, boolean include_extension_ns) { 
     522    if (elem == null) { 
     523      return false; 
     524    } 
     525    elem.setAttribute("xmlns:gsf", GSF_NAMESPACE); 
     526    elem.setAttribute("xmlns:xsl", XSL_NAMESPACE); 
     527    elem.setAttribute("xmlns:gslib", GSLIB_NAMESPACE); 
     528    if (include_extension_ns) { 
     529      elem.setAttribute("xmlns:util", UTIL_NAMESPACE); 
     530      elem.setAttribute("xmlns:java", JAVA_NAMESPACE); 
     531    } 
     532    return true; 
     533  } 
    516534    public static Element createMetadataParamList(Document owner, Vector meta_values) 
    517535    {