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

Re: Q: pattern selection for outside the context node

Subject: Re: Q: pattern selection for outside the context node
From: Tony Graham <tgraham@xxxxxxxxxxxxxxxx>
Date: Fri, 9 Jul 1999 09:59:56 -0400 (EST)
Re: Q:  pattern selection for outside the context node
At 8 Jul 1999 18:24 -0700, G. Ken Holman wrote:
 > According to 6.1.1 there are 12 axes you can choose from when building a
 > pattern:
 > 
 >  [5] AxisIdentifier ::=  'from-ancestors'
 >                        | 'from-ancestors-or-self'
 >                        | 'from-attributes'
 >                        | 'from-children'
 >                        | 'from-descendants'
 >                        | 'from-descendants-or-self'
 >                        | 'from-following'
 >                        | 'from-following-siblings'
 >                        | 'from-parent'
 >                        | 'from-preceding'
 >                        | 'from-preceding-siblings'
 >                        | 'from-self'

These are good for location paths, but not for patterns.  Section 6.3
states:

   A pattern must match the grammar for Pattern. A Pattern is set of
   location path patterns separated by |. A location path pattern is a
   location path none of the steps of which use either AxisIdentifiers
   or . or ... Location path patterns can also start with an id() or
   key() function call with a literal argument (see [6.2.2
   Node-sets]). Predicates in a pattern can use arbitrary expressions
   just like predicates in a location path.

 > And according to 6.1.4 there are abbreviations available to be used to
 > address 5 of the axes:
 > 
 >     .       refers to   from-self
 >     @name   refers to   from-attributes   (name of "*" means "all")
 >     name    refers to   from-children     (name of "*" means "all")
 >     ..      refers to   from-parent
 >     //      refers to   from-descendants

But you can't use "." or ".." in a pattern.

 > When the pattern starts with "/", the orientation is from the root of the
 > tree.
 > 
 > The pattern can be comprised of a number of location steps, each step
 > delimited by "/".
 > 
 > The function id() described in 6.2.2 allows you to, in a location step,
 > refer to a node or nodes with unique identifiers.

Provided you specify the ID as a literal string.

 > The function key() is similar to id() in that it allows you to refer to a
 > node or nodes elsewhere in the document, but it does so without the
 > reference needing to be a node with a unique identifier.  There is a short
 > description of the power of the key() function in the free resources
 > section of our web site.

Provided you use literal arguments.

Regards,


Tony Graham
======================================================================
Tony Graham                            mailto:tgraham@xxxxxxxxxxxxxxxx
Mulberry Technologies, Inc.                http://www.mulberrytech.com
17 West Jefferson Street                    Direct Phone: 301/315-9632
Suite 207                                          Phone: 301/315-9631
Rockville, MD  20850                                 Fax: 301/315-8285
----------------------------------------------------------------------
  Mulberry Technologies: A Consultancy Specializing in SGML and XML
======================================================================


 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.