xml editor

Supported platforms

Compatible with Windows7 & Mac OS X Snow Leopard

Ready for data server software
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] double XSLT processing question


Subject: Re: [xsl] double XSLT processing question
From: Joerg Heinicke <joerg.heinicke@xxxxxx>
Date: Thu, 05 Dec 2002 01:23:53 +0100

2 approaches:

either two stylesheets in a pipeline, so 2 transformation steps

or storing the temporary output in a variable, converting this variable (it is of data type Result Tree Fragment in XSLT 1.0) into a node set and applying templates to the variable containing the node set


The conversion of RTF to node set can only be done by a processor specific extension function, so I prefer the first approach, especially on a framework like Cocoon (http://xml.apache.org/cocoon/index.html).


Regards,

Joerg

bix xslt wrote:
All,

Suppose I have the following XML:

<data><text>food</text>
 <data><text>apple</text></data>
 <data><text>orange</text></data>
</data>

 With the following XSL:
<xsl:stylesheet>
 <xsl:template match="/">
   <xsl:call-template name="ouptutFood" />
 </xsl:template>

 <xsl:template name="outputFood">
   <table type="changeThis">
     <tr>
     <xsl:for-each "./data">
       <td><xsl:value-of select="./text" /></td>
     </xsl:for-each>
   </table>
 </xsl:template>
</xsl:stylesheet>

At a future point in time, however, I want to add a style to the html output, but I do not want to change the current XSL file. How would I create a second style sheet (see below) that would add my styles in and have it process the output of the original stylesheet?

<xsl:stylesheet>
 <xsl:template match="table">
   <xsl:if test="@type='changeThis'">
     <table border="1"><xsl:apply-templates /></table>
   </xsl:if>
 </xsl:template>
</xsl:stylesheet>

Could/Would I somehow use a variable with a call from the original to produce the tree??

Thanks in advance,
Bix

_________________________________________________________________
Add photos to your e-mail with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail



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





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



Current Thread
Keywords
XML Editor | XML Author | WYSIWYG Editors | Schema Editor | XSD Documentation | XSL/XSLT Editor | XQuery | XML Databases | SVN Client
© 2002-2011 SyncRO Soft Ltd. All rights reserved. | Sitemap | Privacy Policy | This website was created & generated with <oXygen/>®XML Editor