logo
down
shadow

xslt import/include 2 files with the same template


xslt import/include 2 files with the same template

By : user3851103
Date : October 17 2020, 11:12 PM
Any of those help I've got an interesting question on XSLT import/include. , I think making the template modes different is your best option.
code :


Share : facebook icon twitter icon
xslt include/import path

xslt include/import path


By : user3342037
Date : March 29 2020, 07:55 AM
I wish this helpful for you I use XSLT as template engine in my PHP framework. Some XSLT files are in different folders,so if I want to include/import xslt template not from main directory I have to type a lot:
code :
<xsl:import href="layout.xsl" xml:base="dir1/dir2/dir3/dir4/" />
Using dynamic href in XSLT import/include?

Using dynamic href in XSLT import/include?


By : Kathryn Simmons
Date : March 29 2020, 07:55 AM
To fix this issue xsl:import assembles the stylesheet prior to execution. The stylesheet can't modify itself while it is executing, which is what you are trying to achieve.
If you have three variants of a stylesheet for use in different circumstances, represented by three modules A.xsl, B.xsl, and C.xsl, then instead of trying to import one of these into the module common.xsl that contains all the common code, you need to invert the structure: each of A.xsl, B.xsl, and C.xsl should import common.xsl, and you should select A.xsl, B.xsl, or C.xsl as the principal stylesheet module when initiating the transformation.
Trying to import xslt file/template into another xslt file and pass param. What am I doing wrong here

Trying to import xslt file/template into another xslt file and pass param. What am I doing wrong here


By : m.yakamoz
Date : March 29 2020, 07:55 AM
hop of those help? Shouldn't your template have a parameter named contactParam in this case?:
code :
<xsl:template match="/" name="address" >
    <xsl:param name="contactParam" select="'default'"/>
How to apply or import an XSLT template based on parametre

How to apply or import an XSLT template based on parametre


By : Conrad vdt
Date : March 29 2020, 07:55 AM
I wish did fix the issue. Include and import work at compile time, when there is no source document available, so you can't import or include things based on what you find in the data (unless you want to get into dynamic stylesheet generation, which I doubt is appropriate here).
It's not clear to me why you can't solve the problem using the standard apply-templates mechanism. Replace this stuff:
code :
<xsl:for-each select="/workfile/query/parameter[@name='output-type']">
            <xsl:variable name="outputType" select="./@value" />
            <xsl:choose>
                <xsl:when test="$outputType='type-1'">
                    <xsl:call-template name="type-1" />
                </xsl:when>

<xsl:template name="type-1">
    <!-- TO DO -->
</xsl:template>
<xsl:apply-templates select="/workfile/query/parameter[@name='output-type']"/>

<xsl:template match="parameter[@name='output-type'][@value='type1']">
<!-- TO DO -->
</xsl:template>
Merging multiple XSLT stylesheets containing xsl:include and xsl:import

Merging multiple XSLT stylesheets containing xsl:include and xsl:import


By : Dave
Date : March 29 2020, 07:55 AM
I think the issue was by ths following , I agree with Michael's comments that the question is actually too broad, but what I read from your question is that you want your stylesheet to work on browsers and that some browsers do not allow xsl:import or xsl:include.
If you do not have an XSLT development environment, I strongly suggest you get yourself one, as Michael already said, many exist. It will save yourself a lot of pain. Suggestions include: oXygen (in my not so humble opinion, the best), Visual Studio (only XSLT 1.0, but suffices for your task as browsers only support XSLT 1.0), Stylus Studio, Eclipse.
shadow
Privacy Policy - Terms - Contact Us © bighow.org