XSLT multiple outputs using XSLT 1.0

Posted on 2008-11-04
Last Modified: 2013-11-19
Hello all,
I'm looking for a solution to pretty much the exact problem as described in XSLT Multiple Outputs question, but I'm restricted to xslt 1.0, preferably with no extensions.  My understanding is that result-document is a 2.0 addition.  Does anyone know of a solution that does not use any 2.0 features.

Thanks much.
Question by:levisl
    LVL 60

    Expert Comment

    by:Geert Bormans
    THere are some extension functions that do the same, at least I know that saxon 6 allows this.
    If you really don't want extension functions, all you are left with is running different stylesheets, or the same stylesheet with parameters until you have all the output documents.
    So you will have to organise this outside your stylesheet.

    Maybe there is an extension function for your processor... which one are you using?

    Author Comment

    Thanks for the quick reply, Gertone.  We're using xalan 2.7.0, and I just confirmed that it's OK to use xalan extensions.  Do you know if xalan supports this?  If you don't know offhand, don't sweat it; I can certainly check that out.  Short answer is "for 1.0 if supported by extensions can use them, otherwise need to handle with multiple stylesheets or with multiple calls to stylesheet using parameters." Is that pretty much right?
    LVL 60

    Accepted Solution

    that is pretty much right,
    but multiple stylesheets will be complicated (I checked the original question... it would be a fun task)

    Having said that, Xalan is OK, it has xalan:write for you

    add this namespace and attribute
    in the xsl:stylesheet element

    and then you can simply use

            <xalan:write file="filename.html">
    or make the filename dynamic with attribute value templates
           <xalan:write file="{$myVariable}">

    Author Closing Comment

    Thanks,  I'll try that approach and post more questions if I have them.
    LVL 60

    Expert Comment

    by:Geert Bormans

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Browsers only know CSS so your awesome SASS code needs to be translated into normal CSS. Here I'll try to explain what you should aim for in order to take full advantage of SASS.
    Read about why website design really matters in today's demanding market.
    This tutorial demonstrates how to identify and create boundary or building outlines in Google Maps. In this example, I outline the boundaries of an enclosed skatepark within a community park.  Login to your Google Account, then  Google for "Google M…
    The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    7 Experts available now in Live!

    Get 1:1 Help Now