|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Suggestion for XSLT 2.0
----- 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
|
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








