[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: "Andrew Welch" <andrew.j.welch@xxxxxxxxx>
Date: Mon, 20 Aug 2007 09:03:47 +0100
Re:  Connecting the Source and Destination fields
On 8/20/07, Yaswanth <yaswanth.mtrx@xxxxxxxxx> wrote:
> Hi Andrew,
> Thanks for the reply
> But I have some issues !
>
> What if I have some ting like this ?
>
> <connection destination="event.3" source="event.0"/>
> <connection destination="event.1" source="event.2"/>
> <connection destination="event.2" source="event.3"/>
> <connection destination="event.4" source="event.1"/>
>
> By using
>
> <xsl:sort select="@source"/>
>
> For understanding my input will change to  :
>
> <connection destination="event.3" source="event.0"/>
> <connection destination="event.4" source="event.1"/>
> <connection destination="event.1" source="event.2"/>
> <connection destination="event.2" source="event.3"/>
>
> My output will be
>         event.0 -> event.3 -> event.4 -> event.1 -> event.2
>
>
> But I am expecting
>
>         event.0 -> event.3 -> event.2 -> event.1 -> event.4
>

Ahh, in which case:

<xsl:text>event.0</xsl:text>
<xsl:apply-templates select="connection[@source = 'event.0']"/>

<xsl:template match="connection">
	<xsl:text> -> </xsl:text>
	<xsl:value-of select="@destination"/>
	<xsl:apply-templates select="../connection[@source = current()/@destination]"/>
</xsl:template>


-- 
http://andrewjwelch.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.