[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?
> 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
|
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
|