Tizag Webmaster Forums  

Go Back   Tizag Webmaster Forums > Web Development > Markup Languages and Styling > XSLT Forum

Reply
 
Thread Tools Display Modes
  #1  
Old 11-04-2009, 01:53 PM
thomasp thomasp is offline
Curious Visitor
 
Join Date: Nov 2009
Posts: 6
thomasp will become famous soon enough
Applying multiple stylesheets in concatenation, XSLT 1.0 (processing instructions)

Hi

My aim is using XSLT 1.0 that can be rendered into XHTML 1.0 by a modern browser such as Firefox 3.5.

In order to keep the XSLT stylesheets simple I thought I could do a simple run with a stylesheet acting as a decorator for the input document before passing it on to the stylesheet that should render the XHTML. This is to add certain details that are unrelated to the rendering itself.

Scenario:
  1. The document (say Document.xml) has a <?xml-stylesheet[..] processing instruction pointing to DecorateDocument.xsl.
  2. DecorateDocument.xsl runs through Document.xml copying what needs to stay the same and appending details (decorating) here and there.
  3. It also matches the processing instruction and writes a new stylesheet URL into the output document, like so:
    Code:
    <xsl:template match="processing-instruction('xml-stylesheet')">
        <xsl:processing-instruction name="xml-stylesheet">
            <xsl:text>href="RenderXHTML.xsl" type="text/xsl"</xsl:text>
        </xsl:processing-instruction>
    </xsl:template>
  4. The output document now has the RenderXHTML.xsl stylesheet as its target stylesheet.

The question: Can this ever work? How do I tell the browser/other parser to rerun the result document with the new stylesheet to render the XHTML?

I really hope it can be done as it seems like an elegant way of simplifying the different tasks that XSLT need to do.
Reply With Quote
Sponsored Links
  #2  
Old 11-05-2009, 03:18 AM
Alain COUTHURES Alain COUTHURES is offline
Student
 
Join Date: Apr 2008
Location: Bordeaux, France
Posts: 121
Alain COUTHURES will become famous soon enough
Unfortunately, no browser will interpret the generated processing instruction.

There is a solution in generating an intermediate HTML page with the necessary Javascript instructions to perform the following transformations.

-Alain
__________________
XForms for browsers without plug-in
http://www.agencexml.com/xsltforms/
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -6. The time now is 01:10 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
© 2008, Tizag