Include files, but in XSL
-
Something very basic must be alluding me because this seems like an obvious thing that people would want to do in XSL, but for the life of me I cannot figure out how to do it. I have one XML file with some content in it. I then have a master XSL file which transforms the XML into nice HTML for the browser. However that XSL file needs to be a combination of other XSL files. i.e. It is a normal ASP with include statements idea. So I need to know how to import sections of XSL into another XSL document. dankie shan. regards, Paul Watson Bluegrass Cape Town, South Africa "The greatest thing you will ever learn is to love, and be loved in return" - Moulin Rouge Sonork ID: 100.9903 Stormfront
-
Something very basic must be alluding me because this seems like an obvious thing that people would want to do in XSL, but for the life of me I cannot figure out how to do it. I have one XML file with some content in it. I then have a master XSL file which transforms the XML into nice HTML for the browser. However that XSL file needs to be a combination of other XSL files. i.e. It is a normal ASP with include statements idea. So I need to know how to import sections of XSL into another XSL document. dankie shan. regards, Paul Watson Bluegrass Cape Town, South Africa "The greatest thing you will ever learn is to love, and be loved in return" - Moulin Rouge Sonork ID: 100.9903 Stormfront
Have you tried using xsl:import or xsl:include? Works for me.
-
Something very basic must be alluding me because this seems like an obvious thing that people would want to do in XSL, but for the life of me I cannot figure out how to do it. I have one XML file with some content in it. I then have a master XSL file which transforms the XML into nice HTML for the browser. However that XSL file needs to be a combination of other XSL files. i.e. It is a normal ASP with include statements idea. So I need to know how to import sections of XSL into another XSL document. dankie shan. regards, Paul Watson Bluegrass Cape Town, South Africa "The greatest thing you will ever learn is to love, and be loved in return" - Moulin Rouge Sonork ID: 100.9903 Stormfront
I figured it out. It was actually a problem a co-worker had and I had not sat down and tried anything until last night, it came relatively easy once I got stuck in. The way to do it is using the <xsl:include href="file to include" /> and then the <xsl:call-template name="template name to call" /> elements. If anyone wants an actual code example then please just ask. regards, Paul Watson Bluegrass Cape Town, South Africa "The greatest thing you will ever learn is to love, and be loved in return" - Moulin Rouge Sonork ID: 100.9903 Stormfront
-
Have you tried using xsl:import or xsl:include? Works for me.
MarSCoZa wrote: Have you tried using xsl:import or xsl:include? Works for me. Yup, I, or rather my co-worker, used that but could not figure out how to actually apply the included templates at the spots she wanted. I found the xsl:call-template element and that worked perfectly. Thanks for the input :) regards, Paul Watson Bluegrass Cape Town, South Africa "The greatest thing you will ever learn is to love, and be loved in return" - Moulin Rouge Sonork ID: 100.9903 Stormfront