cancel
Showing results for 
Search instead for 
Did you mean: 

Calling an XSL file in an XSL file

Former Member
0 Kudos

Hi,

I'm importing xsl file into xi and uisng it for mapping.

My query is im using a function in my mapping which is actually present in another xsl file

how can i call the other xsl file in my present xsl file which is the base file for the mapping

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi

You can import the other xsl file in your document:

Something like:

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">

<xsl:include href="MyXslFile.xsl"/>

<xsl:template match="/">

...

</xsl:template>

</xsl:stylesheet>

You have to make shure that you also upload MyXslFile.xsl to the same place on the XI system

Kind regards

Thierry

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

Check this link for different include option.

http://www.dpawson.co.uk/xsl/sect2/N4760.html

Thanks,

Prateek

Former Member
0 Kudos

i'll be a bit more specific

i'm using

xsl mapping

i have 2 map files

nested_flow.xsl is my main map file

and substring_flow.xsl is the map file im calling

<u>nested_floe.xsl:</u>

<?xml version="1.0" encoding="UTF-8" ?>

- <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ns0="urn:Testns" xmlns:javamap="java:com.satyam.Javaclass">

<xsl:include href="substring_flow.xsl" />

- <xsl:template match="/">

- <substring_node_input>

- <InputString>

<xsl:value-of select="ns0:nested_node_input/Person/LName" />

</InputString>

</substring_node_input>

- <nested_node_output>

- <Emp>

- <Innitial>

<xsl:value-of select="ns0:substring_node_output/OutputString" />

</Innitial>

</Emp>

</nested_node_output>

</xsl:template>

</xsl:stylesheet>

<u>substring_flow.xsl:</u>

<?xml version="1.0" encoding="UTF-8" ?>

- <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ns0="urn:Testns" xmlns:javamap="java:com.satyam.Javaclass">

- <xsl:template match="/">

- <substring_node_output>

- <OutputString>

<xsl:value-of select="substring(ns0:substring_node_input/InputString,0,1)" />

</OutputString>

</substring_node_output>

</xsl:template>

</xsl:stylesheet>

im trying to use the substring function present in the second xsl file in the master xsl

if u can observe the first xsl (nested_flow.xsl)

i included substring_flow.xsl using the xsl:include and and i tried to map the input to this substring function(Person/LName to InputString) and inturn oputput from substring to the output side field (Output string to Emp/Innitial)

but when i test the mapping it throws a Transformer error.

"Transformer configuration exception occurred when loading XSLT"

I'm importing both the map files in a single zip file into xi. and i'm using the master xsl file(nested_flow.xsl) in the interface mapping where it is reqd to specify the mapping.

Message was edited by: Sidharth Velagapudi

Message was edited by: Sidharth Velagapudi

Former Member
0 Kudos

I have uploaded 2 xsl files

nested_flow.xsl

and substring_flow.xsl.

i'm doing it by importing the zip file which has both the xsl files by using external definition option.

in the interface mapping i'm selecting both the map files.

im calling substring_flow.xsl in nested_flow.xsl

so i'm using

<xsl:include href"substring_flow.xsl"/>

when i test the mapping it gives me an error saying:

"Transformer Configuration Exception occured when loading xslt"