XSLT 2.0 and XPath 2.0 Programmer's Reference, 4th Edition (503 page)

BOOK: XSLT 2.0 and XPath 2.0 Programmer's Reference, 4th Edition
12.9Mb size Format: txt, pdf, ePub

In the formal rules for evaluating a pattern, the steps in a
RelativePathPattern
are evaluated from left to right, and the choice of axis determines whether this step looks at the children or the attributes of the nodes found in the previous step.

Looking at it informally, it is simplest to think of the axis specifier as simply a way of saying what kind of node is required.

  • If the child axis is used and the
    NodeTest
    is a
    NameTest
    (for example,
    title
    ,
    *
    , or
    svg:*
    ) then we are looking for an element node.
  • If the child axis is used and the
    NodeTest
    is a
    KindTest
    (for example,
    comment()
    or
    text()
    ), then we are looking for that kind of node. If the
    NodeTest
    is
    node()
    , then we are looking for any node on the child axis: specifically, elements, text nodes, comments, or processing instructions. Note that the pattern
    node()
    , which is short for
    child::node()
    , will not match document nodes, attributes, or namespace nodes, because these nodes never appear as the child of another node.

Other books

A Day to Pick Your Own Cotton by Michael Phillips
02_Groom of Her Own by Irene Hannon
A Radical Arrangement by Ashford, Jane
Los cuentos de Mamá Oca by Charles Perrault
Be My Love by J. C. McKenzie
Domain of the Dead by Iain McKinnon, David Moody, Travis Adkins
Tuesdays With Morrie by Mitch Albom