|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: numbering question
Thanks Michael - "For each countable node (taking them in document order), count how many preceding siblings it has that also match the count pattern and add one for the node itself." I had misread this, thinking that the "sibling" relation was applied _after_ removing any nodes (at any level) that didn't match the count pattern. I'm glad to have that corrected at last. But I think I have the right expression for my problem here: count="/document | included | section[not(parent::included)]" gives me exactly the right numbers everywhere. This works because a "document" node will never appear anywhere except directly under an "included" node or at the document root. But I was just playing around with this expression to see how I would express the count if it was, and found that count="/document | included | (section|document)[not(parent::included)]" is invalid. Is there a more concise way of writing this expression than the full version below? count="/document | included | section[not(parent::included)] | document[not(parent::included)]" Cheers Trevor -----Original Message----- From: Michael Kay [mailto:mike@xxxxxxxxxxxx] Sent: Wednesday, 24 December 2008 12:49 a.m. To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx Subject: RE: numbering question Each 2nd-level <document> element is the first child of its parent, and therefore gets the number 1. Try count="/document | included | section" (Or just generate the leading "1." by hand, as it's constant, and use count="included | section"). Michael Kay http://www.saxonica.com/
|
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
|






