<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
<book>
  <bookinfo>
    <title>XMLmind XML Editor - User's Guide</title>

    <author>
      <firstname>Hussein</firstname>

      <surname>Shafie</surname>

      <affiliation>
        <orgname>Pixware</orgname>

        <address><street>91 rue Gambetta</street>,
<postcode>78120</postcode> <city>Rambouillet</city>,
<country>France</country>,
Phone: <phone>+33 (0)1 30 59 81 44</phone>,
Web: <otheraddr><ulink url="http://www.xmlmind.com/xmleditor/">www.xmlmind.com/xmleditor</ulink></otheraddr>
Email: <email>xmleditor-support@xmlmind.com</email> (public mailing list)</address>
      </affiliation>
    </author>

    <pubdate>June 5, 2009</pubdate>

    <abstract>
      <para>This document is essentially a comprehensive tutorial about
      XMLmind XML Editor (XXE for short). It also contains installation
      instructions and information about the contents of the
      distribution.</para>
    </abstract>
  </bookinfo>

  <chapter id="install">
    <title>Install</title>

    <section id="installing_xxe">
      <title>Installing XXE</title>

      <section>
        <title>Requirements</title>

        <itemizedlist>
          <listitem>
            <para>Sun or Apple <trademark>Java</trademark> runtime 1.5 or
            above.</para>
          </listitem>

          <listitem>
            <para>At least 512Mb of memory and a 1GHz CPU.</para>
          </listitem>

          <listitem>
            <para>60Mb of free disk space, 120Mb for a self-contained
            distribution which includes a <trademark>Java</trademark> 1.6
            runtime.</para>
          </listitem>
        </itemizedlist>

        <para>XXE is officially supported on Windows 2000/XP/Vista, on Linux
        2.6 and on Mac OS X 10.4 (Tiger) and 10.5 (Leopard). It is possible to
        use it on other <trademark>Java</trademark> 1.5+ platforms (e.g.
        Solaris), but without support from XMLmind.</para>

        <para>XXE has been tested with:</para>

        <itemizedlist>
          <listitem>
            <para><ulink url="http://java.sun.com/j2se/">Sun
            <trademark>Java</trademark></ulink> runtime 1.5+ (up to 1.6.0_13)
            under Windows 2000, XP, Vista, openSUSE Linux 9.3, 10.2, Ubuntu
            Linux 7.04 (Feisty Fawn).</para>
          </listitem>

          <listitem>
            <para>Mac OS X 10.4.11 (Tiger) or 10.5.7 (Leopard) and the latest
            <trademark>Java</trademark> 1.5 runtime (and also with optional
            <trademark>Java</trademark> 1.6 runtime).</para>
          </listitem>

          <listitem>
            <para><ulink url="http://httpd.apache.org/">Apache HTTP
            server</ulink> 2.2.3 and its <literal>mod_dav</literal> WebDAV
            server.</para>

            <para>Also tested against <literal>mod_dav_svn</literal> 1.4
            (<ulink url="http://subversion.tigris.org/">Subversion</ulink>)
            with autoversioning turned on.</para>
          </listitem>

          <listitem>
            <para>The <ulink url="http://vsftpd.beasts.org/">vsftpd FTP
            server</ulink> 2.0.5, with both the FTP and FTPS protocols.</para>
          </listitem>

          <listitem>
            <para>The <ulink url="http://www.openssh.com/">OpenSSH SFTP
            server</ulink> 4.4p1.</para>
          </listitem>

          <listitem>
            <para>As an applet, XXE has been tested against:
            Internet Explorer 6/Windows XP, Firefox 3/Windows XP,
            Internet Explorer 8/Vista, Firefox 3/Linux.</para>
          </listitem>
        </itemizedlist>
      </section>

      <section>
        <title>Install on Linux (or <emphasis>manual</emphasis> install on the
        Mac)</title>

        <tip>
          <para>On the Mac, it is strongly recommended to download and install
          the auto-installable <literal>.dmg</literal> file.</para>
        </tip>

        <procedure>
          <step>
            <para>Make sure that the <trademark>Java</trademark>
            <filename>bin/</filename> directory is referenced in the $PATH
            and, at the same time, check that the <trademark>Java</trademark>
            runtime in the $PATH has the right version:</para>

            <programlisting>$ java -version
java version "1.6.0_13"
Java(TM) SE Runtime Environment (build 1.6.0_13-b03)
Java HotSpot(TM) Server VM (build 11.3-b02, mixed mode)</programlisting>
          </step>

          <step>
            <para>Unpack the XXE distribution inside any directory you
            want:</para>

            <programlisting>$ cd
$ tar zxvf xxe-perso-4_4_0.tar.gz
$ ls xxe-perso-4_4_0
addon/
bin/
demo/
doc/</programlisting>
          </step>

          <step>
            <para>XXE is intended to be used directly from the
            <filename>xxe-perso-4_4_0/</filename> directory. That is, you can
            start XXE by simply executing:</para>

            <programlisting>$ xxe-perso-4_4_0/bin/xxe &amp;</programlisting>

            <para>After that, you may want to add
            <filename>xxe-perso-4_4_0/bin/</filename> to your $PATH.</para>
          </step>
        </procedure>
      </section>

      <section>
        <title><emphasis>Manual</emphasis> install on Windows</title>

        <tip>
          <para>On Windows, it is strongly recommended to download and install
          one of the two auto-installable <filename>setup.exe</filename>
          files.</para>
        </tip>

        <procedure>
          <step>
            <para>Make sure that you have a <trademark>Java</trademark> 1.5+
            runtime installed on your machine. To check this, open a command
            window and type "<literal>java -version</literal>" followed by
            <keysym>Enter</keysym>. You should get something looking like
            this:</para>

            <programlisting>C:\&gt; java -version
java version "1.6.0_05"
Java(TM) SE Runtime Environment (build 1.6.0_05-b13)
Java HotSpot(TM) Client VM (build 10.0-b19, mixed mode, sharing)</programlisting>
          </step>

          <step>
            <para>Use a tool like <ulink
            url="http://www.winzip.com/">WinZip</ulink>, <ulink
            url="http://www.7-zip.org/">7-Zip</ulink> or <ulink
            url="http://www.info-zip.org/">Info-Zip</ulink> <footnote>
                <para>Note that Windows XP has built-in support for
                <literal>.zip</literal> archives.</para>
              </footnote> to unzip the XXE distribution inside any directory
            you want:</para>

            <programlisting>C:\&gt; mkdir XMLmind
