[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: xsl::number from current note
Hi Ming, > Do you know what's the difference between > <xsl:number level="single" from="*" count="SEC" format="1. "/> > and > <xsl:number level="single" from="." count="SEC" format="1. "/> > > The second one sometimes does not work by giving error message: > > XSLException Type is: XPathParserException > Message is: Expected node test. > pattern = '.' > Remaining tokens: ('.') The value of the from attribute should be an *XSLT pattern* -- the same kind of value as that held in the match attribute of <xsl:template>. The purpose of patterns is to test nodes based on their kind, name, ancestry and so on. In this case, the pattern held by the from attribute is used to test all the ancestors of the node you're on (the context node), and you get numbering within the closest ancestor that matches that pattern. In this case, the pattern "*" matches all elements, so you get numbering within the parent element of the node you're on (which is presumably a <SEC> element). The value "." is a *XPath expression* (that selects the context node). It isn't a legal XSLT pattern, which is why you're getting the error message. Cheers, Jeni --- Jeni Tennison http://www.jenitennison.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
|