[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

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
xsl wrap
Unfortunately, I believe, Xalan does not support the node-set extension
function.
I had hoped to be able to chain the stylesheets.
So I took Jeni's suggestion to write the combined XML source and processed
PI's
to a temp file and apply the production XSL to it.  A small batch file
automates the
process.

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"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="*">
  <xsl:copy>
    <xsl:copy-of select="@*" />
    <xsl:apply-templates />
  </xsl:copy>
</xsl:template>

<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'))/*" />
</xsl:template>

</xsl:stylesheet>


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:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.