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

Re: xsl::number from current note

Subject: Re: xsl::number from current note
From: Jeni Tennison <jeni@xxxxxxxxxxxxxxxx>
Date: Thu, 20 May 2004 21:11:50 +0100
expected node test
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/

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.