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

RE: <xsl:copy-of> question

Subject: RE: <xsl:copy-of> question
From: "Hunter, David" <dhunter@xxxxxxxxxxxx>
Date: Fri, 17 Dec 1999 09:31:17 -0500
how works xsl copy of
From: Kay Michael [mailto:Michael.Kay@xxxxxxx]
Sent: Friday, December 17, 1999 6:27 AM
> 
> Perhaps
>  
>  <xsl:stylesheet version="1.0"
>    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
>  <xsl:template match="/">
>    <xsl:choose>
>      <xsl:when test="boolean(/employee/@FullSecurity)">
> 		<xsl:copy-of select="/"/>
>      </xsl:when>
>       <xsl:otherwise>
>         <employee>
> 	    <xsl:for-each select="employee/*[not(self::salary)]">
>           	<xsl:copy-of select="."/>
> 	    </xsl:for-each>
>         </employee>
>       </xsl:otherwise>
>     </xsl:choose>
>   </xsl:template>
>   </xsl:stylesheet>
> 
> Mike Kay

Aha!  It works!  And one short hour after I sent the email throwing in the
towel on <xsl:copy-of>.  ;-)  (I had to change
boolean(/employee/@FullSecurity) to number(/employee/@FullSecurity), though.
boolean() seems to just check whether there *is* a FullSecurity attribute,
but if I change it to a number, then the test attribute is changed to a
Boolean for me, and it works properly.  I assume I could be even more
explicit, and say boolean(number(blah))...)

Now all I have to do is figure out my whitespace issues when FullSecurity is
false.  (Everything is indented beautifully when the whole document is
copied, but when it's copying them node-by-node, there are no newlines in
there.)

Thanks Mike.


 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.