<?xml version="1.0" encoding="iso-8859-1"?>
<?xml-stylesheet href="../make-menu.xsl" type="text/xsl"?><html>
   <head>
      <this-is section="expressions" page="union" subpage=""/>
      <!--
           Generated at 2010-10-29T18:20:48.427+01:00--><title>Saxonica: XSLT and XQuery Processing: Union</title>
      <meta name="coverage" content="Worldwide"/>
      <meta name="copyright" content="Copyright Saxonica Ltd"/>
      <meta name="title" content="Saxonica: XSLT and XQuery Processing: Union"/>
      <meta name="robots" content="noindex,nofollow"/>
      <link rel="stylesheet" href="../saxondocs.css" type="text/css"/>
   </head>
   <body class="main">
      <h1>Union</h1>
      <p>The <code>|</code> operator was available in XPath 1.0; the keyword <code>union</code> has been
added in XPath 2.0 as a synonym, because it is familiar to SQL users.</p>
      <p>The expression <code>E1 union E2</code> selects all nodes that are in either <code>E1</code> or
 <code>E2</code> or both. Both expressions must return sequences of nodes. The results
are returned in document order. For example, <code>/book/(chapter | appendix)/sections</code> returns
all <code>section</code> elements within a <code>chapter</code> or <code>appendix</code> of the
selected <code>book</code> element.</p>
      <table width="100%">
         <tr>
            <td>
               <p align="right"><a class="nav" href="arithmetic.xml">Next</a></p>
            </td>
         </tr>
      </table>
   </body>
</html>