Expression structure overview

It can be difficult to follow some of the labyrinthine ways in which XPath rules include each other. Yet there is a major chain of rules for expressions (Expr{14}), as shown below. The order in which the following roles are linked (exclusively) to each other also indicates the order in which they are processed (so that, for example, '=' is evaluated after '<'):

{14} Expr           ... and ... or ... (adds nothing)
       |
 {21} OrExpr        ... and ...
					or
					...
        |
  {22} AndExpr    $a=$b
					and
					$y < $z ...
         |
   {23} EqualityExpr        $y < $z
					=
					$a < $b + $f * -2
          |
    {24} RelationalExpr               $a
					<
					$b + $f * -2
           |
     {25} AdditiveExpr                     $b
					+
					$f * -2
            |
      {26} MultiplicativeExpr                   $f
					*
					-2
             |
       {27} UnaryExpr                                -2
              |
        {18} UnionExpr    warning|chapter[9]/para     2
               |
         {19} PathExpr            chapter[9] ...

Get XML Companion, The, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.