RE: Wrap HTML headings and following siblings in <sec
> Currently processors choke on the XPath, > > (html:h1|html:h2|html:h3|html:h4|html:h5|html:h6)/following-si bling::node() That's a legal XPath 2.0 expression, but it's not legal in 1.0. You have to write *[self::h1|self::h2|...]/following-sibling::node() Though it's probably more efficient to do *[preceding-sibling::*[self::h1|self::h2|self::h3...]] Looking at your code, you're trying to use this as an XSLT pattern rather than as an XPath expression. For a pattern, you need to use this last form whether you're in 1.0 or 2.0. Overall, I think this kind of problem is much better tackled using sibling recursion, where you apply-templates to the first sibling, it does apply-templates to the next sibling, and so on. Or in 2.0, you can use <xsl:for-each-group group-starting-with="h1"/>. Regards, Michael Kay http://www.saxonica.com/ http://twitter.com/michaelhkay
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