[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Import stylesheets in Xalan again
Thank you for your answers but they don't solve the problem. I want to give some explanations about my situation. We have web application which pages have xml mark-up and the design created by xsl. There are many xsl templates which are used by all pages in our project. So we want to put them into the separate file and import this stylesheet in all other files. In order to decrease the transformation time we want to parse this stylesheet on application loading and store it in the memory so we are able to automatically import it during the concrete transformation. So standard <xsl:import> and <xsl:include> instruction is not applicable. The following code work perfectly in Xalan-1: //On application loading: XSLTProcessor processor = XSLTProcessorFactory.getProcessor(); Vector imports = new Vector(); StylesheetRoot sheet1 = processor.processStylesheet(xslInputSource1); imports.add(sheet1); //During the concrete transformation: StylesheetRoot sheet2 = processor.processStylesheet(xslInputSource2); sheet2.setImports(imports); //special method for importing parsed stylesheets //In this case sheet2 contains templates from both stylesheets sheet1 and sheet2 But the following code similar to the previous one doesn't work in Xalan-2: //On application loading: TransformerFactory factory = TransformerFactory.newInstance(); StylesheetRoot sheet1 = (StylesheetRoot)factory.newTemplates(xslInputSource1); //During the concrete transformation: StylesheetRoot sheet2 = (StylesheetRoot)factory.newTemplates(xslInputSource2); sheet2.setImport(sheet1); //In this case sheet2 still contains templates only from stylesheets sheet2; //templates from sheet1 are not found during the xml transformation I'll be very thankful if you help me to solve this problem. Andrey 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
|