Re: Wrapper for XSL for offline development

Subject: Re: Wrapper for XSL for offline development
From: "Harbaugh, Alan (FUSA)" <AlanHarbaugh@xxxxxxxxxxxx>
Date: Tue, 07 Nov 2000 16:49:27 -0500
Unfortunately, I believe, Xalan does not support the node-set extension
I had hoped to be able to chain the stylesheets.
So I took Jeni's suggestion to write the combined XML source and processed
to a temp file and apply the production XSL to it.  A small batch file
automates the

So for anybody else who needs this type of functionality, here is the
"wrapper" xsl file (Just as Jeni wrote it with one modification):

<xsl:stylesheet version="1.0"
<xsl:template match="*">
    <xsl:copy-of select="@*" />
    <xsl:apply-templates />

<xsl:template match="processing-instruction('fusa-process')">
  <!-- identify the file from the content of the PI -->
  <xsl:variable name="file"
                select="substring-before(substring-after(., ':'), ':')"
  <!-- copy the content of the file (the document element)
       into the output -->
  <xsl:copy-of select="document(concat($file, '.xml'))/*" />


Here is the MSDOS batch file using Xalan:

@echo off
REM wrapXSL.bat
REM Batch file to provide a wrapper on production XSL that supplies static
REM data to the PIs in the source XML.
REM Usage:  wrapXSL.bat  source.xml  transform.xsl  result.html
REM check arguments: %1=source XML, %2=script XSL, %3=result file

java org.apache.xalan.xslt.Process -in %1 -xsl wrap.xsl -out out.xml
java org.apache.xalan.xslt.Process -in out.xml -xsl %2 -out %3

Many thanks to Jeni for her suggestions!

Alan Harbaugh
First USA Bank, N.A.           Information Services

201 N. Walnut Street           Tel: (302)282-2098                         
Wilmington, DE 19801           Fax:(302) 282-2198                         
DE1-1525                       AlanHarbaugh@xxxxxxxxxxxx     

 XSL-List info and archive:

Current Thread