[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: crism@xxxxxxxxxxxxx (Christopher R. Maden)
Date: Thu, 16 Dec 1999 09:20:19 -0800
xsl copy of parent
Ray Waldin pointed out off-list, and quite rightly, that my previous
response was incorrect:

>"Christopher R. Maden" wrote:
>> [Nikolai Grigoriev]
>> ><!-- Processing of salary nodes is disabled for FullSecurity="0" -->
>> ><xsl:template match="salary[/employee/@FullSecurity=0]"/>
>>
>> Not quite - that will hide all salaries in any document in which there is
>> any employee with FullSecurity="0".  You need to scope it:
>  ^^^
>
>I think you meant to say: that will hide all salaries in any document in
>which the
>*document element* is an employee with FullSecurity="0".
>
>> <xsl:template match="employee[@FullSecurity=0]/salary"/>
>>
>> or, alternately:
>>
>> <xsl:template match="salary[../employee/@FullSecurity=0]"/>
>>
>> though I prefer the former for clarity.
>
>So do I as the latter is incorrect.  It matches salary elements with
>*sibling* employee
>elements having FullSecurity="0".  From the XPath REC:
>
>> a location step of .. is short for parent::node(). For example, ../title
>>is short for
>> parent::node()/child::title and so will select the title children of the
>>parent of the
>> context node.
>
>Parent employee elements are matched like this:
>
><xsl:template match="salary[parent::employee/@FullSecurity=0]"/>
>
>or
>
><xsl:template match="salary[..[name()='employee']/@FullSecurity=0]"/>
>
>though I prefer the former for clarity.  :)
>
>-Ray

-Chris

--
Christopher R. Maden, Solutions Architect
Exemplary Technologies
One Embarcadero Center, Ste. 2405
San Francisco, CA 94111



 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.