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

RE: Problem with preceding-sibling, my code, or my too

Subject: RE: Problem with preceding-sibling, my code, or my tool? Read on...
From: "Diamond, Jason" <Jason.Diamond@xxxxxxx>
Date: Fri, 1 Jun 2001 15:39:46 -0600
my too
Were you expecting this?

Pre:item
Me:item
Pre:item
Me:item

I got the same output with both MSXML3 and SAXON 6.2.2. What processor does
XSL Designer use?

-----Original Message-----
From: Martin Streicher [mailto:mstreicher@xxxxxxxxxxxxx]
Sent: Friday, June 01, 2001 2:24 PM
To: 'XSL-List@xxxxxxxxxxxxxxxxxxxxxx'
Cc: Martin Streicher
Subject:  Problem with preceding-sibling, my code, or my tool? Read
on...


I have the read the FAQs on axes, yet I still have a problem.... 

For the input... 

<?xml version="1.0" encoding="UTF-8"?>
<list>
<char/>
<item value="1">one
<sub>subone</sub>
</item>
<item value="2">two
<sub>subtwo</sub>
</item>
<item value="3">three</item>
</list> 

And the XSLT stylesheet.... 
<xsl:stylesheet xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>
<xsl:output method='xml'/> 
<xsl:template match="list">
<xsl:apply-templates select="*"/>
</xsl:template> 
<xsl:template match="item">
<xsl:if test="name(preceding-sibling::*[1])=name(.)">
Pre:<xsl:value-of select="name(preceding-sibling::*[1])"/>
Me:<xsl:value-of select="name(.)"/>
</xsl:if>
</xsl:template>
</xsl:stylesheet> 

Why does the test always fail? If instead I use preceding-sibling::item[1],
the test works fine. I don't get it. 
Help! This is critical. I need to know if the immediate previous (and also
immediate next using 
following-sibling) are the same element type as the context node. 

Martin 
mstreicher@xxxxxxxxxxxxx <mailto:mstreicher@xxxxxxxxxxxxx> 

P.S. I am running this under XSL Designer 1.02. 


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.