C:\&gt; cd XMLmind
C:\XMLmind&gt; unzip xxe-perso-4_4_0.zip
C:\XMLmind&gt; dir xxe-perso-4_4_0
... &lt;DIR&gt; addon
... &lt;DIR&gt; bin
... &lt;DIR&gt; demo
... &lt;DIR&gt; doc</programlisting>
          </step>

          <step>
            <para>XXE is intended to be used directly from the
            <filename>xxe-perso-4_4_0/</filename> directory. That is, you can
            start XXE by simply executing:</para>

            <programlisting>C:\XMLmind&gt; xxe-perso-4_4_0\bin\xxe.exe</programlisting>

            <para>After that, you may want to add a shortcut to
            "<filename>C:\XMLmind\xxe-perso-4_4_0\bin\xxe.exe</filename>" on
            your desktop.</para>

            <para>Note that the <filename>bin</filename> directory contains
            not only <filename>xxe.exe</filename>, but also an equivalent
            <filename>xxe.bat</filename> which may be handy if you intend to
            customize the way XXE is started.</para>
          </step>
        </procedure>
      </section>
    </section>

    <section id="content_of_install_dir">
      <title>Contents of the installation directory</title>

      <variablelist>
        <varlistentry>
          <term>bin/</term>

          <listitem>
            <para>Contains XXE code (<literal>.jar</literal> files) and many
            scripts used to start XXE and its associated utilities.</para>
          </listitem>
        </varlistentry>

        <varlistentry>
          <term>bin/xxe, xxe.bat</term>

          <listitem>
            <para>Scripts used to start XXE. Use <filename>xxe</filename> on
            any Unix system. Use <filename>xxe.bat</filename> on
            Windows.</para>
          </listitem>
        </varlistentry>

        <varlistentry>
          <term>bin/xxe.exe, xxe.jstart</term>

          <listitem>
            <para>Only when installing XXE on Windows using any of the
            <filename><replaceable>*</replaceable>setup<replaceable>*</replaceable>.exe</filename>
            distributions. File <filename>xxe.exe</filename> is XXE launcher
            and <filename>xxe.jstart</filename> is its (plain text, UTF-8
            encoded) associated parameter file.</para>
          </listitem>
        </varlistentry>

        <varlistentry>
          <term>bin/deploywebstart, deploywebstart.bat</term>

          <listitem>
            <para>Scripts used to generate a <trademark>Java</trademark> Web
            Start configuration (<literal>.jnlp</literal> file, signed jars,
            etc) from a possibly customized XXE distribution. Use
            <filename>deploywebstart</filename> on any Unix system. Use
            <filename>deploywebstart.bat</filename> on Windows.</para>

            <para>The <filename>deploywebstart</filename> command-line tool is
            documented in the <olink targetdoc="configure"
            targetptr="deploy_webstart_tool"></olink>.</para>
          </listitem>
        </varlistentry>

        <varlistentry>
          <term>bin/xmltool, xmltool.bat</term>

          <listitem>
            <para>Scripts used to run <command>xmltool</command>. See
            <citetitle>The xmltool command-line utility</citetitle> for more
            information about this tool.</para>
          </listitem>
        </varlistentry>

        <varlistentry>
          <term>bin/csscheck, csscheck.bat</term>

          <listitem>
            <para>Scripts allowing to check the syntax of CSS style sheets
            written for XXE.</para>
          </listitem>
        </varlistentry>

        <varlistentry>
          <term>bin/convertdoc, convertdoc.bat</term>

          <listitem>
            <para>Scripts used to run <command>convertdoc</command>. This tool
            allows to execute XXE process commands from the command line,
            exactly as if these process commands were executed from
            XXE.</para>

            <para>See <olink targetdoc="commands"
            targetptr="convertdoc"></olink> for more information about this
            tool.</para>
          </listitem>
        </varlistentry>

        <varlistentry>
          <term>bin/*.jar</term>

          <listitem>
            <para>All the (non-system) <trademark>Java</trademark> class
            libraries needed to run XXE:</para>

            <itemizedlist>
              <listitem>
                <para><filename>xxe.jar</filename> contain the code of
                XXE.</para>

                <para><filename>xxe_help.jar</filename> contains the online
                help of XXE.</para>

                <para><filename>xsc.jar</filename> contains the code of the
                spell checker engine developed by XMLmind.</para>
              </listitem>

              <listitem>
                <para><filename>jh.jar</filename> is the standard
                <trademark>Java</trademark> help engine.</para>

                <para><filename>xerces.jar</filename> contains <ulink
                url="http://xerces.apache.org/xerces2-j/">Xerces</ulink> 2.9.1
                XML parser. (The version included in the
                <trademark>Java</trademark> runtime 1.6 has bugs which have
                been fixed in bundled version.)</para>

                <para><filename>resolver.jar</filename> contains <ulink
                url="http://xml.apache.org/commons/">Apache XML Commons
                Resolver</ulink> which implements catalog-based entity and URI
                resolution.</para>

                <para>Substantial parts of <filename>xsdregex.jar</filename>,
                James Clark's XSD to Java Regular Expression Translator, have
                been directly added to <filename>xxe.jar</filename> (which is
                why file <filename>xsdregex.jar</filename> is not included in
                the distribution). Download original package from <ulink
                url="http://www.thaiopensource.com/download/">http://www.thaiopensource.com/download/</ulink>.</para>

                <para>Package <literal>com.jclark.xsl.expr</literal> contains
                the implementation of XPath 1.0 used by XT, James Clark's XSLT
                engine. A modified version of this package, renamed
                <literal>com.xmlmind.xmledit.xpath</literal>, has been
                directly added to <filename>xxe.jar</filename> (which is why
                file <filename>xt.jar</filename> is not included in the
                distribution). Download full XT from <ulink
                url="http://www.jclark.com/xml/xt-old.html">http://www.jclark.com/xml/xt-old.html</ulink>
                or from <ulink
                url="http://www.blnz.com/xt/index.html">http://www.blnz.com/xt/index.html</ulink>.</para>

                <para><filename>relaxng.jar</filename> is <ulink
                url="http://www.thaiopensource.com/relaxng/jing.html">Jing</ulink>
                version 20030619, James Clark's RELAX NG validator, slightly
                modified for use in XXE. The details of the modifications are
                found in <filename>relaxng.README</filename>.</para>

                <para><filename>saxon.jar</filename> is Michael H. Kay's XSLT
                1 engine. See <ulink
                url="http://saxon.sourceforge.net/">http://saxon.sourceforge.net/</ulink>.</para>

                <para>These <emphasis>excellent</emphasis> packages have
                <emphasis>not</emphasis> been developed by XMLmind. Copyright
                information is contained in the corresponding
                <literal>.LICENSE</literal> file. Read the corresponding
                <literal>.README</literal> file to have more details about
                these packages.</para>
              </listitem>
            </itemizedlist>
          </listitem>
        </varlistentry>

        <varlistentry>
          <term>bin/legal/, legal.txt</term>

          <listitem>
            <para>Contains legal information about XXE and about third-party
            components used in XXE.</para>
          </listitem>
        </varlistentry>

        <varlistentry>
          <term>bin/icons/</term>

          <listitem>
            <para>Contains desktop icons for XXE.</para>
          </listitem>
        </varlistentry>

        <varlistentry>
          <term>bin/mac/</term>

          <listitem>
            <para>Contains files (e.g. <filename>Info.plist</filename>) used
            on the Mac to create <literal>XMLEditor.app</literal> from a
            <literal>.zip</literal> or a <literal>.tar.gz</literal>
            distribution.</para>
          </listitem>
        </varlistentry>

        <varlistentry>
          <term>addon/</term>

          <listitem>
            <para>The <filename>addon/</filename> directory is the place where
            XXE finds its extensions, whatever its type: configurations,
            plug-ins, translations to languages other than English,
            spell-checker dictionaries.</para>

            <para>This <filename>addon/</filename> directory is recursively
            scanned by XXE at startup time. Therefore, feel free to organize
            it as you want.</para>
          </listitem>
        </varlistentry>

        <varlistentry>
          <term>addon/config/</term>

          <listitem>
            <para>Contains configuration files for a few XML applications:
            DocBook, XHTML, W3C XML Schema, etc.</para>

            <para>The content of a configuration file, which specifies a
            customization of XXE for a specific XML application, is described
            in detail in <olink targetdoc="configure"
            targetptr="configure"></olink>.</para>
          </listitem>
        </varlistentry>

        <varlistentry>
          <term>addon/spell/</term>

          <listitem>
            <para>Contains the bundled dictionaries used by the spell-checker.
            A dictionary is a file whose name is
            <replaceable>LL</replaceable><literal>.dar</literal>, where
            <replaceable>LL</replaceable> is an ISO code for a
            language.</para>

            <para>The distribution of XXE only contains an English dictionary
            (with CA, GB, US variants). Additional dictionaries, German,
            French, Spanish, can be downloaded and installed using <menuchoice>
                <guimenu>Options</guimenu>

                <guimenuitem>Install Add-ons</guimenuitem>
              </menuchoice>.</para>
          </listitem>
        </varlistentry>

        <varlistentry>
          <term>doc/</term>

          <listitem>
            <para>Contains XMLmind XML Editor documentation in HTML and PDF
            (Acrobat) formats.</para>

            <para>Note that:</para>

            <variablelist>
              <varlistentry>
                <term>doc/user/</term>

                <listitem>
                  <para>Contains this User's Guide in HTML and PDF (Acrobat)
                  formats.</para>

                  <para>The source of the User's Guide is also available in
                  DocBook format (<filename>userguide.xml</filename>) in case
                  you want to open it in XXE.</para>
                </listitem>
              </varlistentry>
            </variablelist>
          </listitem>
        </varlistentry>

        <varlistentry>
          <term>demo/</term>

          <listitem>
            <para>Contains XML documents that can be opened in XXE to demo
            some of its features.</para>
          </listitem>
        </varlistentry>
      </variablelist>
    </section>

    <section id="acknowledgments">
      <title>Acknowledgments</title>

      <para>On Windows, XMLmind XML Editor installer (i.e.
      <filename><replaceable>*</replaceable>setup<replaceable>*</replaceable>.exe</filename>)
      is built using <productname>Inno Setup</productname> by <ulink
      url="http://www.jrsoftware.org/">Jordan Russell's software</ulink>.
      XMLmind highly recommends this excellent and free-to-use tool.</para>
    </section>
  </chapter>

  <chapter id="tutorial_basics">
    <title>Tutorial: basics</title>

    <note>
      <title>What you'll not learn by reading this tutorial</title>

      <para>This tutorial will <emphasis>not</emphasis> teach you how to use
      the most nifty features of XXE:</para>

      <itemizedlist>
        <listitem>
          <para>how to use the <keycap>Ins</keycap> key or the
          <keycap>Enter</keycap> key to quickly insert text nodes and
          elements,</para>
        </listitem>

        <listitem>
          <para>how to change an image displayed in the document view by
          dragging and dropping a graphics file onto it,</para>
        </listitem>

        <listitem>
          <para>how to quickly insert or move columns by using the table
          editor,</para>
        </listitem>

        <listitem>
          <para>etc.</para>
        </listitem>
      </itemizedlist>

      <para>Most of these smart tricks are listed in the chapter <xref
      endterm="being_productive_title" linkend="being_productive" />. Other
      features are specific to the type of the document being edited (XHTML,
      DocBook, DITA, etc), and are therefore documented in the online help
      which comes with the XXE configuration associated to the document
      type.</para>

      <para>No, this tutorial will just teach you the <emphasis>most basic
      way</emphasis> to do things. On the other hand, what you'll learn here
      will work for any type of document, and not only for XHTML.</para>
    </note>

    <para>This tutorial assumes that the reader has a minimal knowledge of XML
    (that is, the reader knows what is an element, an attribute, etc) and a
    minimal knowledge of HTML or XHTML (that is, the reader knows that
    <sgmltag class="element">p</sgmltag> is the tag for a paragraph, that
    <sgmltag class="element">ul</sgmltag> is a list, etc).</para>

    <para>It is recommended that, using XXE, the reader repeats each action
    described in this tutorial. (On Mac, use the <keysym>Command</keysym> key
    instead of the <keysym>Control</keysym> key, except for <keycombo>
        <keycap>Ctrl</keycap>

        <keysym>Tab</keysym>
      </keycombo> and <keycombo>
        <keycap>Ctrl</keycap>

        <keysym>Space</keysym>
      </keycombo>.)</para>

    <section id="starting_xxe">
      <title>Starting XXE</title>

      <itemizedlist>
        <listitem>
          <para>If you have installed an auto-installable Windows distribution
          (<filename>xxe-perso-4_4_0-setup.exe</filename>), XXE can be started
          by double-clicking on the icon of <filename>xxe.exe</filename> or by
          using the "<guimenuitem>XMLmind XML Editor</guimenuitem>" shortcut
          added to the <guimenu>Start</guimenu> menu.</para>

          <para>If you have installed a zipped distribution, XXE can be
          started by typing <filename>xxe</filename> (or
          <filename>xxe.bat</filename>) from the command prompt, optionally
          followed by the name of one or several XML documents.</para>

          <para>Example:</para>

          <programlisting>C&gt; xxe C:\xxe-perso-4_4_0\doc\user\userguide.xml</programlisting>
        </listitem>

        <listitem>
          <para>On Unix, XXE can be started by typing <filename>xxe</filename>
          from an xterm, optionally followed by the name of one or several XML
          documents.</para>

          <para>Example:</para>

          <programlisting>$ xxe &amp;</programlisting>
        </listitem>
      </itemizedlist>
    </section>

    <section id="new_document">
      <title>Creating a new document</title>

      <para>Use <menuchoice>
          <guimenu>File</guimenu>

          <guimenuitem>New</guimenuitem>
        </menuchoice> and choose a document template from the following dialog
      box.</para>

      <figure>
        <title>The <menuchoice>
            <guimenu>File</guimenu>

            <guisubmenu>New</guisubmenu>
          </menuchoice> dialog box</title>

        <mediaobject>
          <imageobject>
            <imagedata fileref="images/new00.gif" format="GIF" />
          </imageobject>
        </mediaobject>
      </figure>

      <para>In this tutorial, we have chosen to create a XHTML page conforming
      to the strict DTD.</para>

      <para>The newly created document (<filename>Untitled.html</filename>)
      looks like this:</para>

      <mediaobject>
        <imageobject>
          <imagedata fileref="images/new01.gif" format="GIF" />
        </imageobject>
      </mediaobject>

      <para>The ``blobs'' are placeholders for text. Click on the first
      placeholder and type the title of your XHTML page. Click on the second
      placeholder and type a few words.</para>

      <mediaobject>
        <imageobject>
          <imagedata fileref="images/new02.gif" format="GIF" />
        </imageobject>
      </mediaobject>

      <para>Click again anywhere on the title and then anywhere in the first
      paragraph. You'll notice that, at the top of the window, just below the
      tool bar icons, the <firstterm>node path bar</firstterm> changes its
      label.</para>

      <mediaobject>
        <imageobject>
          <imagedata fileref="images/new03.gif" format="GIF" />
        </imageobject>
      </mediaobject>

      <para>The node path bar shows where the <firstterm>caret</firstterm>
      (also called insertion cursor) is.</para>

      <para>The node path bar does so by displaying the name of the node
      (anonymous text node <literal>#text</literal>) containing the caret
      preceded by the name of each of its ancestors elements in the
      containment hierarchy (element <sgmltag class="element">p</sgmltag>
      contained in element <sgmltag class="element">body</sgmltag> contained
      in element <sgmltag class="element">html</sgmltag>).</para>
    </section>

    <section id="insert_element">
      <title>Inserting elements</title>

      <para>In this section, we'll get familiar with the following
      commands:</para>

      <orderedlist numeration="arabic">
        <listitem>
          <para>Insert before element</para>
        </listitem>

        <listitem>
          <para>Insert inside element, at caret location</para>
        </listitem>

        <listitem>
          <para>Insert after element</para>
        </listitem>
      </orderedlist>

      <para>These commands are accessible using the <guimenu>Edit</guimenu>
      menu bar menu, using the <guilabel>Edit</guilabel> tool ``tab'' or using
      keyboard shortcuts, but in this tutorial we'll limit ourselves to using
      the <guimenu>Edit</guimenu> popup menu. Therefore the notation
      <menuchoice>
          <guimenu>Edit</guimenu>

          <guimenuitem>Insert</guimenuitem>
        </menuchoice> means "click anywhere in the document view using the
      right mouse button and select menu item
      <guimenuitem>Insert</guimenuitem> in the <guimenu>Edit</guimenu> popup
      menu".</para>

      <figure>
        <title>The Edit popup menu</title>

        <mediaobject>
          <imageobject>
            <imagedata fileref="images/insert00.gif" format="GIF" />
          </imageobject>
        </mediaobject>
      </figure>

      <para>Click anywhere inside the paragraph and execute <menuchoice>
          <guimenu>Edit</guimenu>

          <guimenuitem>Insert Before</guimenuitem>
        </menuchoice>. The keyboard focus is given to the
      <guilabel>Edit</guilabel> tool. This pane now lists all the elements you
      can insert before a <sgmltag class="element">p</sgmltag> and therefore,
      is ready to use.</para>

      <figure>
        <title>The <guilabel>Edit</guilabel> tool listing all elements you can
        insert before a <sgmltag class="element">p</sgmltag></title>

        <mediaobject>
          <imageobject>
            <imagedata fileref="images/insert01.gif" format="GIF" />
          </imageobject>
        </mediaobject>
      </figure>

      <para>Select <sgmltag class="element">h1</sgmltag> from the list (a
      single click on the list item is sufficient). The newly inserted element
      has a red border around it. Do not care about that, just type the text
      of the heading and the red border will go away.</para>

      <para>Click inside the <sgmltag class="element">p</sgmltag> before a
      word and execute <menuchoice>
          <guimenu>Edit</guimenu>

          <guimenuitem>Insert</guimenuitem>
        </menuchoice>, the same element chooser dialog pops up listing all the
      inline elements you can insert inside a <sgmltag
      class="element">p</sgmltag>. Select <sgmltag
      class="element">strong</sgmltag> from the list and type a few words in
      bold font.</para>

      <para>Your document should look like this:</para>

      <mediaobject>
        <imageobject>
          <imagedata fileref="images/insert02.gif" format="GIF" />
        </imageobject>
      </mediaobject>

      <para>This time, use <menuchoice>
          <guimenu>Edit</guimenu>

          <guimenuitem>Insert After</guimenuitem>
        </menuchoice> and add a <sgmltag class="element">ul</sgmltag>
      (unordered list) after the <sgmltag class="element">p</sgmltag>. Type
      the text of the first list item (<sgmltag
      class="element">li</sgmltag>).</para>

      <para>If you are in the <sgmltag class="element">strong</sgmltag>
      element -- check it with the node path bar -- click in the <sgmltag
      class="element">p</sgmltag> outside the bold words because inserting an
      <sgmltag class="element">ul</sgmltag> inside a <sgmltag
      class="element">p</sgmltag> after a <sgmltag
      class="element">strong</sgmltag> is not allowed in XHTML.</para>

      <mediaobject>
        <imageobject>
          <imagedata fileref="images/insert03.gif" format="GIF" />
        </imageobject>
      </mediaobject>

      <para>Click to get rid of the red border, then using what you have
      learned, add two more <sgmltag class="element">li</sgmltag>s: one before
      the first <sgmltag class="element">li</sgmltag> you have created, the
      second after it.</para>

      <mediaobject>
        <imageobject>
          <imagedata fileref="images/insert04.gif" format="GIF" />
        </imageobject>
      </mediaobject>
    </section>

    <section id="select_element">
      <title>Selecting elements</title>

      <para>Editing commands are applied to the selection.</para>

      <para>XXE supports three types of selection:</para>

      <itemizedlist>
        <listitem>
          <para>The text selection, found in all text editors and word
          processors.</para>
        </listitem>

        <listitem>
          <para>The node selection, which can contain one or several
          nodes.</para>
        </listitem>

        <listitem>
          <para>The implicit element selection.</para>
        </listitem>
      </itemizedlist>

      <para>Some commands can be applied to any type of selection, for
      example: <menuchoice>
          <guimenu>Edit</guimenu>

          <guimenuitem>Convert</guimenuitem>
        </menuchoice>. Other are more restrictive, for example: <menuchoice>
          <guimenu>Edit</guimenu>

          <guimenuitem>Insert Before</guimenuitem>
        </menuchoice> can be applied to the implicit element selection or to
      an explicit single node selection.</para>

      <section>
        <title>The implicit element selection</title>

        <para>The element containing the caret is implicitly selected.
        Therefore you can apply commands to it without making any special
        effort.</para>

        <para>This is one of XXE's nicest features, even if it needs to be
        learned because it has no equivalent in the word processor
        world.</para>

        <para>In the first section of this tutorial, you have already used the
        implicit element selection to insert an <sgmltag
        class="element">h1</sgmltag> before the <sgmltag
        class="element">p</sgmltag> and an <sgmltag
        class="element">ul</sgmltag> after it.</para>
      </section>

      <section>
        <title>The text selection</title>

        <para>Selecting text in XXE is no different from selecting text in any
        text editor. Click in the middle of the <sgmltag
        class="element">h1</sgmltag> and drag the mouse across the document
        until the middle of the second <sgmltag class="element">li</sgmltag>
        is reached.</para>

        <mediaobject>
          <imageobject>
            <imagedata fileref="images/select00.gif" format="GIF" />
          </imageobject>
        </mediaobject>
      </section>

      <section>
        <title>The node selection</title>

        <section>
          <title>Most general method</title>

          <para>Now we want to add a <sgmltag class="element">pre</sgmltag>
          (preformatted text) after the <sgmltag
          class="element">ul</sgmltag>.</para>

          <para>We have learned that clicking inside the a <sgmltag
          class="element">li</sgmltag> implicitly selects it therefore we know
          how to add a new <sgmltag class="element">li</sgmltag> after this
          one but how to select its parent, the <sgmltag
          class="element">ul</sgmltag>, to add a <sgmltag
          class="element">pre</sgmltag> after it?</para>

          <para>For that we need to use <firstterm>explicit element
          selection</firstterm>. Click inside any <sgmltag
          class="element">li</sgmltag> and then click on the word <sgmltag
          class="element">ul</sgmltag> inside the node path bar.</para>

          <mediaobject>
            <imageobject>
              <imagedata fileref="images/select02.gif" format="GIF" />
            </imageobject>
          </mediaobject>

          <para>This explicitly selects the corresponding node in the document
          view.</para>

          <mediaobject>
            <imageobject>
              <imagedata fileref="images/select03.gif" format="GIF" />
            </imageobject>
          </mediaobject>

          <para>Note that explicitly selected nodes are drawn with a red
          border around them.</para>

          <para>Alternatively, click inside any <sgmltag
          class="element">li</sgmltag> and type <keycombo>
              <keycap>Ctrl</keycap>

              <keysym>Up</keysym>
            </keycombo> 3 times: first time to select the
          <literal>#text</literal> node, second time to select the <sgmltag
          class="element">li</sgmltag>, third time to select the <sgmltag
          class="element">ul</sgmltag>.</para>

          <para>Now that <sgmltag class="element">ul</sgmltag> is selected,
          use <menuchoice>
              <guimenu>Edit</guimenu>

              <guimenuitem>Insert After</guimenuitem>
            </menuchoice> to add a <sgmltag class="element">pre</sgmltag>
          after it.</para>

          <para>Type 2 lines of text in this <sgmltag
          class="element">pre</sgmltag>. Do not be worried by the ``carriage
          return icon'' always displayed by XXE if the last character of a
          <literal>#text</literal> node is a newline character.</para>

          <mediaobject>
            <imageobject>
              <imagedata fileref="images/select04.gif" format="GIF" />
            </imageobject>
          </mediaobject>
        </section>

        <section>
          <title>Directly selecting a node</title>

          <para>Clicking near some text moves the caret inside the text and no
          node is explicitly selected.</para>

          <para>Instead of simply clicking, try to
          <emphasis>Ctrl-click</emphasis> on the first <sgmltag
          class="element">p</sgmltag>. A <literal>#text</literal> node is
          explicitly selected and the node path bar tells you which
          one.</para>

          <para>Selecting a <literal>#text</literal> node is rarely what you
          want to do. You'll often need to Ctrl-click again without moving the
          mouse. This will select to parent of the selected
          <literal>#text</literal>, that is, the <sgmltag
          class="element">p</sgmltag>. Ctrl-clicking again without moving the
          mouse would select the parent of the <sgmltag
          class="element">p</sgmltag> which is a <sgmltag
          class="element">body</sgmltag> and so on. When doing a series of
          Ctrl-clicks, always look at the node path bar to know precisely
          where you are. Also, do not Ctrl-click several times too fast
          otherwise the editor will think you are double-clicking or
          triple-clicking and therefore, selecting elements that way would not
          work.</para>

          <para>Click on the first <sgmltag class="element">p</sgmltag> to
          cancel the selection because we are going to study another method to
          select it. Now try to Ctrl-click, not inside the text itself, but
          <emphasis>in the blank space at the right of the text</emphasis> of
          the first <sgmltag class="element">p</sgmltag>. Notice that one
          Ctrl-click is sufficient to directly select the whole <sgmltag
          class="element">p</sgmltag>.</para>

          <para>Similarly, you can directly select a node when a non-editable
          ``decor'' has been generated for it. For example, simply
          <emphasis>click on the bullet</emphasis> of a <sgmltag
          class="element">li</sgmltag> to select it. This type of non-editable
          decor is very common, for example: the image displayed for a figure,
          the number of a section, the border of a table, a node icon or
          element name in the tree view, etc.</para>
        </section>

        <section>
          <title>Selecting a node range</title>

          <para>What if you want to put first <sgmltag
          class="element">p</sgmltag> and <sgmltag
          class="element">ul</sgmltag> inside a <sgmltag
          class="element">blockquote</sgmltag>? The answer is select both of
          them first and then use <menuchoice>
              <guimenu>Edit</guimenu>

              <guimenuitem>Convert</guimenuitem>
            </menuchoice> (described below in this tutorial).</para>

          <para>With XXE it is possible to select a <emphasis>node
          range</emphasis>, that is, adjacent children of the same parent
          element.</para>

          <para>Select first <sgmltag class="element">p</sgmltag> using any of
          the methods described above.</para>

          <mediaobject>
            <imageobject>
              <imagedata fileref="images/select05.gif" format="GIF" />
            </imageobject>
          </mediaobject>

          <para>Then <emphasis>Ctrl+Shift-click</emphasis> anywhere on the
          <sgmltag class="element">ul</sgmltag>.</para>

          <mediaobject>
            <imageobject>
              <imagedata fileref="images/select06.gif" format="GIF" />
            </imageobject>
          </mediaobject>

          <para>Note that extending the node selection is easy because you do
          not have to be precise. The reason is that there is no ambiguity
          about what to select: a <literal>#text</literal> or a <sgmltag
          class="element">li</sgmltag> is not a sibling of first <sgmltag
          class="element">p</sgmltag>, only the <sgmltag
          class="element">ul</sgmltag> is a sibling of first <sgmltag
          class="element">p</sgmltag>.</para>

          <para>Alternatively, you could have typed <keycap>Esc</keycap> then
          <keysym>Right</keysym> to extend node selection to the <sgmltag
          class="element">ul</sgmltag>.</para>

          <para>Now use <menuchoice>
              <guimenu>Edit</guimenu>

              <guimenuitem>Convert</guimenuitem>
            </menuchoice> and choose <sgmltag
          class="element">blockquote</sgmltag>.</para>

          <mediaobject>
            <imageobject>
              <imagedata fileref="images/select07.gif" format="GIF" />
            </imageobject>
          </mediaobject>
        </section>
      </section>
    </section>

    <section id="navigate_through_elements">
      <title>Navigating through elements</title>

      <section>
        <title>Using Tab to go from a <literal>#text</literal> to the other,
        just like in a form</title>

        <para>The <keysym>Tab</keysym> key may be used to move the caret from
        the current <literal>#text</literal> to the beginning of the next one.
        <keycombo>
            <keycap>Shift</keycap>

            <keysym>Tab</keysym>
          </keycombo> moves the caret from the current
        <literal>#text</literal> to the beginning of the previous one.</para>

        <para>Click on the <sgmltag class="element">title</sgmltag> and use
        <keysym>Tab</keysym> and <keycombo>
            <keycap>Shift</keycap>

            <keysym>Tab</keysym>
          </keycombo> to move the caret from one <literal>#text</literal> to
        the other.</para>

        <para>What if you really want to insert a <keysym>Tab</keysym>
        character into a <sgmltag class="element">pre</sgmltag> (or any
        element which allows <keysym>Tab</keysym> characters to be inserted in
        the text flow just as any ordinary character)? The answer is: type
        <keycombo>
            <keycap>Ctrl</keycap>

            <keysym>Tab</keysym>
          </keycombo> instead of <keysym>Tab</keysym>.</para>
      </section>

      <section>
        <title>XXE makes a difference between the end of a
        <literal>#text</literal> node and the beginning of the
        <literal>#text</literal> node next to it</title>

        <para>The simplest way to move the caret is of course to use the
        <keysym>Left</keysym> or <keysym>Right</keysym> arrow keys.</para>

        <para>Click on the first <sgmltag class="element">p</sgmltag> to the
        left of the <sgmltag class="element">strong</sgmltag> and press on the
        <keysym>Right</keysym> key to move the caret in the direction of the
        <sgmltag class="element">strong</sgmltag>.</para>

        <para>Just before reaching the <sgmltag
        class="element">strong</sgmltag> element, you'll notice that pressing
        on the <keysym>Right</keysym> key has caused no perceptible caret
        movement. Then after this ``dead'' <keysym>Right</keysym> key, the
        caret seems to move as expected.</para>

        <para>Go back to the left using the <keysym>Left</keysym> arrow and at
        the <sgmltag class="element">p</sgmltag>/<sgmltag
        class="element">strong</sgmltag> boundary, you'll notice a ``dead''
        <keysym>Left</keysym> key then the caret seems to move as
        expected.</para>

        <para>Note that on the <sgmltag class="element">p</sgmltag>/<sgmltag
        class="element">strong</sgmltag> boundary, the caret makes no visible
        movement but the node path bar displays different paths (<sgmltag
        class="element">html</sgmltag>·<sgmltag
        class="element">body</sgmltag>·<sgmltag
        class="element">p</sgmltag>·<literal>#text</literal> and <sgmltag
        class="element">html</sgmltag>·<sgmltag
        class="element">body</sgmltag>·<sgmltag
        class="element">p</sgmltag>·<sgmltag
        class="element">strong</sgmltag>·<literal>#text</literal>).</para>

        <para>Use menu command <menuchoice>
            <guimenu>View</guimenu>

            <guimenuitem>Add</guimenuitem>
          </menuchoice> to add a low-level, hierarchical, view called the tree
        view, at left of the styled view.</para>

        <figure>
          <title>Both tree and styled Views side by side</title>

          <mediaobject>
            <imageobject>
              <imagedata fileref="images/navigate00.gif" format="GIF" />
            </imageobject>
          </mediaobject>
        </figure>

        <para>Repeat what you have done with the <keysym>Right</keysym> and
        <keysym>Left</keysym> arrow keys and you'll notice that with the tree
        view, there is a visible caret movement from the end of the <sgmltag
        class="element">p</sgmltag>·<literal>#text</literal> to the beginning
        of the <sgmltag
        class="element">strong</sgmltag>·<literal>#text</literal> and
        vice-versa.</para>

        <para>Close the tree view by clicking anywhere inside it and by using
        <menuchoice>
            <guimenu>View</guimenu>

            <guimenuitem>Close</guimenuitem>
          </menuchoice>.</para>

        <para>This ``dead'' key behavior also occurs when using the
        <keycap>Del</keycap> and <keysym>Backspace</keysym> keys.</para>

        <para>Click on the first <sgmltag class="element">p</sgmltag> to the
        left of the <sgmltag class="element">strong</sgmltag> and type on the
        <keycap>Del</keycap> key several times. Notice what happens on the
        <sgmltag class="element">p</sgmltag>/<sgmltag
        class="element">strong</sgmltag> boundary. Then use <menuchoice>
            <guimenu>Edit</guimenu>

            <guimenuitem>Undo</guimenuitem>
          </menuchoice> as many times as needed to undo this typing.</para>

        <para>Click inside the <sgmltag class="element">strong</sgmltag> and
        type on the <keysym>Backspace</keysym> key several times. Notice what
        happens on the <sgmltag class="element">p</sgmltag>/<sgmltag
        class="element">strong</sgmltag> boundary. Then use <menuchoice>
            <guimenu>Edit</guimenu>

            <guimenuitem>Undo</guimenuitem>
          </menuchoice> as many times as needed to undo this typing.</para>
      </section>
    </section>

    <section id="copy_cut_paste">
      <title>Copy, cut, paste, delete</title>

      <section>
        <title>Copy, cut, paste, delete applied to the text selection</title>

        <para>The text selection is used not only to specify a range of
        characters but also a range of nodes and child elements contained in a
        common ancestor element.</para>

        <para>When applied to the text selection, the <menuchoice>
            <guimenu>Edit</guimenu>

            <guimenuitem>Copy</guimenuitem>
          </menuchoice> menu command copies all the characters and nodes in
        the specified range to the system clipboard. It is then possible to
        paste these characters and nodes in any other application including
        XXE itself.</para>

        <para>Select the characters displayed in bold font from the first
        <sgmltag class="element">p</sgmltag>, copy them to the clipboard using
        <menuchoice>
            <guimenu>Edit</guimenu>

            <guimenuitem>Copy</guimenuitem>
          </menuchoice>, click on the <sgmltag class="element">title</sgmltag>
        and paste the copied characters using the <menuchoice>
            <guimenu>Edit</guimenu>

            <guimenuitem>Paste</guimenuitem>
          </menuchoice>.</para>

        <mediaobject>
          <imageobject>
            <imagedata fileref="images/paste00.gif" format="GIF" />
          </imageobject>
        </mediaobject>

        <para>After copying the text selection, you'll notice that, near the
        <emphasis>Clipboard Content</emphasis> button, the status bar displays
        <literal>#text</literal>: a piece of text is stored in the
        clipboard.</para>

        <mediaobject>
          <imageobject>
            <imagedata fileref="images/paste01.gif" format="GIF" />
          </imageobject>
        </mediaobject>

        <para>Note that if you have not been precise when selecting text, the
        status bar may display <sgmltag class="element">strong</sgmltag> (you
        have copied the whole <sgmltag class="element">strong</sgmltag>
        element to the clipboard) or it may display <literal>[2]</literal>
        (you have copied 2 nodes to the clipboard: the <sgmltag
        class="element">strong</sgmltag> element and a piece of text next to
        it).</para>

        <para><menuchoice>
            <guimenu>Edit</guimenu>

            <guimenuitem>Cut</guimenuitem>
          </menuchoice> and <menuchoice>
            <guimenu>Edit</guimenu>

            <guimenuitem>Delete</guimenuitem>
          </menuchoice> basically work the same: they delete all the
        characters and nodes in the range specified by text selection. The
        only difference is that <menuchoice>
            <guimenu>Edit</guimenu>

            <guimenuitem>Cut</guimenuitem>
          </menuchoice> copies the characters and nodes in the specified range
        to the clipboard.</para>

        <para>Of course, elements and nodes are deleted only if the DTD or
        schema constraining the document allows to do so. In this is not the
        case, selected characters are removed from such elements and nodes and
        that's it.</para>
      </section>

      <section>
        <title>Copy, cut, paste, delete applied to the node selection</title>

        <para>The <guilabel>Copy</guilabel>, <guilabel>Cut</guilabel>,
        <guilabel>Paste</guilabel>, <guilabel>Delete</guilabel> commands can
        be applied to a node range or to the implicitly selected
        element.</para>

        <para>Two more <guilabel>Paste</guilabel> commands are available:
        <guilabel>Paste before</guilabel> and <guilabel>Paste
        after</guilabel>. These commands can only be applied to a single
        explicitly selected node or to the implicitly selected element.</para>

        <para>Select the first <sgmltag class="element">li</sgmltag> (implicit
        selection is fine for that). Use the <menuchoice>
            <guimenu>Edit</guimenu>

            <guimenuitem>Cut</guimenuitem>
          </menuchoice> to move it to the clipboard. Select the last <sgmltag
        class="element">li</sgmltag>. Use the <menuchoice>
            <guimenu>Edit</guimenu>

            <guimenuitem>Paste After</guimenuitem>
          </menuchoice> to paste the <sgmltag class="element">li</sgmltag>
        stored in the clipboard after the last <sgmltag
        class="element">li</sgmltag>.</para>

        <mediaobject>
          <imageobject>
            <imagedata fileref="images/paste02.gif" format="GIF" />
          </imageobject>
        </mediaobject>

        <para>After copying the first <sgmltag class="element">li</sgmltag>,
        you'll notice that the status bar displays <sgmltag
        class="element">li</sgmltag>: a list item element is stored in the
        clipboard.</para>

        <mediaobject>
          <imageobject>
            <imagedata fileref="images/paste03.gif" format="GIF" />
          </imageobject>
        </mediaobject>

        <para>Note that when the clipboard contains a node range, the status
        bar displays the number of nodes of the range. For example, copy all
        list items to the clipboard and you'll see:</para>

        <mediaobject>
          <imageobject>
            <imagedata fileref="images/paste04.gif" format="GIF" />
          </imageobject>
        </mediaobject>
      </section>
    </section>

    <section id="split_join_element">
      <title>Splitting and joining elements</title>

      <section>
        <title>Simple Split and Join</title>

        <para>Click in the middle of the <sgmltag
        class="element">strong</sgmltag> contained in the first <sgmltag
        class="element">p</sgmltag>. <emphasis>Type Enter</emphasis>. The
        <sgmltag class="element">p</sgmltag> is split in two parts, each part
        being a <sgmltag class="element">p</sgmltag>, as expected in any word
        processor.</para>

        <mediaobject>
          <imageobject>
            <imagedata fileref="images/split00.gif" format="GIF" />
          </imageobject>
        </mediaobject>

        <para>Now <emphasis>type <keysym>Backspace</keysym></emphasis> at the
        beginning of the second part. The two parts are joined to form our
        original single paragraph.</para>

        <para><emphasis>Typing <keysym>Del</keysym></emphasis> at the end of
        the first part would have given the same result.</para>

        <para>This is also a handy method for inserting elements. Type Enter
        at the end of the <sgmltag class="element">p</sgmltag>.</para>

        <mediaobject>
          <imageobject>
            <imagedata fileref="images/split01.gif" format="GIF" />
          </imageobject>
        </mediaobject>

        <para>Type some text in the newly created paragraph. Type Enter at the
        beginning of newly created <sgmltag class="element">p</sgmltag>. This
        creates another <sgmltag class="element">p</sgmltag> before it.</para>

        <mediaobject>
          <imageobject>
            <imagedata fileref="images/split02.gif" format="GIF" />
          </imageobject>
        </mediaobject>

        <para>Use <menuchoice>
            <guimenu>Edit</guimenu>

            <guimenuitem>Undo</guimenuitem>
          </menuchoice> three times to undo the creation of last two
        paragraphs.</para>
      </section>

      <section>
        <title>Split and Join generalized</title>

        <para>The <guilabel>Split</guilabel> and <guilabel>Join</guilabel>
        commands bound to <keysym>Enter</keysym>, <keysym>Backspace</keysym>
        or <keysym>Del</keysym> keystrokes are very handy but they can only be
        applied to paragraphs.</para>

        <para>What if we want to split the list in two parts in order to
        insert a paragraph before the second part?</para>

        <para>Move the caret at the beginning of the last list item and
        explicitly select the whole list using the node path bar.</para>

        <mediaobject>
          <imageobject>
            <imagedata fileref="images/split03.gif" format="GIF" />
          </imageobject>
        </mediaobject>

        <para>Now execute <menuchoice>
            <guimenu>Edit</guimenu>

            <guimenuitem>Split</guimenuitem>
          </menuchoice>. This command splits the explicitly selected element
        at caret position, which gives us two adjacent lists.</para>

        <mediaobject>
          <imageobject>
            <imagedata fileref="images/split04.gif" format="GIF" />
          </imageobject>
        </mediaobject>

        <para>The generalized form of Join is the inverse command of Split.
        The Join command joins the explicitly selected element to its
        <emphasis>preceding</emphasis> sibling, an element of same
        type.</para>

        <para>Note that the generalized form of Split and Join are the only
        commands that cannot be applied to the implicitly selected
        element.</para>

        <para>Explicitly select the second <sgmltag
        class="element">ul</sgmltag> and execute <menuchoice>
            <guimenu>Edit</guimenu>

            <guimenuitem>Join</guimenuitem>
          </menuchoice>. The two adjacent lists are now joined to form our
        original single list.</para>

        <para>Undo last Join because we really want to split the list in two
        parts.</para>

        <itemizedlist>
          <listitem>
            <para>Add a <sgmltag class="element">p</sgmltag> before the second
            <sgmltag class="element">ul</sgmltag>, type some text in
            it.</para>
          </listitem>

          <listitem>
            <para>Copy text "List item #1" (as usual, by dragging the mouse
            and by pressing Ctrl-C) and paste it (by pressing Ctrl-V) in the
            empty last <sgmltag class="element">li</sgmltag> of first <sgmltag
            class="element">ul</sgmltag>.</para>
          </listitem>

          <listitem>
            <para>Add another <sgmltag class="element">li</sgmltag> before the
            only <sgmltag class="element">li</sgmltag> of second <sgmltag
            class="element">ul</sgmltag>, for example by clicking in the
            <sgmltag class="element">li</sgmltag>, using <menuchoice>
                <guimenu>Edit</guimenu>

                <guimenuitem>Copy</guimenuitem>
              </menuchoice> and then using <menuchoice>
                <guimenu>Edit</guimenu>

                <guimenuitem>Paste Before</guimenuitem>
              </menuchoice>.</para>
          </listitem>

          <listitem>
            <para>Change all the text of the two list items of the second
            <sgmltag class="element">ul</sgmltag>, for example by selecting
            "List item #1" as usual and by typing a few words.</para>
          </listitem>
        </itemizedlist>

        <para>Our XHTML document now looks like this.</para>

        <mediaobject>
          <imageobject>
            <imagedata fileref="images/split05.gif" format="GIF" />
          </imageobject>
        </mediaobject>
      </section>
    </section>

    <section id="replace_element">
      <title>Replacing elements</title>

      <para>The <menuchoice>
          <guimenu>Edit</guimenu>

          <guimenuitem>Replace</guimenuitem>
        </menuchoice> command is equivalent to deleting the node selection or
      implicitly selected element and inserting a new element or
      <literal>#text</literal> which replaces the deleted nodes.</para>

      <para>This command is useful because it is often not allowed to delete
      the selection: doing so would create an invalid document.</para>

      <para>Select the <sgmltag class="element">pre</sgmltag>. Insert a
      <sgmltag class="element">table</sgmltag> after it.</para>

      <mediaobject>
        <imageobject>
          <imagedata fileref="images/replace00.gif" format="GIF" />
        </imageobject>
      </mediaobject>

      <para><guilabel>table(head_column)</guilabel>, ...,
      <guilabel>table(head_row_column)</guilabel> are preconfigured
      <firstterm>table templates</firstterm>. Most of the time, you'll choose
      one of these but for this exercise, we'll choose
      <guilabel>table</guilabel> which is the simplest table possible in
      XHTML.</para>

      <para>The table is created with a single <sgmltag
      class="element">tr</sgmltag> (row) containing a single <sgmltag
      class="element">th</sgmltag> (a ``heading'' cell where text is displayed
      using a bold font). This is often what you want for the skeleton of
      <sgmltag class="element">table</sgmltag> but not always.</para>

      <mediaobject>
        <imageobject>
          <imagedata fileref="images/replace01.gif" format="GIF" />
        </imageobject>
      </mediaobject>

      <para>This very simple table has no borders, even if the footprint of a
      cell is displayed using a very light gray. This would make the
      screenshots of this tutorial hard to read. Therefore we'll immediately
      add a border to this table.</para>

      <para>Select the <sgmltag class="element">table</sgmltag> (using the
      node path bar) if it is not already the case. The
      <guilabel>Attributes</guilabel> tool should be already displayed,
      otherwise click on the corresponding tab.</para>

      <para>First row of the attribute table is for attribute <sgmltag
      class="attribute">border</sgmltag>. Click inside the attribute value
      cell at the right of the attribute name cell containing <sgmltag
      class="attribute">border</sgmltag>, type <literal>1</literal> and press
      <keysym>Enter</keysym>.</para>

      <mediaobject>
        <imageobject>
          <imagedata fileref="images/replace02.gif" format="GIF" />
        </imageobject>
      </mediaobject>

      <para>Now the table has a nice black border. (We'll learn how to use the
      <guilabel>Attributes</guilabel> tool later in this tutorial.)</para>

      <para>Exercise:</para>

      <orderedlist numeration="arabic">
        <listitem>
          <para>Select the <sgmltag class="element">th</sgmltag> contained in
          the <sgmltag class="element">tr</sgmltag> (implicit selection is
          fine for that). Using <menuchoice>
              <guimenu>Edit</guimenu>

              <guimenuitem>Replace</guimenuitem>
            </menuchoice>, replace it with a <sgmltag
          class="element">td</sgmltag> (a plain cell).</para>
        </listitem>

        <listitem>
          <para>Select this <sgmltag class="element">td</sgmltag>. Use
          <menuchoice>
              <guimenu>Edit</guimenu>

              <guimenuitem>Insert After</guimenuitem>
            </menuchoice> to add another <sgmltag class="element">td</sgmltag>
          after it.</para>
        </listitem>

        <listitem>
          <para>Using the node bar path, select the <sgmltag
          class="element">tr</sgmltag> containing the two cells . Use
          <menuchoice>
              <guimenu>Edit</guimenu>

              <guimenuitem>Copy</guimenuitem>
            </menuchoice> to copy it to clipboard.</para>
        </listitem>

        <listitem>
          <para>Use <menuchoice>
              <guimenu>Edit</guimenu>

              <guimenuitem>Paste After</guimenuitem>
            </menuchoice> to paste a copy of the <sgmltag
          class="element">tr</sgmltag> after currently selected <sgmltag
          class="element">tr</sgmltag>.</para>
        </listitem>

        <listitem>
          <para>Type some text in each cell.</para>
        </listitem>
      </orderedlist>

      <mediaobject>
        <imageobject>
          <imagedata fileref="images/replace03.gif" format="GIF" />
        </imageobject>
      </mediaobject>
    </section>

    <section id="convert_element">
      <title>Converting elements</title>

      <section>
        <title>Convert applied to the text selection</title>

        <para>Select a non-bold word in the first <sgmltag
        class="element">p</sgmltag>.</para>

        <mediaobject>
          <imageobject>
            <imagedata fileref="images/convert00.gif" format="GIF" />
          </imageobject>
        </mediaobject>

        <para>Use the <menuchoice>
            <guimenu>Edit</guimenu>

            <guimenuitem>Convert</guimenuitem>
          </menuchoice> to convert it to <sgmltag class="element">em</sgmltag>
        (emphasis).</para>

        <mediaobject>
          <imageobject>
            <imagedata fileref="images/convert01.gif" format="GIF" />
          </imageobject>
        </mediaobject>

        <para>Remember that text selection is used not only to specify a range
        of characters but also a range of nodes and child elements contained
        in a common ancestor element. This feature is very useful when doing a
        conversion. For example: select text from word
        "<literal>paragraph</literal>" to word
        "<literal>XMLmind</literal>".</para>

        <mediaobject>
          <imageobject>
            <imagedata fileref="images/convert01a.gif" format="GIF" />
          </imageobject>
        </mediaobject>

        <para>Use the <menuchoice>
            <guimenu>Edit</guimenu>

            <guimenuitem>Convert</guimenuitem>
          </menuchoice> to convert it to <sgmltag
        class="element">button</sgmltag>.</para>

        <mediaobject>
          <imageobject>
            <imagedata fileref="images/convert01b.gif" format="GIF" />
          </imageobject>
        </mediaobject>

        <para>Use <menuchoice>
            <guimenu>Edit</guimenu>

            <guimenuitem>Undo</guimenuitem>
          </menuchoice> to undo the last conversion.</para>
      </section>

      <section>
        <title>Convert applied to the node selection</title>

        <para>Converting a <literal>#text</literal> node rather than an
        equivalent text selection is often more convenient.</para>

        <para>Select the <literal>#text</literal> node contained in the first
        cell of the table. Note that explicit node selection is needed to do
        that: implicit element selection selects the <sgmltag
        class="element">td</sgmltag> not the <literal>#text</literal> inside
        it.</para>

        <mediaobject>
          <imageobject>
            <imagedata fileref="images/convert02.gif" format="GIF" />
          </imageobject>
        </mediaobject>

        <para>Used <menuchoice>
            <guimenu>Edit</guimenu>

            <guimenuitem>Convert</guimenuitem>
          </menuchoice> to convert it to <sgmltag
        class="element">em</sgmltag>.</para>

        <mediaobject>
          <imageobject>
            <imagedata fileref="images/convert03.gif" format="GIF" />
          </imageobject>
        </mediaobject>

        <para>Unlike <menuchoice>
            <guimenu>Edit</guimenu>

            <guimenuitem>Replace</guimenuitem>
          </menuchoice> which creates an <emphasis>empty</emphasis> new
        element, <menuchoice>
            <guimenu>Edit</guimenu>

            <guimenuitem>Convert</guimenuitem>
          </menuchoice> transfers the content of the selection to the new
        element which is the result of the conversion.</para>

        <para>More precisely, in the case of the node selection:</para>

        <itemizedlist>
          <listitem>
            <para>When several nodes or a single non-element node are
            selected, all these nodes are given a new parent element which is
            the result of the conversion.</para>

            <para>We have already seen two examples of this behavior. First
            one is when we ``wrapped'' a <sgmltag class="element">p</sgmltag>
            and a <sgmltag class="element">ul</sgmltag> into a <sgmltag
            class="element">blockquote</sgmltag>. Second one is just
            above.</para>
          </listitem>

          <listitem>
            <para>When a single element is selected, all its children (but not
            its attributes) are transferred to the result of the
            conversion.</para>

            <para>What follows is an example of this second behavior. Here we
            want to ``morph'' single selected element which is an <sgmltag
            class="element">ul</sgmltag> to an <sgmltag
            class="element">ol</sgmltag>.</para>
          </listitem>
        </itemizedlist>

        <para>Select the first <sgmltag class="element">ul</sgmltag>.</para>

        <mediaobject>
          <imageobject>
            <imagedata fileref="images/convert04.gif" format="GIF" />
          </imageobject>
        </mediaobject>

        <para>Used <menuchoice>
            <guimenu>Edit</guimenu>

            <guimenuitem>Convert</guimenuitem>
          </menuchoice> to convert it to an <sgmltag
        class="element">ol</sgmltag> (ordered list).</para>

        <mediaobject>
          <imageobject>
            <imagedata fileref="images/convert05.gif" format="GIF" />
          </imageobject>
        </mediaobject>

        <para>This operation is valid because the <sgmltag
        class="element">ul</sgmltag> parent, a <sgmltag
        class="element">body</sgmltag>, accepts <sgmltag
        class="element">ul</sgmltag>s as well as <sgmltag
        class="element">ol</sgmltag>s at this place and because the element
        content of this <sgmltag class="element">ul</sgmltag> is
        ``compatible'' with an <sgmltag class="element">ol</sgmltag>.</para>
      </section>
    </section>

    <section id="edit_attributes">
      <title>Editing element attributes</title>

      <para>Use <menuchoice>
          <shortcut>
            <keycombo>
              <keycap>Ctrl</keycap>

              <keycap>E</keycap>
            </keycombo>
          </shortcut>

          <guimenu>Tools</guimenu>

          <guimenuitem>Edit Attribute</guimenuitem>
        </menuchoice> to edit the attributes of the selected element. This
      action displays and gives the keyboard focus to the
      <guilabel>Attributes</guilabel> tool. Alternatively, if this pane is
      already displayed, you can click inside it and use it right away.</para>

      <figure>
        <title>The <guilabel>Attributes</guilabel> tool with the <sgmltag
        class="attribute">rowspan</sgmltag> attribute of a <sgmltag
        class="element">td</sgmltag> being edited</title>

        <mediaobject>
          <imageobject>
            <imagedata fileref="images/attribute00.gif" format="GIF" />
          </imageobject>
        </mediaobject>
      </figure>

      <para>There are two methods for adding or changing the attributes of the
      (explicitly or implicitly) selected element:</para>

      <orderedlist numeration="arabic">
        <listitem>
          <para>Using the attribute form (the upper side of the
          <guilabel>Attributes</guilabel> tool).This should be the method of
          choice for persons who prefer to use the keyboard.</para>
        </listitem>

        <listitem>
          <para>Using the attribute table (the lower side of the
          <guilabel>Attributes</guilabel> tool). This should be the method of
          choice for persons who prefer to use the mouse.</para>
        </listitem>
      </orderedlist>

      <para>The ``minus'' button of the attribute form can be used to remove
      an attribute. Removing an attribute directly from the attribute table is
      possible too: simply right-click on the attribute row and use the
      displayed popup menu.</para>

      <para>The content of the attribute table can be described as
      follows:</para>

      <itemizedlist>
        <listitem>
          <para>All attributes set for the selected element are displayed by
          the table.</para>
        </listitem>

        <listitem>
          <para>All possible attributes for the selected element,
          <emphasis>even those not set</emphasis>, are also displayed by the
          table.</para>

          <para>Attributes which have not been set are displayed in gray.
          Attributes which have been set are displayed in black.</para>
        </listitem>

        <listitem>
          <para>Attributes are listed sorted in alphabetical order.</para>
        </listitem>

        <listitem>
          <para>The names of required attributes are displayed using a bold
          font.</para>
        </listitem>

        <listitem>
          <para>The names of fixed attributes are displayed using an italic
          font.</para>
        </listitem>
      </itemizedlist>

      <para>Exercise:</para>

      <itemizedlist>
        <listitem>
          <para>Select second <sgmltag class="element">td</sgmltag> in the
          <sgmltag class="element">table</sgmltag>. Set its <sgmltag
          class="attribute">align</sgmltag> attribute to <sgmltag
          class="attvalue">center</sgmltag>.</para>
        </listitem>

        <listitem>
          <para>Set its <sgmltag class="attribute">rowspan</sgmltag> attribute
          to <sgmltag class="attvalue">2</sgmltag>.</para>
        </listitem>

        <listitem>
          <para>Set its <sgmltag class="attribute">valign</sgmltag> attribute
          to <sgmltag class="attvalue">middle</sgmltag>.</para>
        </listitem>

        <listitem>
          <para>Add an extra <sgmltag class="element">td</sgmltag> after it to
          make the <sgmltag class="element">table</sgmltag> look more
          balanced.</para>
        </listitem>
      </itemizedlist>

      <mediaobject>
        <imageobject>
          <imagedata fileref="images/attribute01.gif" format="GIF" />
        </imageobject>
      </mediaobject>

      <section>
        <title>Required attributes in newly created elements</title>

        <para>It is important to remember that, by default, XXE automatically
        gives a placeholder value ("<literal>???</literal>") to required
        attributes of newly created elements. This means that you have to
        replace this placeholder value by the actual one as soon as the
        element has been created.</para>

        <para>Add a <sgmltag class="element">p</sgmltag> after the <sgmltag
        class="element">table</sgmltag> using <menuchoice>
            <guimenu>Edit</guimenu>

            <guimenuitem>Insert After</guimenuitem>
          </menuchoice> and insert an <sgmltag class="element">img</sgmltag>
        in it using <menuchoice>
            <guimenu>Edit</guimenu>

            <guimenuitem>Insert</guimenuitem>
          </menuchoice>.</para>

        <mediaobject>
          <imageobject>
            <imagedata fileref="images/attribute02.gif" format="GIF" />
          </imageobject>
        </mediaobject>

        <para>The <sgmltag class="element">img</sgmltag> has two required
        attributes <sgmltag class="attribute">src</sgmltag> and <sgmltag
        class="attribute">alt</sgmltag>. XXE has set those attributes to
        string <sgmltag class="attvalue">???</sgmltag>. Use the
        <guilabel>Attributes</guilabel> tool to give these attributes an
        actual value.</para>

        <mediaobject>
          <imageobject>
            <imagedata fileref="images/attribute03.gif" format="GIF" />
          </imageobject>
        </mediaobject>

        <para>For this <sgmltag class="element">img</sgmltag>, we used
        <sgmltag
        class="attvalue"><replaceable>XXE_install_dir</replaceable>/doc/user/tutorial/xxe.gif</sgmltag>
        and <sgmltag class="attvalue">XMLmind logo</sgmltag> for <sgmltag
        class="attribute">alt</sgmltag> (directory
        <filename><replaceable>XXE_install_dir</replaceable>/doc/user/tutorial/</filename>,
        generally
        <filename>C:\Program Files\XMLmind_XML_Editor\doc\user\tutorial\</filename>,
        contains all the files used in this tutorial) .</para>

        <para>The useless <literal>#text</literal> node has been removed by
        explicitly selecting it and using <menuchoice>
            <guimenu>Edit</guimenu>

            <guimenuitem>Delete</guimenuitem>
          </menuchoice>.</para>
      </section>
    </section>

    <section id="check_validity">
      <title>Checking document validity</title>

      <para>You cannot check the validity of a document without an associated
      DTD, W3C XML Schema or RELAX NG schema. When editing a document not
      constrained by a grammar, XXE guarantees that what you'll create will be
      well-formed without making any special effort.</para>

      <para>This section, like most of this tutorial, describes the behavior
      of XXE when editing documents constrained by a grammar.</para>

      <para><emphasis>Checking document validity is automatically performed
      each time you save your document.</emphasis></para>

      <para>Unless you use <menuchoice>
          <guimenu>Edit</guimenu>

          <guimenuitem>Force Deletion</guimenuitem>
        </menuchoice>, XXE will never allow editing commands that would make
      the document <emphasis>structurally</emphasis> invalid (a document where
      some elements have invalid child elements or attribute names).</para>

      <para>Therefore explicitly checking document validity is rarely needed.
      You may have to use the <menuchoice>
          <guimenu>Tools</guimenu>

          <guimenuitem>Check Validity</guimenuitem>
        </menuchoice> command when:</para>

      <orderedlist numeration="arabic">
        <listitem>
          <para>You have loaded an invalid document and you are fixing it.
          After each editing command, you want to know if it is fixed
          now.</para>
        </listitem>

        <listitem>
          <para>XXE creates elements where the <emphasis>value </emphasis>of
          required attributes, if any, is invalid: unless configured
          differently, the required attributes are given <sgmltag
          class="attvalue">???</sgmltag> as a placeholder value.</para>
        </listitem>
      </orderedlist>

      <para>After explicitly or implicitly checking document validity, its
      validity status is displayed at the left of the status bar.</para>

      <figure>
        <title>After forcing the deletion of all the items of a list,
        "Untitled.html" is structurally invalid.</title>

        <mediaobject>
          <imageobject>
            <imagedata fileref="images/validity01.gif" format="GIF" />
          </imageobject>
        </mediaobject>
      </figure>

      <para>The <guilabel>Validity</guilabel> tool ``tab'' displays validity
      error messages if any.</para>

      <figure>
        <title>Validity error message displayed after forcing the deletion of
        all the items of a list.</title>

        <mediaobject>
          <imageobject>
            <imagedata fileref="images/validity00.gif" format="GIF" />
          </imageobject>
        </mediaobject>
      </figure>

      <para>The color of the message reflects the severity of the error.
      Clicking on the number of an error message selects the element where the
      validity error was found.</para>
    </section>
  </chapter>

  <chapter id="tutorial_modular_document">
    <title>Tutorial: creating a modular document</title>

    <para>A <firstterm>modular document</firstterm> is a document which not
    only has its own content but which also includes XML nodes contained in
    other documents.</para>

    <para>Let's say you want to add the same copyright information at the
    bottom of all the XHTML pages you create. The first step is to author the
    copyright information in a separate document we'll call
    <filename>Copyright.html</filename>. The second step is to include this
    copyright information at the bottom of the XHTML page created during this
    tutorial.</para>

    <section id="create_module">
      <title>Creating the Copyright.html document</title>

      <para>Use <menuchoice>
          <guimenu>File</guimenu>

          <guimenuitem>New</guimenuitem>
        </menuchoice> and once again choose <guilabel>XHTML
      Strict</guilabel>/<guilabel>Page</guilabel> as the document
      template.</para>

      <para>Using <menuchoice>
          <guimenu>Edit</guimenu>

          <guimenuitem>Replace</guimenuitem>
        </menuchoice>, replace the inner <sgmltag class="element">p</sgmltag>
      by a <sgmltag class="element">div</sgmltag>.</para>

      <mediaobject>
        <imageobject>
          <imagedata fileref="images/modular00.gif" />
        </imageobject>
      </mediaobject>

      <para>Using the <guilabel>Attributes</guilabel> tool, specify <sgmltag
      class="attvalue">copyright</sgmltag> as the <sgmltag
      class="attribute">id</sgmltag> attribute of the newly insert <sgmltag
      class="element">div</sgmltag> element.</para>

      <mediaobject>
        <imageobject>
          <imagedata fileref="images/modular10.gif" />
        </imageobject>
      </mediaobject>

      <para>Then select the text node which is the default content of the
      <sgmltag class="element">div</sgmltag> by clicking on
      <literal>#text</literal> in the node path bar and replace it by an
      <sgmltag class="element">address</sgmltag> element. Finally, type the
      copyright information. (The copyright sign © has been inserted using the
      <guilabel>Characters</guilabel> tool.)</para>

      <mediaobject>
        <imageobject>
          <imagedata fileref="images/modular01.gif" format="GIF" />
        </imageobject>
      </mediaobject>

      <para>Using <menuchoice>
          <guimenu>Edit</guimenu>

          <guimenuitem>Insert Before</guimenuitem>
        </menuchoice>, insert a <sgmltag class="element">hr</sgmltag>
      (horizontal rule) before the <sgmltag class="element">address</sgmltag>
      to visually separate the copyright information from the body of the
      XHTML page.</para>

      <para>Using <menuchoice>
          <guimenu>File</guimenu>

          <guimenuitem>Save As</guimenuitem>
        </menuchoice> (or <menuchoice>
          <guimenu>File</guimenu>

          <guimenuitem>Save</guimenuitem>
        </menuchoice> which behaves like <menuchoice>
          <guimenu>File</guimenu>

          <guimenuitem>Save As</guimenuitem>
        </menuchoice> for a new document), save this document as
      <filename>Copyright.html</filename> in a place where it can be shared by
      all the XHTML pages you'll create.</para>

      <mediaobject>
        <imageobject>
          <imagedata fileref="images/modular02.gif" format="GIF" />
        </imageobject>
      </mediaobject>
    </section>

    <section id="insert_reference_to_module">
      <title>Inserting a reference to Copyright.html into the XHTML
      page</title>

      <para>The procedure to do this is very simple. It is similar to copying
      an element in a document and pasting it in another document:</para>

      <orderedlist numeration="arabic">
        <listitem>
          <para>Open in XXE the document containing the element you want to
          reference. If the document containing the element you want to
          reference is already opened in XXE, simply display its
          window.</para>
        </listitem>

        <listitem>
          <para>Explicitly select the element you want to reference.</para>
        </listitem>

        <listitem>
          <para>Use menu bar menu <guimenu>Edit</guimenu> (not popup menu
          <guimenu>Edit</guimenu>), select sub-menu
          <guimenu>Reference</guimenu> and choose entry <guimenuitem>Copy as
          Reference</guimenuitem> (shortcut <keycombo>
              <keycap>Ctrl</keycap>

              <keycap>Shift</keycap>

              <keycap>C</keycap>
            </keycombo>).</para>

          <para>Unlike the usual <guilabel>Copy</guilabel> command which
          copies XML data to the clipboard, this special command copies to the
          clipboard a <firstterm>reference</firstterm> to an element (that is,
          a <emphasis>pointer</emphasis> to the element).</para>

          <para>Note that unless selected element has an ID attribute or is
          the root element of the document, <guimenuitem>Copy as
          Reference</guimenuitem> will not work.</para>
        </listitem>

        <listitem>
          <para>Now switch to the window containing the modular
          document.</para>
        </listitem>

        <listitem>
          <para>Select the element where you want to insert the
          reference.</para>
        </listitem>

        <listitem>
          <para>Use one of the standard <guilabel>Paste Before</guilabel>,
          <guilabel>Paste</guilabel> or <guilabel>Paste After</guilabel>
          commands to insert the reference into the modular document. As
          always, the <guilabel>Paste Before</guilabel>,
          <guilabel>Paste</guilabel> or <guilabel>Paste After</guilabel>
          commands are enabled only if the DTD or schema constraining the
          modular document allows it.</para>
        </listitem>
      </orderedlist>

      <para>Now let's apply this procedure to our example:</para>

      <orderedlist numeration="arabic">
        <listitem>
          <para>The window containing <filename>Copyright.html</filename>, the
          document we want to reference, is already displayed. There is
          nothing to do in step #1.</para>
        </listitem>

        <listitem>
          <para>We want to reference the <sgmltag
          class="element">div</sgmltag> contained in
          <filename>Copyright.html</filename>, therefore we need to select it.
          For example, click on word <sgmltag class="element">div</sgmltag> in
          the node path bar to do this.</para>
        </listitem>

        <listitem>
          <para>Use <keycombo>
              <keycap>Ctrl</keycap>

              <keycap>Shift</keycap>

              <keycap>C</keycap>
            </keycombo> to copy to the clipboard a reference to the <sgmltag
          class="element">div</sgmltag>. Notice that at the bottom of XXE
          window, near the "<guilabel>View Clipboard Content</guilabel>" icon,
          the word <sgmltag class="element">div</sgmltag> is displayed using a
          dimmed color. This means that the clipboard contains a reference
          rather than ordinary data.</para>
        </listitem>

        <listitem>
          <para>Switch to the window containing our XHTML page, for example by
          clicking on the tab having "<literal>Untitled.html</literal>" as its
          title.</para>
        </listitem>

        <listitem>
          <para>Select last <sgmltag class="element">p</sgmltag> at the bottom
          of the page, for example by simply clicking at the right of the
          XMLmind logo. (There are many quick ways to select nodes using the
          keyboard or the mouse: they are all explained in the next chapter of
          this user's guide: <link linkend="being_productive">being productive
          with XXE</link>.)</para>

          <mediaobject>
            <imageobject>
              <imagedata fileref="images/modular04.gif" format="GIF" />
            </imageobject>
          </mediaobject>
        </listitem>

        <listitem>
          <para>Use command <guilabel>Paste After</guilabel> (shortcut
          <keycombo>
              <keycap>Ctrl</keycap>

              <keycap>W</keycap>
            </keycombo>) to paste the reference to the <sgmltag
          class="element">div</sgmltag> after selected <sgmltag
          class="element">p</sgmltag>.</para>
        </listitem>
      </orderedlist>

      <para>The XHTML page now looks like this.</para>

      <mediaobject>
        <imageobject>
          <imagedata fileref="images/modular06.gif" format="GIF" />
        </imageobject>
      </mediaobject>

      <para>Notice that the copyright information inserted at the bottom of
      the page is displayed with a light blue-gray background. This is used to
      indicate that this part of the document has been included from an other
      document and that,consequently, <emphasis>it cannot be edited in this
      window</emphasis>.</para>

      <para>Click anywhere inside the copyright information and try to type
      some text: no characters are inserted. (You can still delete, cut or
      replace the whole copyright information: it is the <sgmltag
      class="element">div</sgmltag> which is not editable, not its parent
      <sgmltag class="element">body</sgmltag>.)</para>

      <para>Also notice that the node path bar displays non-editable nodes
      using a dimmed color.</para>

      <mediaobject>
        <imageobject>
          <imagedata fileref="images/modular07.gif" format="GIF" />
        </imageobject>
      </mediaobject>

      <para>At the left of the node path bar, the button with a right arrow
      switches to the window of the included document. Try it and you'll be
      able to edit <filename>Copyright.html</filename>.</para>

      <para>Once having <filename>Copyright.html</filename> in front of you,
      use the button at the left of the node path bar showing a left arrow to
      go back to the XHTML page created during this tutorial.</para>
    </section>

    <section id="extensive_copy_as_reference">
      <title>Extensive use of the "Copy as Reference" command</title>

      <para>Let's suppose you need to write an article about taxes, but you
      don't want to type the values of the different VAT rates used in
      European countries directly in your document because you know that these
      VAT rates are about to change. Let's say that you already have an XML
      document detailing these VAT rates.</para>

      <para>(In this tutorial, creating the VAT rates document from scratch
      would be tedious which is why you'll find
      <filename>VATrates.html</filename> in
      <filename><replaceable>XXE_install_dir</replaceable>/doc/user/tutorial/</filename>.
      You'll also find in this directory: <filename>Untitled.html</filename>,
      the XHTML page we are trying to create,
      <filename>Copyright.html</filename> and <filename>xxe.gif</filename>.
      That is, all the files used in this tutorial.)</para>

      <para>Add a new <sgmltag class="element">p</sgmltag> at the end of our
      XHTML page and type in it ``The VAT rate of France is higher than the
      VAT rate of Germany.''.</para>

      <para>Now we need to use <filename>VATrates.html</filename> to insert
      the numerical values of the VAT rates in our new paragraph.</para>

      <orderedlist numeration="arabic">
        <listitem>
          <para>Open <filename>VATrates.html</filename> in XXE.</para>

          <mediaobject>
            <imageobject>
              <imagedata fileref="images/modular08.gif" format="GIF" />
            </imageobject>
          </mediaobject>
        </listitem>

        <listitem>
          <para>Click inside the cell which contains the VAT rate of France to
          implicitly select it, then use <keycombo>
              <keycap>Ctrl</keycap>

              <keycap>Shift</keycap>

              <keycap>C</keycap>
            </keycombo> to copy it as a reference.</para>
        </listitem>

        <listitem>
          <para>Switch to the window displaying our XHTML page:
          <filename>Untitled.html</filename>.</para>
        </listitem>

        <listitem>
          <para>Move the caret after ``The VAT rate of France'' .</para>
        </listitem>

        <listitem>
          <para>Paste the copied reference using <keycombo>
              <keycap>Ctrl</keycap>

              <keycap>V</keycap>
            </keycombo>.</para>
        </listitem>
      </orderedlist>

      <para>Do the same for the VAT rate of Germany.</para>

      <para>The XHTML page now looks like this.</para>

      <mediaobject>
        <imageobject>
          <imagedata fileref="images/modular09.gif" format="GIF" />
        </imageobject>
      </mediaobject>

      <para>This has worked smoothly because:</para>

      <orderedlist numeration="loweralpha">
        <listitem>
          <para>Each table cell of <filename>VATrates.html</filename> contains
          a single <sgmltag class="element">span</sgmltag> element rather than
          plain text. A <sgmltag class="element">span</sgmltag> element can be
          inserted almost anywhere in an XHTML document.</para>
        </listitem>

        <listitem>
          <para>Each <sgmltag class="element">span</sgmltag> of second column
          is identified using an <sgmltag class="attribute">id</sgmltag>
          attribute: <sgmltag class="attvalue">austria_vat</sgmltag>, <sgmltag
          class="attvalue">belgium_vat</sgmltag>, etc.</para>
        </listitem>
      </orderedlist>

      <para>Now type this sentence at the end of last added <sgmltag
      class="element">p</sgmltag>: ``Note that the VAT rate of France is lower
      than the VAT rate of Italy.'' and insert the value of the VAT rate of
      Italy as explained above.</para>

      <para>Inserting the VAT rate of France in second sentence is easier
      because we have already pasted it in our XHTML page. In such case, there
      is no need to switch to the window displaying
      <filename>VATrates.html</filename>:</para>

      <orderedlist numeration="arabic">
        <listitem>
          <para>Select the <sgmltag class="element">span</sgmltag> previously
          pasted in our XHTML page which contains the VAT rate of France. For
          example, implicitly select it by clicking inside it.</para>
        </listitem>

        <listitem>
          <para><keycombo>
              <keycap>Ctrl</keycap>

              <keycap>C</keycap>
            </keycombo> to copy it normally.</para>
        </listitem>

        <listitem>
          <para>Click in second sentence after ``Note that the VAT rate of
          France''.</para>
        </listitem>

        <listitem>
          <para>Paste the copied reference using <keycombo>
              <keycap>Ctrl</keycap>

              <keycap>V</keycap>
            </keycombo>.</para>
        </listitem>
      </orderedlist>

      <para>The XHTML page finally looks like this.</para>

      <mediaobject>
        <imageobject>
          <imagedata fileref="images/modular11.gif" format="GIF" />
        </imageobject>
      </mediaobject>

      <para>Note that it is not possible to copy a reference as a reference.
      Only an ``original'' element can be copied as reference. That's why we
      used <guilabel>Copy</guilabel> (<keycombo>
          <keycap>Ctrl</keycap>

          <keycap>C</keycap>
        </keycombo>) here and not <guilabel>Copy As Reference</guilabel>
      (<keycombo>
          <keycap>Ctrl</keycap>

          <keycap>Shift</keycap>

          <keycap>C</keycap>
        </keycombo>). In fact, the standard <guilabel>Cut</guilabel>,
      <guilabel>Copy</guilabel> and <guilabel>Paste</guilabel>,
      <guilabel>Paste After</guilabel>, <guilabel>Paste Before</guilabel>
      commands all know about included elements and will take care of
      preserving the fact that they are references to elements contained in
      other documents.</para>

      <para>For example, use <guilabel>Cut</guilabel> (<keycombo>
          <keycap>Ctrl</keycap>

          <keycap>X</keycap>
        </keycombo>) and <guilabel>Paste Before</guilabel> (<keycombo>
          <keycap>Ctrl</keycap>

          <keycap>U</keycap>
        </keycombo>) to move the <sgmltag class="element">p</sgmltag>
      containing all the VAT <sgmltag class="element">span</sgmltag>s before
      the <sgmltag class="element">p</sgmltag> containing the XMLmind logo.
      You'll get this:</para>

      <mediaobject>
        <imageobject>
          <imagedata fileref="images/modular12.gif" />
        </imageobject>
      </mediaobject>
    </section>

    <section id="interchangeable_modular_documents">
      <title>Creating modular documents which are highly interchangeable with
      other applications</title>

      <para>Creating modular documents in XXE should work very smoothly,
      without much limitations. Converting such modular documents to other
      formats, within XXE, using its "<guimenu>Convert document</guimenu>"
      menu<footnote>
          <para><inlinemediaobject>
              <imageobject>
                <imagedata fileref="images/proedition.gif" />
              </imageobject>
            </inlinemediaobject> The "<guimenu>Convert document</guimenu>"
          menu is present only in XMLmind XML Editor Professional
          Edition.</para>
        </footnote>, should work equally well.</para>

      <para>Despite the fact that XXE <emphasis>exclusively uses a standard
      mechanism</emphasis> (<ulink
      url="http://www.w3.org/TR/xinclude/">XInclude</ulink>), naively creating
      modular documents may lead to interchange problems with third-party
      applications.</para>

      <para>These problems come from two situations:</para>

      <orderedlist numeration="upperalpha">
        <listitem>
          <para>The application does not support XInclude at all. Example: the
          <ulink url="http://saxon.sourceforge.net/">Saxon</ulink> XSLT 1
          processor.</para>
        </listitem>

        <listitem>
          <para>The application supports XInclude, but with limitations.
          Example: the <ulink url="http://xmlsoft.org/XSLT/">xsltproc</ulink>
          XSLT processor.</para>
        </listitem>
      </orderedlist>

      <para>The workarounds are:</para>

      <variablelist>
        <varlistentry>
          <term>Situation A: no support for XInclude</term>

          <listitem>
            <para>Use a preprocessor to create a flat copy of the document
            before submitting it to the application which does not support
            XInclude. XMLmind XML Editor comes with such preprocessor. You'll
            find <literal>xmltool</literal> in the
            <filename><replaceable>XXE_install_dir</replaceable>/bin/</filename>
            directory.</para>
          </listitem>
        </varlistentry>

        <varlistentry>
          <term>Situation B: limited support for XInclude</term>

          <listitem>
            <para>Avoid anything which, even remotely, looks like a recursive
            inclusion.</para>

            <para>For example, even if this complies with the standard and is
            very well supported by XXE, avoid to reference in a modular
            document, an element contained in the modular document itself
            (e.g. you want the same tip to appear at different places).</para>
          </listitem>
        </varlistentry>
      </variablelist>
    </section>
  </chapter>

  <chapter id="being_productive">
    <title id="being_productive_title">Being productive with XXE</title>

    <section id="no_tree_view">
      <title>Do not use the tree view</title>

      <para><emphasis>Do not use the tree view</emphasis>. You can do
      everything efficiently in the styled view. If this is not the case, then
      you have missed something in the tutorial.</para>

      <para>The tree view has been designed to allow editing documents for
      which a style sheet has not yet been written.</para>
    </section>

    <section id="insert_key">
      <title>Quickly type plain text after a bold or italic element</title>

      <para>Use the <keycap>Insert</keycap> key to insert a
      <literal>#text</literal> node after the explicitly selected node or
      implicitly selected element.</para>

      <para>This is often handy in the following situation: you have typed
      some text in a paragraph then inserted a <sgmltag
      class="element">strong</sgmltag> for which you have typed text.</para>

      <mediaobject>
        <imageobject>
          <imagedata fileref="images/productive00.gif" format="GIF" />
        </imageobject>
      </mediaobject>

      <para>Then how to quickly continue typing plain text after the <sgmltag
      class="element">strong</sgmltag>? The answer is: use the
      <keycap>Insert</keycap> key of your keypad.</para>

      <mediaobject>
        <imageobject>
          <imagedata fileref="images/productive01.gif" format="GIF" />
        </imageobject>
      </mediaobject>

      <para>Also note that <keycombo>
          <keycap>Shift</keycap>

          <keycap>Insert</keycap>
        </keycombo> inserts a <literal>#text</literal> node
      <emphasis>before</emphasis> the explicitly selected node or implicitly
      selected element.</para>

      <note>
        <title>Mac Users</title>

        <para>There is no <keycap>Insert</keycap> key on the Mac. Instead, you
        need to use the <keycap>F1</keycap> function key.</para>
      </note>
    </section>

    <section id="add_same_element">
      <title>Quickly insert after an element, another element of the same
      type</title>

      <itemizedlist>
        <listitem>
          <para>Use <keycombo>
              <keycap>Ctrl</keycap>

              <keycap>Insert</keycap>
            </keycombo> to insert an element of the same type after the
          explicitly or implicitly selected element.</para>

          <para>Example: you want to quickly add a section after current
          section. Select the section using the node path bar and type
          <keycombo>
              <keycap>Ctrl</keycap>

              <keycap>Insert</keycap>
            </keycombo>.</para>

          <para>Also note that <keycombo>
              <keycap>Ctrl</keycap>

              <keycap>Shift</keycap>

              <keycap>Insert</keycap>
            </keycombo> inserts an element of the same type
          <emphasis>before</emphasis> the explicitly or implicitly selected
          element.</para>
        </listitem>

        <listitem>
          <para>Even quicker than previous tip, <keycombo>
              <keycap>Ctrl</keycap>

              <mousebutton>click</mousebutton>
            </keycombo> in the node path bar on the name of the element you
          want to duplicate.</para>

          <mediaobject>
            <imageobject>
              <imagedata fileref="images/productive02.gif" format="GIF" />
            </imageobject>
          </mediaobject>

          <para>Also note that if you <keycombo>
              <keycap>Shift</keycap>

              <mousebutton>click</mousebutton>
            </keycombo> in the node path bar on the name of the element, this
          selects this element and then creates a new element of same type
          <emphasis>before</emphasis> this element.</para>

          <para>Remembering these two tips is easy, the node path bar has a
          contextual menu which is displayed when you click using the right
          mouse button.</para>

          <mediaobject>
            <imageobject>
              <imagedata fileref="images/productive03.gif" format="GIF" />
            </imageobject>
          </mediaobject>
        </listitem>

        <listitem>
          <para>Most XXE configurations (XHTML, DocBook, DITA, etc) bind
          keystrokes <keycombo>
              <keycap>Ctrl</keycap>

              <keycap>Enter</keycap>
            </keycombo> and <keycombo>
              <keycap>Ctrl</keycap>

              <keycap>Shift</keycap>

              <keycap>Enter</keycap>
            </keycombo> to the following actions:</para>

          <itemizedlist>
            <listitem>
              <para><keycombo>
                  <keycap>Ctrl</keycap>

                  <keycap>Enter</keycap>
                </keycombo> pressed anywhere inside a paragraph or a list item
              (i.e. any commonly used, repeatable, element) inserts a new
              paragraph or a list item after it.</para>
            </listitem>

            <listitem>
              <para><keycombo>
                  <keycap>Ctrl</keycap>

                  <keycap>Shift</keycap>

                  <keycap>Enter</keycap>
                </keycombo> pressed anywhere inside a paragraph or a list item
              inserts a new paragraph or a list item before it.</para>
            </listitem>
          </itemizedlist>
        </listitem>
      </itemizedlist>
    </section>

    <section id="auto_completion">
      <title>Use auto-completion as much as possible</title>

      <itemizedlist>
        <listitem>
          <para>When choosing an element using <guilabel>Edit</guilabel> tool,
          type the element name (or "<guilabel>(text)</guilabel>" to specify a
          text node) in the text field instead of clicking on it in the
          element list. This text field supports
          <firstterm>auto-completion</firstterm>.</para>

          <mediaobject>
            <imageobject>
              <imagedata fileref="images/insert01.gif" format="GIF" />
            </imageobject>
          </mediaobject>

          <para>User preferences related to auto-completion can be changed
          using the <guilabel>Preferences</guilabel> dialog box,
          <guilabel>Edit</guilabel> section.</para>
        </listitem>

        <listitem>
          <para>When adding an attribute to an element or when changing the
          value of an attribute, use the attribute form rather than the
          attribute table:</para>

          <mediaobject>
            <imageobject>
              <imagedata fileref="images/replace02.gif" format="GIF" />
            </imageobject>
          </mediaobject>

          <orderedlist numeration="arabic">
            <listitem>
              <para>Type the name of the attribute in the name field (first
              field of the form).</para>
            </listitem>

            <listitem>
              <para>Press <keycap>Enter</keycap> to move to the value field
              (second field of the form).</para>
            </listitem>

            <listitem>
              <para>Type the value of the attribute in the value field.</para>
            </listitem>

            <listitem>
              <para>Press <keycap>Enter</keycap> to commit the change and to
              give the keyboard focus back to the document view.</para>
            </listitem>
          </orderedlist>

          <para>Both the name and value fields support auto-completion.
          However auto-completion in the value field only works for attributes
          having the following types: any enumerated type,
          <literal>ID</literal>, <literal>IDREF</literal>,
          <literal>IDREFS</literal>.</para>

          <para>This auto-completion feature can be configured using the
          <guilabel>Preferences</guilabel> dialog box,
          <guilabel>Edit</guilabel> section.</para>
        </listitem>
      </itemizedlist>
    </section>

    <section id="node_range">
      <title>When possible, apply commands to node ranges</title>

      <para>Use the keyboard to select a node range:</para>

      <itemizedlist>
        <listitem>
          <para><keycap>Esc</keycap> <keysym>Down Arrow</keysym> (that is:
          type <keycap>Esc</keycap>, then type <keysym>Down Arrow</keysym>)
          selects all child nodes of the implicitly or explicitly selected
          element.</para>
        </listitem>

        <listitem>
          <para><keycap>Esc</keycap> <keysym>Right Arrow</keysym> extends node
          selection to following sibling.</para>
        </listitem>

        <listitem>
          <para><keycap>Esc</keycap> <keysym>Left Arrow</keysym> extends node
          selection to preceding sibling.</para>
        </listitem>
      </itemizedlist>

      <para>Note <keycap>Esc</keycap> <keysym>Right Arrow</keysym> (and
      <keycap>Esc</keycap> <keysym>Left Arrow</keysym>) will first select
      element containing caret if there is no explicit node selection,
      therefore typing <keycap>Esc</keycap> <keysym>Right Arrow</keysym>
      several times is often the quickest way to select a node range.</para>
    </section>

    <section id="keyboard_shortcuts">
      <title>Learn important keyboard shortcuts</title>

      <informaltable colsep="1" frame="all" rowsep="1">
        <tgroup cols="3">
          <colspec align="center" />

          <colspec align="center" />

          <colspec align="center" colwidth="2*" />

          <thead>
            <row>
              <entry><para>Command</para></entry>

              <entry><para>Keyboard shortcut</para></entry>

              <entry><para>Trick to remember the keyboard
              shortcut</para></entry>
            </row>
          </thead>

          <tbody>
            <row>
              <entry><para>Undo</para></entry>

              <entry><para><keycombo>
                  <keycap>Ctrl</keycap>

                  <keycap>Z</keycap>
                </keycombo></para></entry>

              <entry><para>Standard shortcut</para></entry>
            </row>

            <row>
              <entry><para>Redo</para></entry>

              <entry><para><keycombo>
                  <keycap>Ctrl</keycap>

                  <keycap>Y</keycap>
                </keycombo></para></entry>

              <entry><para>Standard shortcut</para></entry>
            </row>

            <row>
              <entry><para>Repeat</para></entry>

              <entry><para><keycombo>
                  <keycap>Ctrl</keycap>

                  <keycap>A</keycap>
                </keycombo></para></entry>

              <entry><para><emphasis role="bold">A</emphasis> like <emphasis
              role="bold">A</emphasis>gain</para></entry>
            </row>

            <row>
              <entry><para>Cut</para></entry>

              <entry><para><keycombo>
                  <keycap>Ctrl</keycap>

                  <keycap>X</keycap>
                </keycombo></para></entry>

              <entry><para>Standard shortcut</para></entry>
            </row>

            <row>
              <entry><para>Copy</para></entry>

              <entry><para><keycombo>
                  <keycap>Ctrl</keycap>

                  <keycap>C</keycap>
                </keycombo></para></entry>

              <entry><para>Standard shortcut</para></entry>
            </row>

            <row>
              <entry><para>Paste</para></entry>

              <entry><para><keycombo>
                  <keycap>Ctrl</keycap>

                  <keycap>V</keycap>
                </keycombo></para></entry>

              <entry><para>Standard shortcut</para></entry>
            </row>

            <row>
              <entry><para>Paste Before</para></entry>

              <entry><para><keycombo>
                  <keycap>Ctrl</keycap>

                  <keycap>U</keycap>
                </keycombo></para></entry>

              <entry><para><keycombo>
                  <keycap>Ctrl</keycap>

                  <keycap>V</keycap>
                </keycombo> means Paste and <emphasis role="bold">U</emphasis>
              is before <emphasis role="bold">V</emphasis></para></entry>
            </row>

            <row>
              <entry><para>Paste After</para></entry>

              <entry><para><keycombo>
                  <keycap>Ctrl</keycap>

                  <keycap>W</keycap>
                </keycombo></para></entry>

              <entry><para><keycombo>
                  <keycap>Ctrl</keycap>

                  <keycap>V</keycap>
                </keycombo> means Paste and <emphasis role="bold">W</emphasis>
              is after <emphasis role="bold">V</emphasis></para></entry>
            </row>

            <row>
              <entry><para>Delete</para></entry>

              <entry><para><keycombo>
                  <keycap>Ctrl</keycap>

                  <keycap>K</keycap>
                </keycombo></para></entry>

              <entry><para><emphasis role="bold">K</emphasis> like <emphasis
              role="bold">K</emphasis>ill</para></entry>
            </row>

            <row>
              <entry><para>Replace</para></entry>

              <entry><para><keycombo>
                  <keycap>Ctrl</keycap>

                  <keycap>R</keycap>
                </keycombo></para></entry>

              <entry><para><emphasis role="bold">R</emphasis> like <emphasis
              role="bold">R</emphasis>eplace</para></entry>
            </row>

            <row>
              <entry><para>Insert</para></entry>

              <entry><para><keycombo>
                  <keycap>Ctrl</keycap>

                  <keycap>I</keycap>
                </keycombo></para></entry>

              <entry><para><emphasis role="bold">I</emphasis> like <emphasis
              role="bold">I</emphasis>nsert</para></entry>
            </row>

            <row>
              <entry><para>Insert Before</para></entry>

              <entry><para><keycombo>
                  <keycap>Ctrl</keycap>

                  <keycap>H</keycap>
                </keycombo> (<keycombo>
                  <keycap>Cmd</keycap>

                  <keycap>B</keycap>
                </keycombo> on the Mac)</para></entry>

              <entry><para><keycombo>
                  <keycap>Ctrl</keycap>

                  <keycap>I</keycap>
                </keycombo> means Insert and <emphasis
              role="bold">H</emphasis> is before <emphasis
              role="bold">I</emphasis></para></entry>
            </row>

            <row>
              <entry><para>Insert After</para></entry>

              <entry><para><keycombo>
                  <keycap>Ctrl</keycap>

                  <keycap>J</keycap>
                </keycombo></para></entry>

              <entry><para><keycombo>
                  <keycap>Ctrl</keycap>

                  <keycap>I</keycap>
                </keycombo> means Insert and <emphasis
              role="bold">J</emphasis> is after <emphasis
              role="bold">I</emphasis></para></entry>
            </row>

            <row>
              <entry><para>Convert</para></entry>

              <entry><para><keycombo>
                  <keycap>Ctrl</keycap>

                  <keycap>T</keycap>
                </keycombo></para></entry>

              <entry><para><emphasis role="bold">T</emphasis> like <emphasis
              role="bold">T</emphasis>ransform</para></entry>
            </row>

            <row>
              <entry><para>Wrap</para></entry>

              <entry><para><keycombo>
                  <keycap>Ctrl</keycap>

                  <keycap>Shift</keycap>

                  <keycap>T</keycap>
                </keycombo></para></entry>

              <entry><para><emphasis role="bold">T</emphasis> like <emphasis
              role="bold">T</emphasis>ransform (variant of
              Convert)</para></entry>
            </row>

            <row>
              <entry><para>Split</para></entry>

              <entry><para><keycap>Esc</keycap>
              <keycap>Enter</keycap></para></entry>

              <entry><para>A paragraph-specific form of Split is often bound
              to the <keycap>Enter</keycap> keystroke</para></entry>
            </row>

            <row>
              <entry><para>Join</para></entry>

              <entry><keycap>Esc</keycap> <keysym>Backspace</keysym></entry>

              <entry><para>A paragraph-specific form of Join is often bound to
              the <keysym>Backspace</keysym> keystroke</para></entry>
            </row>

            <row>
              <entry><para>Search</para></entry>

              <entry><para><keycombo>
                  <keycap>Ctrl</keycap>

                  <keycap>F</keycap>
                </keycombo></para></entry>

              <entry><para>Standard shortcut <emphasis
              role="bold">F</emphasis> like <emphasis
              role="bold">F</emphasis>ind</para></entry>
            </row>

            <row>
              <entry><para>Replace</para></entry>

              <entry><para><keycombo>
                  <keycap>Ctrl</keycap>

                  <keycap>M</keycap>
                </keycombo></para></entry>

              <entry><para><emphasis role="bold">M</emphasis> like <emphasis
              role="bold">M</emphasis>odify</para></entry>
            </row>

            <row>
              <entry><para>Find Next</para></entry>

              <entry><para><keycombo>
                  <keycap>Ctrl</keycap>

                  <keycap>G</keycap>
                </keycombo></para></entry>

              <entry><para>Standard shortcut</para></entry>
            </row>
          </tbody>
        </tgroup>
      </informaltable>

      <note>
        <title>Mac Users</title>

        <itemizedlist>
          <listitem>
            <para>Use the <keycap>Cmd</keycap> key instead of the
            <keycap>Ctrl</keycap> key, except for <keycombo>
                <keycap>Ctrl</keycap>

                <keysym>Tab</keysym>
              </keycombo> (insert tab character) and <keycombo>
                <keycap>Ctrl</keycap>

                <keysym>Space</keysym>
              </keycombo> (insert non breaking space).</para>
          </listitem>

          <listitem>
            <para>Use <keycombo>
                <keycap>Ctrl</keycap>

                <mousebutton>button1</mousebutton>
              </keycombo> to emulate mouse
            <mousebutton>button3</mousebutton>.</para>
          </listitem>

          <listitem>
            <para>Use <keycombo>
                <keycap>Alt</keycap>

                <mousebutton>button1</mousebutton>
              </keycombo> to emulate mouse
            <mousebutton>button2</mousebutton>.</para>
          </listitem>
        </itemizedlist>

        <para>Note that using a 2-button mouse with a scroll wheel on the Mac
        is not only very well supported but also highly recommended.</para>
      </note>

      <tip>
        <para>A quick reference card in PDF format is available in four
        different flavors: <ulink
        url="http://www.xmlmind.com/xmleditor/_distrib/doc/quickrefcard/quickrefcard-A4.pdf">A4</ulink>,
        <ulink
        url="http://www.xmlmind.com/xmleditor/_distrib/doc/quickrefcard/quickrefcard-Letter.pdf">Letter</ulink>,
        <ulink
        url="http://www.xmlmind.com/xmleditor/_distrib/doc/quickrefcard/quickrefcard-Mac-A4.pdf">for
        the Mac/A4</ulink>, <ulink
        url="http://www.xmlmind.com/xmleditor/_distrib/doc/quickrefcard/quickrefcard-Mac-Letter.pdf">for
        the Mac/Letter</ulink>.</para>
      </tip>

      <tip>
        <para>Use XXE add-on manager (<menuchoice>
            <guimenu>Options</guimenu>

            <guimenuitem>Install Add-ons</guimenuitem>
          </menuchoice>) to download and install the add-on containing a
        sample <filename>customize.xxe</filename> file. This customization
        file contains many <emphasis>truly useful</emphasis> macro-commands
        and their associated bindings.</para>
      </tip>
    </section>

    <section id="paste_with_button2">
      <title>Quickly paste selected text using mouse button #2</title>

      <para>Use the mouse to quickly copy and paste text:</para>

      <itemizedlist>
        <listitem>
          <para>Selecting text automatically ``copies it as system selection''
          on platforms supporting system selection (X-Window) and
          automatically copies it to an internal clipboard on other
          platforms.</para>
        </listitem>

        <listitem>
          <para>Clicking with mouse button #2 (middle button or mouse wheel)
          pastes the content of system selection on platforms supporting
          system selection and pastes the content of an internal clipboard on
          other platforms.</para>
        </listitem>
      </itemizedlist>

      <para>Note that unlike <menuchoice>
          <guimenu>Edit</guimenu>

          <guimenuitem>Copy</guimenuitem>
        </menuchoice> which copies characters as well as nodes, selecting text
      this way just copies <emphasis>characters</emphasis> to the system
      selection.</para>

      <para>This functionality is disabled by default. To enable it, please
      use the <guilabel>Preferences</guilabel> dialog box,
      <guilabel>Edit</guilabel> section and check "<guilabel>Clicking with
      middle button pastes system selection</guilabel>".</para>
    </section>

    <section id="drop_graphics_files">
      <title>Drop graphics files on <sgmltag class="element">img</sgmltag>,
      <sgmltag class="element">imagedata</sgmltag>, <sgmltag
      class="element">image</sgmltag>, etc, elements</title>

      <para>When an image is displayed in a styled document view, the simplest
      way to change it is to drag and drop a file on it.</para>

      <para>When a file is dropped on an image, a pre-filled, specialized
      dialog box is displayed to let the user specify exactly what he wants to
      do with the image file.</para>

      <para>For example, if the image file is referenced in attribute <sgmltag
      class="attribute">fileref</sgmltag> of element <sgmltag
      class="attribute">imagedata</sgmltag> (like in screenshot below), the
      user is given the choice between</para>

      <itemizedlist>
        <listitem>
          <para>copying the image to the document directory and then updating
          the reference to the image file in the attribute,</para>
        </listitem>

        <listitem>
          <para>OR just updating the reference to the image file in the
          attribute.</para>
        </listitem>
      </itemizedlist>

      <mediaobject>
        <imageobject>
          <imagedata fileref="images/productive04.gif" format="GIF" />
        </imageobject>
      </mediaobject>

      <para>The same dialog box can be opened without having to drop a file on
      an image displayed in the document view: simply double-click on the
      image.</para>

      <para>This functionality has been implemented mainly to allow users to
      upload images to the remote site when they edit documents stored on a
      FTP or WebDAV server, but this is also very handy when working on the
      local file system.</para>
    </section>

    <section id="interactive_gray_margins">
      <title>Easily select paragraphs, list items, table rows, etc, using the
      ``interactive gray margins''</title>

      <para>The easiest way to select a paragraph or a table row is to use the
      option which adds <emphasis>``interactive gray margins''</emphasis> at
      the left and/or at the right of the document view.</para>

      <para>By default these interactive margins are absent. To enable them,
      you need to use <menuchoice>
          <guimenu>Options</guimenu>

          <guimenuitem>Preferences</guimenuitem>
        </menuchoice>, <guilabel>Edit</guilabel> section and check one or both
      the "<guilabel>Add interactive margin to the styled view</guilabel>"
      toggles. After doing this, you'll also need to reload any opened
      document.</para>

      <para>Example, using interactive margins to select an <sgmltag
      class="element">ul</sgmltag> in an XHTML document:</para>

      <mediaobject>
        <imageobject>
          <imagedata fileref="images/graymargins.gif" format="GIF" />
        </imageobject>
      </mediaobject>

      <para>Move the mouse in the gray margin found at the left and/or at the
      right of the document view. Here you'll notice that the cursor changes
      its shape. Move the cursor in front of any list item and click once.
      Mouse clicks in the left or in the right margin selects the ``block''
      (paragraph, row, row group, table) which is in front of the click. In
      this case, this selects the <sgmltag class="element">li</sgmltag>. Click
      again without moving the mouse and this will select the parent of the
      <sgmltag class="element">li</sgmltag>: the <sgmltag
      class="element">ul</sgmltag>. Clicking again without moving the mouse
      would select the parent of the <sgmltag class="element">ul</sgmltag>:
      the <sgmltag class="element">body</sgmltag>, and so on. Do not click
      several times too fast otherwise the editor will think you are
      double-clicking or triple-clicking and therefore, selecting elements
      that way would not work.</para>

      <note>
        <para>Because this way of selecting blocks is so easy to use, it tends
        to ``cannibalize'' the other ways of selecting nodes, especially the
        implicit element selection. Therefore we do not recommend turning on
        this option.</para>
      </note>
    </section>

    <section id="include_tool">
      <title>Quickly insert ``XML variables'' in your document using the
      <guilabel>Include</guilabel> tool</title>

      <note>
        <para>The <guilabel>Include</guilabel> tool is hidden by default. You
        need to enable it by checking "<guilabel>Enable the Include
        Tool</guilabel>" in <menuchoice>
            <guimenu>Options</guimenu>

            <guimenuitem>Preferences</guimenuitem>
          </menuchoice>, <guilabel>Features</guilabel> section.</para>
      </note>

      <para>You'll often want to put all the ``XML variables'': product names,
      product versions, copyright information, addresses, phone numbers, etc,
      you use in all your documents in a single, special purpose, document and
      then, paste references to these ``XML variables'' in your actual
      documents.</para>

      <para>By working this way, if one day, the value of an ``XML variable''
      changes, you don't need to manually update all the documents making use
      of this value.</para>

      <para>In <link linkend="extensive_copy_as_reference">Extensive use of
      the "Copy as Reference" command</link>, we have already explained that
      this is done by copying an element from the document containing the
      collection of ``XML variables'' (using <guimenuitem>Copy As
      Reference</guimenuitem> &mdash; <keycombo>
          <keycap>Ctrl</keycap>

          <keycap>Shift</keycap>

          <keycap>C</keycap>
        </keycombo>) and then pasting the reference in the actual document
      (using <guimenuitem>Paste</guimenuitem> &mdash; <keycombo>
          <keycap>Ctrl</keycap>

          <keycap>V</keycap>
        </keycombo>).</para>

      <para>However if you need to do that one hundred times a day, you'll
      quickly find very tedious switching from one document to the other.
      Fortunately, the <guilabel>Include</guilabel> tool has been specially
      designed to handle the case of ``XML variables''.</para>

      <mediaobject>
        <imageobject>
          <imagedata fileref="images/includePane.gif" />
        </imageobject>
      </mediaobject>

      <para>Let's suppose you want to use the <guilabel>Include</guilabel>
      tool to insert in your report the VAT rate of Germany (same example as
      in <link linkend="extensive_copy_as_reference">Extensive use of the
      "Copy as Reference" command</link>). Here's what you'll have to
      do:</para>

      <orderedlist>
        <listitem>
          <para>Use the <inlinemediaobject>
              <imageobject>
                <imagedata fileref="images/add.gif" />
              </imageobject>
            </inlinemediaobject> button to specify <emphasis>once and for
          all</emphasis> the filename or URL of the document containing your
          collection of ``XML variables''. In the above screenshot, this
          document is <filename>VATrates.html</filename>.</para>
        </listitem>

        <listitem>
          <para>Use <menuchoice>
              <shortcut>
                <keycombo>
                  <keycap>Ctrl</keycap>

                  <keycap>Shift</keycap>

                  <keycap>R</keycap>
                </keycombo>
              </shortcut>

              <guimenu>Edit</guimenu>

              <guisubmenu>Reference</guisubmenu>

              <guimenuitem>Insert Reference</guimenuitem>
            </menuchoice> to display the <guilabel>Include</guilabel>
          tool.</para>
        </listitem>

        <listitem>
          <para>Type the ID of the element for which you want to insert a
          reference. Typing the first few letters is generally sufficient as
          the "<guilabel>Include</guilabel>" text field supports
          auto-completion.</para>
        </listitem>

        <listitem>
          <para>Press <keycap>Enter</keycap>.</para>
        </listitem>
      </orderedlist>

      <para>That's it. You have inserted a reference to the <sgmltag
      class="element">span</sgmltag> element containing the VAT rate of
      Germany.</para>

      <tip>
        <title>Use the right tool for the right job</title>

        <para>For example, do <emphasis>not</emphasis> attempt to use the
        <guilabel>Include</guilabel> tool to compose a modular book. Inserting
        references to the chapters in the modular book is best achieved by
        using the <guimenuitem>Copy As
        Reference</guimenuitem>/<guimenuitem>Paste</guimenuitem> (<keycombo>
            <keycap>Ctrl</keycap>

            <keycap>Shift</keycap>

            <keycap>C</keycap>
          </keycombo>/<keycombo>
            <keycap>Ctrl</keycap>

            <keycap>V</keycap>
          </keycombo>) approach described in the tutorial.</para>
      </tip>
    </section>
  </chapter>
</book>
