0

Can I use multiple Xslt to create a single output xml file.

In my project, I need separate Xsl files for fonts, images, layout etc. So, is it possible to transform a single document with multiple xslt files into a single transformed xml document.

1 Answer 1

4

Normally you combine xslt using two specific elements.

Choice 1. <xsl:import>

<xsl:import href="fonts.xsl"/>

In this case the imported stylesheet will have lower precendece that the importing one.

Choice 2. <xsl:include>

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

In this case you will include the contents of fonts.xsl into your main xsl. It's a real merge.

For more information have a look at Combining Stylesheets with Include and Import.

Hope this helps.

Sign up to request clarification or add additional context in comments.

2 Comments

I can do it in this way ,Thank You for the replay
Do note that through xsl.import XSLT implements "inheritance" (xsl:apply-imports works as super class invocation) and through xsl:include you just have modularization.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.