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

RE: Testing implicit XHTML hierarchy

Subject: RE: Testing implicit XHTML hierarchy
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Thu, 5 Jul 2007 11:04:45 +0100
RE:  Testing implicit XHTML hierarchy
> > The rules could be expressed like this:
> > 
> > 1.	There can only be one h1, and it must be the first heading.
> > 2.	The first heading after h1 must be h2.
> > 3.	The first heading after h2 must be h2 or h3.
> > 4.	The first heading after h3 must be h2 or h3 or h4.
> > 5.	The first heading after h4 must be h2 or h3 or h4 or h5
> > 6.	The first heading after h5 or h6 can be anything except h1.

Of course, I translated your rules too literally. In each case what you
meant to say is "The first heading after X, if there is one, must be...". So
change the result to
> > 
> 
> Assuming the context node is one of these headings:
> 
not(following-sibling::*[h:is-heading(.)][1][h:level(.) le 1 or h:level(.)
gt h:level(current())+1])
> 
> where
> 
> h:is-heading() is {matches(local-name(), 'h[1-6]')}
> 
> and
> 
> h:level() is {xs:integer(substring(local-name(), 2))
> 
> (And add a condition on the parent element that there is an h1)
> 
> Michael Kay
> http://www.saxonica.com/

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.