Ignore:
Timestamp:
2012-04-16T21:04:39+12:00 (12 years ago)
Author:
ak19
Message:

Merging XSLT stylesheets should also process xsl:import statements in the same way it does xsl:include statements.

File:
1 edited

Legend:

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

    r25381 r25389  
    3838    {
    3939        Element main = main_xsl.getDocumentElement();
     40
    4041        NodeList children = extra_xsl.getElementsByTagNameNS("http://www.w3.org/1999/XSL/Transform", "include");
    4142        for (int i = 0; i < children.getLength(); i++) {
     
    4546            main.appendChild(main_xsl.importNode(node, true));
    4647        }
     48
     49        children = extra_xsl.getElementsByTagNameNS("http://www.w3.org/1999/XSL/Transform", "import");
     50        for (int i = 0; i < children.getLength(); i++) {
     51                Node node = children.item(i);
     52            // remove any previous occurrences of xsl:output with the same method value
     53            removeDuplicateElementsFrom(main, node, "xsl:import", "href");
     54            main.appendChild(main_xsl.importNode(node, true));
     55        }
     56
    4757        children = extra_xsl.getElementsByTagNameNS("http://www.w3.org/1999/XSL/Transform", "output");
    4858        for (int i = 0; i < children.getLength(); i++) {
     
    5363        }
    5464
    55         children = extra_xsl.getElementsByTagNameNS("http://www.w3.org/1999/XSL/Transform", "template");       
    56 
     65        children = extra_xsl.getElementsByTagNameNS("http://www.w3.org/1999/XSL/Transform", "template");
    5766        for (int i = 0; i < children.getLength(); i++)
    5867        {
Note: See TracChangeset for help on using the changeset viewer.