This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: Wrapper for XSL for offline development
- To: "Harbaugh, Alan (FUSA)" <AlanHarbaugh at FirstUSA dot com>
- Subject: Re: Wrapper for XSL for offline development
- From: Jeni Tennison <mail at jenitennison dot com>
- Date: Tue, 7 Nov 2000 18:53:16 +0000
- CC: "'XSL-List at mulberrytech dot com'" <XSL-List at mulberrytech dot com>
- Organization: Jeni Tennison Consulting Ltd
- References: <6FADB9008705D311BBEB00805FE6B0EE03711DB5@swilnts817.wil.fusa.com>
- Reply-To: xsl-list at mulberrytech dot com
Alan,
> but how to take the root nodes from several of these document( )
> calls and put them under the root node of my original XML document?
I'd take it in two steps. The first is the pre-processing, that
parses the PIs and copies your source XML, but with the PIs
substituted for the contents of the relevant documents. For example:
<xsl:template match="*">
<xsl:copy>
<xsl:copy-of select="@*" />
<xsl:apply-templates />
</xsl:copy>
</xsl:template>
<xsl:template match="processing-instruction('fub-process')">
<!-- identify the file from the content of the PI -->
<xsl:variable name="file"
select="substring-after(substring-after(., ':'), ':')"
/>
<!-- copy the content of the file (the document element)
into the output -->
<xsl:copy-of select="document(concat($file, '.xml'))/*" />
</xsl:template>
The second step involves applying your production stylesheet to the
result of applying the pre-processing stylesheet.
> And then apply the XSL file that would normally be applied in the
> online environment?
There may be a processor-specific way of chaining stylesheets together
within Xalan, but I'm afraid I'm not familiar enough with it to be
able to tell you. You could create a batch file that ran the two
transformations one after the other. Alternatively, if you don't mind
using the node-set extension function, you could effectively chain the
two transformations together with that.
Let us know if you need any more guidance or a description of one of the
options above.
I hope that helps,
Jeni
---
Jeni Tennison
http://www.jenitennison.com/
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list