Changeset 4704
- Timestamp:
- 2003-06-18T11:58:26+12:00 (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl3/src/java/org/greenstone/gsdl3/util/GSXSLT.java
r4079 r4704 14 14 15 15 /** takes a stylesheet Document, and adds in any child nodes from extra_xsl 16 * named templates overwrite any existing one, while match templates are 17 just added to the end of teh stylesheet 16 18 */ 17 19 public static void mergeStylesheets(Document main_xsl, Element extra_xsl) { … … 19 21 Element main = main_xsl.getDocumentElement(); 20 22 21 NodeList children = extra_xsl.get ChildNodes();23 NodeList children = extra_xsl.getElementsByTagNameNS("http://www.w3.org/1999/XSL/Transform", "template"); 22 24 for (int i=0; i<children.getLength(); i++) { 23 main.appendChild(main_xsl.importNode(children.item(i), true)); 25 String name = ((Element)children.item(i)).getAttribute("name"); 26 if (!name.equals("")) { 27 Element old_template = GSXML.getNamedElement(main, "xsl:template", "name", name); 28 if (old_template != null) { 29 main.removeChild(old_template); 30 } 31 } 32 33 main.appendChild(main_xsl.importNode(children.item(i), true)); 24 34 } 25 35 … … 30 40 */ 31 41 public static void absoluteIncludePaths(Document stylesheet, 32 ConfigVars config) { 42 String gsdl3_home, 43 String site_name, 44 String interface_name) { 33 45 34 46 … … 38 50 String name = child.getNodeName(); 39 51 if (name.equals("xsl:import") || name.equals("xsl:include")) { 40 ((Element)child).setAttribute("href", GSFile.stylesheetFile( config, ((Element)child).getAttribute("href")));52 ((Element)child).setAttribute("href", GSFile.stylesheetFile(gsdl3_home, site_name, interface_name, ((Element)child).getAttribute("href"))); 41 53 } 42 54 child = child.getNextSibling();
Note:
See TracChangeset
for help on using the changeset viewer.