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

Re: Abbreviated Location Paths...

Subject: Re: Abbreviated Location Paths...
From: James Clark <jjc@xxxxxxxxxx>
Date: Thu, 22 Apr 1999 17:36:51 +0700
ancestor abbreviated location
Kay Michael wrote:

> I don't think it's just an implementation issue, I've been trying to figure
> it out myself. As far as I can see (see last few paras before section 6.1):
> 
> - every pattern is an expression and its result type is always "node-set"

Right.

> - Not every expression of type "node-set" is a pattern. But the only example
> I have found that isn't is a docref().

There are many others.  Here are some more examples:

from-ancestors(foo)
$x/foo
idref(@ref)
foo:bar("baz")/x

> - every location path is an expression

Right.

> - every location path "that meets certain restrictions" is a pattern: I
> haven't discovered what the restrictions are,

It is a location path none of whose steps use either AxisIdentifiers or
"." or ".." (see the paragraph before production 48).

> nor have I discovered a use
> for location paths that are not patterns

Any use of an axis that doesn't select exclusively from the attributes
and descendants of the context node (and their attributes) is not
allowed in a pattern.  So for example:

.
..
from-ancestors(foo)
from-preceding-siblings(fop)

are not allowed in patterns.

> - every pattern (syntax rule 48) is either a location path or a union of
> location paths

Not quite.  You can also start one of the alternatives in a pattern with
an expression like id('foo') or key('foo','bar').  See production 49.

> Answering your question, a pattern is one kind of expression. There are
> syntactic contexts where the only kind of expression you can use is a
> pattern, e.g. in the match attribute of <xsl:template>.

Right.

Expressions that are not patterns support one operation, which is
evaluation. Expressions that *are* patterns support two different
operations, which are evaluation and matching; when such an expression
is used in a context that requires a pattern, then the matching
operation is the only operation that will be used; when it is used in
another context, then the evaluation operation is the only operation
that will be used.  The matching operation is defined in terms of the
evaluation operation (see the paragraph after production 52).

For example, "foo" is an expression that is also pattern.  The
evaluation operation on "foo" returns a node-set containing the foo
child elements of the current node.  The match operation on "foo"
returns true if the current node is a "foo" element.

James


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.