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

Re: Suggestion for XSLT 2.0

Subject: Re: Suggestion for XSLT 2.0
From: Paul Tchistopolskii <paul@xxxxxxx>
Date: Sun, 10 Sep 2000 18:57:54 -0700
xslt 2.0 preceding
----- Original Message ----- 
From: Matthew Bentley 

> In XSLT, at the moment, if you want to check if the preceding-sibling is a
> particular element type, lets say, 'heading', then the following code is
> necessary:
> 
> test="preceding-sibling::*[self::heading and position() = 1]"
> 
> It seems to me that this situation (I.e testing the type of an immediately
> neighbouring element) is fairly common and there should be some abbreviation
> for it for preceding, following, preceding-sibling and following-sibling.
> Anybody agree?, disagree?

I think you are not the only one who feels that current 
Xpath is more verbose than it could be.

I was thinking about 

some[  -1 ]  for preceding-sibling of element 'some'
some[ +1 ]  for following-sibling of element 'some'
some[  1 ]   for first child of element 'some'

Rgds.Paul.

<offtopic>
PS. Considering attribute to be ordinary child 
element also simplifies a model ( and 'everything' ).
The only drawback ( scientifically valid, 
but almost not existent in the real life ) is that there 
should be no  attribute with the name equal to 
the name of child element. Considering 
PCDATA to be a special element <_> also 
simplifies some things. In fact this all is MinML 
model, not XML model, so sorry for offtopic - 
just wanted to point out some other view 
which sometimes makes things easier.
</offtopic>



 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.