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

How to select immediate preceding-sibling value

Subject: How to select immediate preceding-sibling value
From: Arulraj <p_arulraj@xxxxxxxxx>
Date: Tue, 15 Nov 2005 04:09:41 -0800 (PST)
xsl preceding sibling immediate
Hello,

I have following xml fragment as follows:

<?xml version="1.0" encoding="UTF-8"?>
<layout>
	<Application name="Die application" level="1"/>
	<Processgroup/>
	<Process name="FSRenta" level="3"/>
	<PanelName name="AnalysisLayout " level="4"/>
	<frame name="Frame contents"/>
	<PanelName name="GeneralLayout" level="4"/>
	<Processgroup name="xxx" level="2"/>
	<Process name="TestApplication" level="3"/>
	<PanelName name="AnalysisLayout123" level="4"/>
	<Application name="VDO" level="1"/>
</layout>

And i have following XSL to get the preceding-sibling
of PanelName.

<xsl:template match="layout">
<test>
		<xsl:for-each select="child::*">
			<xsl:if test="name()='PanelName'">
				<xsl:text>current node---	</xsl:text>
				<xsl:value-of select="@name"/>
				<xsl:text>Preceding sibling---</xsl:text>
				<xsl:value-of
select="current()/preceding-sibling::Process/@name"/>
				<xsl:text>
				</xsl:text>
			</xsl:if>
		
		</xsl:for-each>
</test>		
</xsl:template>

I got the following output:
<test>
current node---	AnalysisLayout Preceding
sibling---FSRenta
current node---	GeneralLayoutPreceding
sibling---FSRenta
current node---	AnalysisLayout123Preceding
sibling---FSRenta
</test>
Here current node Panel Name is "AnalysisLayout123"
but it preceding sibling gets the "FSRenta". Why its
not refered to "TestApplication"?

But my expected output will be as follows:
<test>
current node---	AnalysisLayout Preceding
sibling---FSRenta
current node---	GeneralLayoutPreceding
sibling---FSRenta
current node---	AnalysisLayout123Preceding
sibling---TestApplication
</test>

any help..


Regards,
Raj



	
		
__________________________________ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.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.