ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> xsl-list
xsl-list
RE: [xsl] XPath problem: Checking if imidiately preceding sibling is of a certain kind
by Ragulf Pickaxe other posts by this author
Feb 27 2004 10:09AM messages near this date
Re: [xsl] XPath problem: Checking if imidiately preceding sibling is of a certain kind | RE: RE: [xsl] Re: Network diagram - node set intersection
Hi again,

I have tried with:

<xsl:when test="not(preceding-sibling::*[1]=preceding-sibling::A[1])"> 
Last sibling was not an A element -
</xsl:when> 
<xsl:otherwise> 
Last sibling was an A element -
</xsl:otherwise> 

Which I thought would have worked, but it does not. It works well enough on 
the first problem (grouping consecutive A elements), but on the A elements 
with attributs a="5" and a="7", it says that the last element was an A 
element (why?).

> <root>
>   <X><A a="1"/><A a="1"/><A a="2"/>Some text</X>
>   <X><A a="4"/>Some text<br/>
>         <A a="5"/>More text<br/>
>         <A a="7"/>Even more text</X>
> </root>

Thanks,
Ragulf Pickaxe :-|

_________________________________________________________________
Help STOP SPAM with the new MSN 8 and get 2 months FREE*  
http://join.msn.com/?page=features/junkmail


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

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved