[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: How To Include external XSL files into a master XSL file
(I posted this answer to the original post of Jim's message to XML-Dev, and
I think the answer would be of interest to others on this list so I am
posting it again here)
At 00/02/16 12:25 -0600, Jim Garrett wrote: What is the syntax to link multiple child style sheets into a master style sheet ... Your syntax above implies you want different snippets to be included in the root template, which can be done for the content of a single template, but I suspect you would rather want to include different sets of template rules into a single stylesheet. If you must have a portion of a given template in an external file, you can use the XML external parsed general entities, but that syntactic scheme does not support reuse properly (though many coerce it to try). Personally, I don't put portions of templates in external files, rather, I use the <xsl:call-template> construct to accomplish what you are implying. There are two semantic inclusion schemes at the top level of a stylesheet (children of the stylesheet container element): inclusion and importation. You can use <xsl:include> to pull in top-level elements from another stylesheet and all such constructs are included as if they were edited in-situ (which sometimes can introduce problems accommodating template conflict resolution). You can use <xsl:import> to pull in top-level elements from another stylesheet with the concept of "importance". This confers more importance on the importing stylesheet constructs than on the imported stylesheet constructs, without conflict. This is a powerful way to exploit an existing stylesheet with tweaks from an importing stylesheet. also what is the proper syntax in the included external xsl files Yes (with the caveat that again you appear to misconstrue the use of the declaration of the template for the root node) for included and imported stylesheets, but no for external parsed general entities (which are merely well-formed). Included and imported stylesheets are entire stylesheets in their own right. If you are attending X-Tech in San Jose, I am teaching a two-day hands-on-with-exercises tutorial covering 100% of the constructs of XSLT. Please see http://www.gca.org/attend/2000_conferences/xtech_2000/default.htm for registration information. I am also teaching this material at other conferences (see our web site below for the conference course schedule) and companies in Europe, Japan and the U.S. are licensing our XSLT training materials for their own deliveries to their own customers. I hope this helps. .................. Ken
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|