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

Re: template output as text

Subject: Re: template output as text
From: Oliver Becker <obecker@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 7 Sep 2000 12:28:20 +0200 (MET DST)
xsl template output
> <xsl:template match="/">
> <table><tr><td>
> 	<xsl:call-template name="example"/>
> </td><td>
> 	<xsl:call-template name="example"/>
> </td></tr></table>
> </xsl:template>
> 
> The template "example" generates HTML tags. In the first column, I need to 
> print the outcome of the template "example" as a source code 
> (un-interpeted). While, I want it to be interpeted in the second column. How 
> can I do that?

You want to process the outcome of a template, i.e. you want to process 
a "result tree fragment". With XSLT 1.0 this is not possible.
However - most processors offers a node-set extension function.

A possible approach would be
<xsl:template match="/">
<table><tr><td>
        <xsl:variable name="outcome">
	   <xsl:call-template name="example"/>
	</xsl:variable>
	<xsl:apply-templates select="xxx:node-set($outcome)" mode="verbatim" />
</td><td>
	<xsl:call-template name="example"/>
</td></tr></table>
</xsl:template>

Where xxx must be bound to a processor specific namespace.
Displaying the generated HTML uninterpreted has to be done step by step
in XSLT (with templates in mode "verbatim"). I think there are examples 
in the archives or the XSL FAQ.
If you want a more sophisticated solution, look at the implementation
of my xmlverbatim formatter:
http://www.informatik.hu-berlin.de/~obecker/XSLT/xmlverbatim/xmlverbatim.xsl

Hope that helps,
Oliver


/-------------------------------------------------------------------\
|  ob|do        Dipl.Inf. Oliver Becker                             |
|  --+--        E-Mail: obecker@xxxxxxxxxxxxxxxxxxxxxxx             |
|  op|qo        WWW:    http://www.informatik.hu-berlin.de/~obecker |
\-------------------------------------------------------------------/


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.