|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] How to select immediate preceding-sibling value
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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








