|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: template output as text
> <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
|
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
|

Cart








