Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 192
  • Last Modified:

XSLT multiple outputs using XSLT 1.0

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.
0
levisl
Asked:
levisl
  • 3
  • 2
1 Solution
 
Geert BormansCommented:
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?
0
 
levislAuthor Commented:
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?
0
 
Geert BormansCommented:
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
         xmlns:xalan="org.apache.xalan.xslt.extensions.Redirect"
         extension-element-prefixes="xalan"
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}">
0
 
levislAuthor Commented:
Thanks,  I'll try that approach and post more questions if I have them.
0
 
Geert BormansCommented:
welcome
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now