Changeset 25389

Show
Ignore:
Timestamp:
16.04.2012 21:04:39 (8 years ago)
Author:
ak19
Message:

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

Files:
1 modified

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        {