[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] 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.
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|