/*
 * This file is part of the DITA Open Toolkit project.
 *
 * Copyright 2008 IBM Corporation
 *
 * See the accompanying LICENSE file for applicable license.

 */
package org.dita.dost.platform;

import org.dita.dost.util.FileUtils;
import org.dita.dost.util.XMLUtils.AttributesBuilder;
import org.xml.sax.ContentHandler;
import org.xml.sax.SAXException;

/**
 * ImportXSLAction class.
 *
 */
final class ImportXSLAction extends ImportAction {

    /**
     * get result.
     */
    @Override
    public void getResult(final ContentHandler buf) throws SAXException {
        for (final FileValue value: valueSet) {
            final String href = getHref(value);
            buf.startElement("http://www.w3.org/1999/XSL/Transform", "import", "xsl:import", new AttributesBuilder()
                .add("href", href)
                .build());
            buf.endElement("http://www.w3.org/1999/XSL/Transform", "import", "xsl:import");
        }
    }

    private String getHref(final FileValue value) {
        final String templateFilePath = paramTable.get(FileGenerator.PARAM_TEMPLATE);
        return FileUtils.getRelativeUnixPath(templateFilePath, value.value);
    }

}

@@ -216,20 +216,19 @@
 st.util.
-File
+URL
 Utils;%0Ai
@@ -349,16 +349,38 @@
 ption;%0A%0A
+import java.net.URI;%0A%0A
 /**%0A * I
@@ -649,22 +649,19 @@
   final 
-String
+URI
  href = 
@@ -826,16 +826,27 @@
 f%22, href
+.toString()
 )%0A      
@@ -987,22 +987,19 @@
 private 
-String
+URI
  getHref
@@ -1042,153 +1042,273 @@
 nal 
-String templateFilePath = paramTable.get(FileGenerator.PARAM_TEMPLATE);%0A        return FileUtils.getRelativeUnixPath(templateFilePath, value.valu
+URI pluginDir = featureTable.get(value.id).getPluginDir().toURI();%0A        final URI templateFile = URLUtils.toFile(value.value).toURI();%0A        final URI template = pluginDir.relativize(templateFile);%0A        return URI.create(%22plugin:%22 + value.id + %22:%22 + templat
 e);%0A

Change XSLT import to use plugin URI scheme