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

RE: apply one XSLT stylesheet to another one ?

Subject: RE: apply one XSLT stylesheet to another one ?
From: "Brian Martinez" <Brian.Martinez@xxxxxxxxxxxx>
Date: Mon, 27 Nov 2006 11:36:39 -0700
RE:  apply one XSLT stylesheet to another one ?
Yes, it's certainly possible (sometimes necessary in fact!) to generate
XSLT from XSLT.  The trick (in XSLT 1.0 at least) is to use a namespace
alias so that the processor can distinguish between actual XSLT elements
and elements which are meant to be written to output.

You can start with:

<xsl:stylesheet version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:xso="dummy">
  <!-- the 'xso' namespace represents your output XSLT elements -->

  <xsl:output method="xml" version="1.0" encoding="UTF-8" />
  <xsl:namespace-alias stylesheet-prefix="xso" result-prefix="xsl" />

  <!-- write your XSLT templates, substituting 'xso' for 'xsl'
       wherever you wish to output literal XSLT elements -->
  <xsl:template match="xsl:stylesheet | xsl:transform">
    <xso:stylesheet>
    <!-- . . . -->
    </xso:stylesheet>
  </xsl:template>

</xsl:stylesheet>

Note that I haven't tested any of this but it's been mostly cribbed from
Sal Mangano's XSLT Cookbook, and I've done this before, so it *should*
work.  ;-)

hth,
b.

> -----Original Message-----
> From: Michael Stephan [mailto:e0126140@xxxxxxxxxxxxxxxxxxxx]
> Sent: Monday, November 27, 2006 11:10 AM
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  apply one XSLT stylesheet to another one ?
>
> Hallo, sorry for my question but I'm totally new to XSLT.
>
> Is it possible to modify one XSLT stylesheet (A) with another (B) to
> create a new one (C), I guess it is! Would be great if someone of you
> could help me, a tiny example would be more than great. Thx in
advance.
>
> mfg
> Michael St.

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.