xsl-list
[Top] [All Lists]

RE: [xsl] Connecting the Source and Destination fields

2007-08-29 05:04:39
Hi Ronan, 
Thanks for the explanation. 
Now it?s clear regarding that expression.

I am facing problem
For the below input 

<connection destination="block.0/event.1" source="block.0/event.0"/> 
<connection destination="block.0/event.2" source="block.0/event.1"/> 
<connection destination="block.1/event.4" source="block.1/event.3"/> 
<connection destination="block.1/event.5" source="block.1/event.4"/>
<connection destination="block.1" source="block.0"/>

For now I get output as

Line 1 :  block.0/event.0 -> block.0/event.1 - > block.0/event.2
Line 2 :  block.1/event.3 -> block.1/event.4 - > block.1/event.5

Line 3 :  block.0 -> block.1

-------------------

Here in line 3 how can I get (Line:1) -> (Line:2)

i.e.   

(block.0/event.0 -> block.0/event.1 - > block.0/event.2)               
->  
(block.1/event.3 -> block.1/event.4 - > block.1/event.5)

block.0 -> block.1 means 
All events in block.0 followed by  all events in block.1
--------------------

I tried this but I am unable to get.
Can you or any one please help in doing this ? 
Please help !

Thanks,
Yaswanth


 

-----Original Message-----
From: Ronan Klyne [mailto:ronan(_dot_)klyne(_at_)groupbc(_dot_)com] 
Sent: Wednesday, August 29, 2007 4:57 PM
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: Re: [xsl] 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[(_at_)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(_dot_)klyne(_at_)groupbc(_dot_)com
www.groupbc.com

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>