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

Re: Connecting the Source and Destination fields

Subject: Re: Connecting the Source and Destination fields
From: Ronan Klyne <ronan.klyne@xxxxxxxxxxx>
Date: Wed, 29 Aug 2007 12:26:32 +0100
Re:  Connecting the Source and Destination fields
Yaswanth wrote:
> Hi can you please explain me what exactly the below line is doing and how it
> is working?
> 
> <xsl:for-each 
> select="/root/connection[not(/root/connection/@destination = @source)]">

First, some facts:
* If a connection has a destination that does not equal the source of
any other connection, then it is and the end of the chain.
* If a connection has a source that does not equal any other
connection's destination, then it is the start of the chain.

/root/connection[not(/root/connection/@destination = @source)]
This line is designed to select all the nodes that represent the start
of a chain. It does this by expressing the above statement in XPath:

"If a connection has a source that does not equal any other connection's
destination, then it is the start of the chain."

So, we want to select connections:
/root/connection

with a source attribute:
/root/connection[@source]

that does not equal any connection's destination:
/root/connection[not(/root/connection/@destination = @source)]


I hope this explains it...

	# r

-- 
Ronan Klyne
Business Collaborator Developer
Tel: +44 (0)870 163 2555
ronan.klyne@xxxxxxxxxxx
www.groupbc.com

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.