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

Re: undo a transformation

Subject: Re: undo a transformation
From: David Carlisle <davidc@xxxxxxxxx>
Date: Wed, 25 Apr 2007 13:08:18 +0100
Re:  undo a transformation
in xslt2, if I understand you correctly something like

<xsl:variable name="a" select="/"/>
<xsl:variable name="b" as="item()*">
  <xsl:apply-templates mode="a" select="$a"/>
</xsl:variable>
<xsl:variable name="c" as="item()*">
  <xsl:apply-templates mode="b" select="$b"/>
</xsl:variable>
<xsl:sequence select="if(deep-equal($b,$c)) then $a else $c"/>


In the above I have  understood 

> If the second stylesheet  doesn't match anything 

to mean that it returns its input unchanged (which means that it must
havehad at least a default template matching everything) If you really
don't match anything so the result of the second transformation is empty
then change the last line to

<xsl:sequence select="if(empty($c)) then $a else $c"/>

David

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.