ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> xsl-list
xsl-list
RE: [xsl] apply one XSLT stylesheet to another one ?
by Brian Martinez other posts by this author
Nov 27 2006 10:36AM messages near this date
RE: [xsl] apply one XSLT stylesheet to another one ? | [xsl] Using COUNT to create unique anchors
& XSLT 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@[...].at]
>  Sent: Monday, November 27, 2006 11:10 AM
>  To: xsl-list@[...].com
>  Subject: [xsl] 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.
>  
>  --~------------------------------------------------------------------
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
>  To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
>  or e-mail: <mailto:xsl-list-unsubscribe@[...].com>
>  --~--



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe@[...].com> 
--~--
Thread:
Michael Stephan
Michael Kay
Brian Martinez

Privacy Policy | Email Opt-out | Feedback | Syndication
© 2004 ActiveState, a division of Sophos All rights reserved