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

RE: Tree Fragment - How do I test it AND output it?

Subject: RE: Tree Fragment - How do I test it AND output it?
From: "Michael Kay" <michael.h.kay@xxxxxxxxxxxx>
Date: Tue, 18 Dec 2001 09:35:20 -0000
temp tree xsl
> How do I both test the "return" value from a template, and
> output some of the result nodes?
>
You put the result in a variable (a "result tree fragment" or temporary
tree):

<xsl:variable name="tree">
  <xsl:call-template name="make-tree"/>
</xsl:variable>

You can copy this tree to the result tree using copy-of:

<xsl:copy-of select="$tree"/>

You can access the string value of the tree tree directly (that is, the
concatenation of its text nodes):

<xsl:if test="string($tree)='tangerine'"/>

To access the detailed structure of the tree you need the xx:node-set
extension:

<xsl:variable name="root" select="xx:node-set($tree)"/>

You can then use path expressions or xsl:apply-templates to manipulate the
tree in the same way as a source tree:

<xsl:apply-templates select="$root" mode="temp-tree"/>

Mike Kay


 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.