[XSL-LIST Mailing List Archive Home]
[By Thread]
[By Date]
RE: XSLT/XPATH jargon
Subject: RE: XSLT/XPATH jargon From: sara.mitchell@xxxxxxxxx Date: Thu, 20 Jan 2000 13:49:29 -0500 |
Is this for the very beginner? because if so, I think several of them need some work (: but I do have some suggestions... Sara > -----Original Message----- > From: Pawson, David [mailto:DPawson@xxxxxxxxxxx] > Sent: Thursday, January 20, 2000 12:14 PM > To: 'xsl-list@xxxxxxxxxxxxxxxx' > Subject: XSLT/XPATH jargon > > > RTF and AVT finally did it. > > I've 'lifted' various definitions from various places to try and put > together > a jargon buster for XSLT. Comments please prior to my putting it in > the FAQ. > What would you like in it / whats missing. > Can you improve on the definitions? > I'd appreciate any help. > > Intent is clarity of understanding, not exactness. > > Regards, DaveP > > > > > XSLT Terminology: > Source: W3C Recommendation 16 November 1999 > Revision: Draft 0.a > > @: The @ character is an abbreviation for the attribute:: axis. I would also add "Combined with the name of an attribute, it identifies that attribute for the current node." > > .. : The string .. is an abbreviation for parent::node(). I would also add "It identifies the parent element of the current node." > > > * : A * matches all of the element children of the context node. You've already gotten a comment about attributes, but this is really tricky since it identifies a set of elements/attributes at many levels if you use it within a more complex expression or path. I would say instead: "An *, by itself, identifies all of the element children of the context node. It can also be used with @ to identify all attributes, or in other expressions as a general wildcard for 'all'." > > . : The . character is an abbreviation for self::node(). I would also add: "It identifies the current node." self::node() may be perfectly clear to the knowing, but it definitely is not to a novice. > > / : the / character at the start of a location path makes it > absolute, i.e. starting at the root node of a document. > > > // : The string // is an abbreviation for descendant-or-self::node(). I would add: "This identifies the current node, its children, and all descendants." > > ATTRIBUTE VALUE TEMPLATE: An expression can be used by > surrounding the expression with curly braces ({}). The > attribute value template is instantiated by replacing the > expression together with surrounding curly braces by the > result of evaluating the expression and converting the > resulting object to a string as if by a call to the string > function. Plain English version please someone???? How about this? "This is an expression surrounded by curly braces ({}) and used in a template as the value of an attribute. Attribute value templates allow you to assign a value to an attribute in the output using an expression, rather than a fixed value. The final value output for the attribute is determined by evaluting the expression, changing it to a string and replacing both the expression and the curly braces with the string." > > > AXIS: There are 13 axes defined in XPath: > > child, descendant, parent, ancestor, following-sibling, > preceding-sibling, following, following, preceding, > attribute, namespace, descendant-or-self, > ancestor-or-self. Each specifies a 'direction' relative to > the context node and can be used to provide an initial > selection of nodes. > > > CONTEXT NODE: > The context node is where XPATH addressing starts. > > > CURRENT NODE: When a template is instantiated, it is always > instantiated with respect to a current node and a current > node list. Plain English version please?? "The current node is the element, or node in a list of elements, that is currently being 'styled' (maybe processed would be a better word here) by a template. Current nodes may also be attributes or namespaces rather than elements." > > DOCUMENT ORDER: Normally top down, left to right traversal > of the document tree. The ancestor and preceding axes use > reverse document order and the attribute and namespace axes > are unordered. If parentheses are used for grouping, you > will always get forward document order. I wouldn't personally think of this as top-to-bottom, left-to-right or right-to-left -- I think of it as start to end, in written order. This also helps since it doesn't assume a Western direction pattern and most people can related to 'written order'. > > EXPRESSION: Expressions are used in XSLT for a variety of > purposes including: > > selecting nodes for processing; > specifying conditions for different ways of processing a node; > generating text to be inserted in the result tree. > > > LOCATION PATH: There are two kinds of location path: > relative location paths and absolute location paths. A > location path describes how a specific part of a document > may be found. Location paths describe the address of one > node with respect to another. A location path is composed of > a series of steps. Each step consists of an axis, a node > test and optional predicates . The syntax for a location > step is the axis name and node test separated by a double > colon, followed by zero or more expressions each in square > brackets. For example, in child::para[position()=1], child > is the name of the axis, para is the node test and > [position()=1] is a predicate. > > NODE TEST: A node test identifies a type of node in the > document, the simplest type being an element name. I would change this to: "A node test identifies nodes in the document that meet the criteria of the test. The simplest type of test is nodes that match an element name." > > NODE TYPE: There are seven node types: element, attribute, > text, processing instruction, comment, namespace, and > root. These are: the elements, attributes, text, processing > instructions, and comments in a document. Namespace nodes > represent the namespaces used in the document. The root node > is the root of the document. In every XML document, there is > exactly one root node, which the node that contains the > (optional) prologue and the document element. > > > PREDICATE: A predicate occurs in square brackets after the > node test. For example, para selects all of the para > children of the context node. Adding the predicate [3]: > para[3] selects only the third para element. XPATH section > 4 and XSLT section 12 enumerate all the functions. I would add: "for use in predicates" to the last sentence. The definition doesn't mention functions anywhere except the last sentence and it is not clear what the relationship is -- at least it could be confusing to someone new. > > ROOT NODE: The root node is the root of the document tree. > > RESULT TREE FRAGMENT: Some part of the output resulting from > triggering a template. > > > RTF: See Result Tree Fragment > > > > STEP: Steps may be joined with slashes to form a complete > location path. > > XPATH: XPath is a language that describes how to locate > specific elements (and attributes, processing instructions, > etc.) in a document. It allows you to locate specific > content within an XML document. XPATH treats an XML document > as a logical ordered tree, > > > XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list > XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: XSLT/XPATH jargon, Kay Michael | Thread | Re: XSLT/XPATH jargon, David_Marston |
Re: Re-ordering elements, John Robert Gardner | Date | Re: XSLT/XPATH jargon, David_Marston |
Month |