This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: XSL to XSL?
- To: <xsl-list at mulberrytech dot com>
- Subject: Re: XSL to XSL?
- From: "Steve Muench" <smuench at us dot oracle dot com>
- Date: Wed, 5 Apr 2000 13:11:15 -0700
- References: <200004051455.KAA01923@mulberrytech.com> <38EB93C1.588E1C29@blueprinttech.com>
- Reply-To: xsl-list at mulberrytech dot com
Yes.
You can take advantage of the built-in XSLT 1.0
feature called <xsl:namespace-alias> to do the
following:
<x:stylesheet xmlns:x="http://www.w3.org/1999/XSL/Transform"
xmlns:xsl="anything" version="1.0">
<x:output method="xml" indent="yes"/>
<x:namespace-alias stylesheet-prefix="xsl" result-prefix="x"/>
<x:template match="/">
<xsl:stylesheet version="1.0">
<xsl:template match="/">
<xsl:value-of select="foo"/>
</xsl:template>
</xsl:stylesheet>
</x:template>
</x:stylesheet>
This outputs the valid XSLT stylesheet:
<?xml version = '1.0' encoding = 'UTF-8'?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<xsl:value-of select="foo"/>
</xsl:template>
</xsl:stylesheet>
I tried this with the Oracle XSLT Processor release 2.0.2.7,
but any XSLT-REC-compliant processor should behave
similarly. I just also tried Saxon 5.2, XT which work as well.
______________________________________________________________
Steve Muench, Lead XML Evangelist & Consulting Product Manager
Business Components for Java Dev't Team, Oracle Corporation
----- Original Message -----
From: "Michael J. Hudson" <mhudson@blueprint-technologies.com>
To: <xsl-list@mulberrytech.com>
Sent: Wednesday, April 05, 2000 12:28 PM
Subject: XSL to XSL?
|
| Here's what I'm currently doing. My task is to come up with a
| general way to transform any one XML file into another XML file
| with different DTDs. Now, what I'm doing is creating a tool that
| creates a mapping file that maps elements from one XML file to
| another. This is all fine and dandy. But now, I need to write
| an XSLT file that translates that XML mapping file into another
| XSLT script. That final XSLT script being the script that people
| would use to translate their XML files from one to another.
|
| The problem I'm having is getting an XSL script to output XSL
| elements. That is, I want the output to be another XSL file.
| The way I'm currently solving this, is using another namespace
| other than xsl.... say temp. So, that 'xsl:for-each' becomes
| 'temp:for-each'. And then I have a method that reads in the
| output file and does a find-replace changing temp back to xsl.
| Now, not being an expert in XSLT... I'm wondering if I'm
| bending over backwards to do this. Is there way in XSLT to
| have XSLT element outputs that don't affect the original
| XSLT file??
|
| Thanks!
|
| -------------------------------------
| Michael J. Hudson
| Software/Framework Engineer
| mhudson@blueprinttech.com
|
| cell-phone: 703.932.6412
| voice-mail: 703.827.0638 ext. 4786
| fax: 703.734.0987
|
| Blueprint Technologies
| "The E-Solution Architect"
| http://www.blueprinttech.com
|
|
| XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list