home *** CD-ROM | disk | FTP | other *** search
/ PC World 2001 April / PCWorld_2001-04_cd.bin / Komunik / Amaya / WinNT2000 / amaya-WindowsNT-4.3.exe / _SETUP.1 / Creating.html < prev    next >
Encoding:
Extensible Markup Language  |  2001-02-22  |  13.6 KB  |  291 lines

  1. <?xml version="1.0" encoding="iso-8859-1"?>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  3.     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  4. <html xmlns="http://www.w3.org/1999/xhtml">
  5. <head>
  6.   <title>Creating elements</title>
  7.   <meta name="GENERATOR" content="amaya V4.2.2" />
  8.   <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  9. </head>
  10.  
  11. <body xml:lang="en" lang="en">
  12.  
  13. <table border="0" width="100%" summary="toc">
  14.   <tbody>
  15.     <tr>
  16.       <td><p><img border="0" alt="W3C" src="../../Icons/WWW/w3c_home" /> <img
  17.         border="0" alt="Amaya" src="../Icons/amaya.gif" /></p>
  18.       </td>
  19.       <td><p align="right"><a href="Views.html" accesskey="p"><img
  20.         alt="previous" border="0" src="../Icons/left.gif" /></a> <a
  21.         href="Manual.html" accesskey="t"><img alt="top" border="0"
  22.         src="../Icons/up.gif" /></a> <a href="Links.html" accesskey="n"><img
  23.         alt="next" border="0" src="../Icons/right.gif" /></a></p>
  24.       </td>
  25.     </tr>
  26.   </tbody>
  27. </table>
  28.  
  29. <div id="Creating">
  30. <h2>Creating new elements</h2>
  31.  
  32. <h3><a name="New">New documents</a></h3>
  33.  
  34. <p>Amaya allows you to create new local or distant documents. Three types of
  35. document are availableá: <a href="#Creating">XHTML</a>, <a
  36. href="Math.html#Math">MathML</a> or <a href="SVG.html">SVG.</a></p>
  37.  
  38. <p>To create a document, choose the <strong>New</strong> option in the
  39. <strong>File</strong> menu and select the appropriate type. Then, specify the
  40. URI or the local name of the new document (a default name is assigned to the
  41. document if no name is specified). After confirmation, Amaya opens a new
  42. window with the specified document. If this document already exists, Amaya
  43. loads its current version otherwise. a new document with the corresponding
  44. root element is created.</p>
  45.  
  46. <h3><a name="Types">Buttons and types</a> menu</h3>
  47.  
  48. <p>The simplest way to create new elements in a document is to move the
  49. insertion point to the desired position and to use the <strong>Types</strong>
  50. menu or the buttons corresponding to the most common elements (image,
  51. headings, lists, etc.). These buttons and menu items create the corresponding
  52. element at the current position.</p>
  53.  
  54. <p>In some cases, the desired element cannot be created exactly at the
  55. position chosen, because of the constraints imposed by the HTML DTD.
  56. <strong>Amaya</strong> then tries to create the element at the closest
  57. position where it is allowed. For instance, if the insertion point is at the
  58. end of the last line of a paragraph when you click on the <img
  59. src="../Icons/H2.gif" alt="H2" /> button, <strong>Amaya</strong> does not
  60. create the new heading at that particular position (which would be invalid),
  61. but after the paragraph (which is probably what you intended).</p>
  62.  
  63. <p>In some other cases, <strong>Amaya</strong> changes the existing structure
  64. for creating the desired element. If the insertion point is somewhere within a
  65. list item (<code>LI</code>) when you create a second level heading (for
  66. example with the <img src="../Icons/H2.gif" alt="H2" /> button, or from the
  67. menu), the list item and its enclosing list are automatically split, in order
  68. to create the requested heading at the chosen position and to comply with the
  69. HTML DTD.</p>
  70.  
  71. <p>When creating new elements, it is important to select an <em>insertion
  72. point</em>, not some text nor a single character: if the current selection is
  73. not empty, <strong>Amaya</strong> tries to <a
  74. href="Changing.html#L631"><em>transform</em></a> the selected part into the
  75. element type chosen.</p>
  76.  
  77. <p>Some documentation of <a href="HTML-elements/infoTypes.html">how to use
  78. element types</a> is available, as well as a briefly annotated <a
  79. href="HTML.html">list of all the HTML 4.0 elements</a>.</p>
  80.  
  81. <h3><a name="Structure">Structure menu</a></h3>
  82.  
  83. <p>The <a href="#Types"><strong>Types</strong> menu</a> allows you to create
  84. only elements that are part of the document <code>BODY</code>. To create
  85. elements in the document <code>HEAD</code>, use the <strong>Structure</strong>
  86. menu from the <a href="Views.html#Structure">Structure view</a>. This menu
  87. works in the same way as the <strong>Types</strong> menu: put the caret at the
  88. desired position and choose the element type from the
  89. <strong>Structure</strong> menu.</p>
  90.  
  91. <p>The <strong>Structure</strong> menu also allows you to create comments,
  92. using its <strong>Comment</strong> entry. Comments are shown only in the <a
  93. href="Views.html#Structure">Structure view</a>, but they can be inserted at
  94. any position in the document.</p>
  95.  
  96. <h4>Generated elements</h4>
  97.  
  98. <p>Some HTML elements are constituted by several other elements of different
  99. types. For instance, a table contains usually a caption (<code>CAPTION</code>)
  100. and several rows (<code>TR</code>) and several cells (<code>TD</code> or
  101. <code>TH</code>) in each row.</p>
  102.  
  103. <p>When <strong>Amaya</strong> creates such elements, it also creates their
  104. components. A table is created with a caption and a row containing a single
  105. cell. The insertion point is placed automatically in the first of these
  106. components. You can enter the content of that component immediately or later.
  107. You can move to the next (empty) component with the mouse or with the arrow
  108. keys.</p>
  109.  
  110. <h3><a name="L906">The Enter (or Return) key</a></h3>
  111.  
  112. <p>When you are writing a new document or a new part in a document, you often
  113. create elements sequentially. To do that, just press the Enter (or Return)
  114. key. The current element is terminated and a new one is created just after.
  115. This applies obviously to paragraphs, but also to other types of elements,
  116. such as headings or <a href="Tables.html#Editing">table cells</a> for
  117. instance.</p>
  118.  
  119. <p>Most often, the new element created is simply a paragraph, whatever the
  120. type of the previous element. If you need another element type, you can
  121. immediately change the type of that element, by selecting the desired type in
  122. the <strong>Types</strong> menu or by clicking on the corresponding button,
  123. but you can also keep typing and <a href="Changing.html#L653">change the
  124. type</a> later.</p>
  125.  
  126. <h4>Multiple Enters at the end of an element</h4>
  127.  
  128. <p>When the insertion point is in an empty element, pressing the Enter key
  129. <em>replaces</em> that element by another empty element at the next higher
  130. level in the document structure. This feature allows you to create complex
  131. nested structures very quickly.</p>
  132.  
  133. <p>As an example, consider the following structure:</p>
  134. <ol>
  135.   <li>The first item in the highest level list. 
  136.     <p>A paragraph in the first item.</p>
  137.   </li>
  138.   <li>The second item. 
  139.     <ol type="a">
  140.       <li>First item in the nested list.</li>
  141.       <li>Second item in the nested list.</li>
  142.     </ol>
  143.   </li>
  144.   <li>Last item in the list.</li>
  145. </ol>
  146.  
  147. <p>To create that structure, create first a numbered list with a first item
  148. (for example by clicking on the <img alt="Numbered List " border="0"
  149. src="../Icons/NumList.gif" align="middle" /> button) and type in the first
  150. line. At the end of that first line, press the Enter key: it creates a new
  151. paragraph in the item. At the end of this paragraph, press the Enter key: it
  152. creates yet another paragraph, but pressing the same key again replaces that
  153. paragraph by an empty item 2. At the end of the first line of item 2, create a
  154. new list with its first item (for example click on the <img border="0"
  155. alt="Numbered List " src="../Icons/NumList.gif" align="middle" /> button). The
  156. new list will automatically be nested. Item b. is created by a double Enter at
  157. the end of item a. When the insertion point is at the end of item b, create
  158. item 3 by four successive Enters. To create the paragraph that follows these
  159. lists, press Enter three times when the insertion point is at the end of item
  160. 3.</p>
  161.  
  162. <h4>Multiple Enters at the beginning of an element</h4>
  163.  
  164. <p>The Enter key works in the same way when the insertion point is at the
  165. beginning of an element, but it creates new elements <em>before</em> the
  166. current element.</p>
  167.  
  168. <p>For instance, you can add an initial paragraph in a list item by moving the
  169. insertion point before the first character of that item and pressing Enter. If
  170. you press Enter twice, you get a new item before the current item. This is
  171. useful for inserting a new item before the first one.</p>
  172.  
  173. <p>This use of the Enter key does not apply only to lists and paragraphs, but
  174. to all elements. It is for instance very convenient for <a
  175. href="Manual.html">creating tables</a>.</p>
  176.  
  177. <h4>Exiting anchors or styled character strings</h4>
  178.  
  179. <p>When a paragraph or another block of text is styled - terminated by an
  180. anchor or a character string in bold, italic or other such style - moving the
  181. insertion point to the end and typing appends characters to the anchor or the
  182. styled string. If you want to exit this styled element and enter plain text,
  183. just press Enter to exit from the anchor or styled element, and continue
  184. typing.</p>
  185.  
  186. <p>The same method can be used to enter plain text at the <em>beginning</em>
  187. of a block starting with an anchor or styled characters.</p>
  188.  
  189. <h4>Editing definition lists (dl/dt/dd)</h4>
  190.  
  191. <p>The Enter key is also useful for editing definitions lists. Consider the
  192. following example:</p>
  193.  
  194. <blockquote>
  195.   <dl>
  196.     <dt>Term1</dt>
  197.     <dt>Term2</dt>
  198.       <dd>Definition of both terms.</dd>
  199.   </dl>
  200. </blockquote>
  201.  
  202. <p>It is a definition list (<code>dl</code>) containing two terms
  203. (<code>dt</code>) followed by a definition (<code>dd</code>). To add a new
  204. paragraph within the definition (<code>dd</code>), put the caret at the end
  205. (after word "terms") and hit the Enter key. If you hit Enter twice, you exit
  206. from the current definition (<code>dd</code>) and you create a new term
  207. (<code>dt</code>). At the end of that new term, pressing Enter once allows you
  208. to create another new term (<code>dt</code>). Pressing Enter twice creates a
  209. new definition (<code>dd</code>) instead.</p>
  210.  
  211. <p>If you want to create a new term and its definition <em>before</em> Term1,
  212. put the caret at the beginning of "Term1" and press Enter. Type the new term
  213. (<code>dt</code>). Then press Enter twice: a new definition (<code>dd</code>)
  214. is created right after the new term.</p>
  215.  
  216. <h3><a name="Changing">Changing the document Title</a></h3>
  217.  
  218. <p>You can edit the document title (TITLE element) in with the menu entry
  219. <strong>Types/Change Title</strong>. You can also edit the document title in
  220. the <a href="Views.html#Structure">structure view</a>.</p>
  221. </div>
  222.  
  223. <div id="WhiteSpace">
  224. <h3>White-space handling</h3>
  225.  
  226. <p>For the XHTML, <a href="Math.html.fr#Math">MathML</a>, <a
  227. href="SVG.html.fr">SVG</a> documents as well as for MathML or SVG elements
  228. included into a HTML document, Amaya removes the <strong>insignificant
  229. white-space characters</strong> when it loads a document unless they must be
  230. explicitly preserved.</p>
  231.  
  232. <p>Are considered as insignificant white-space characters:</p>
  233. <ul>
  234.   <li>the end of line characters (#xD et (#xA),</li>
  235.   <li>the tabs characters (#X9),</li>
  236.   <li>the leading spaces of an element,</li>
  237.   <li>the trailing spaces of an element,</li>
  238.   <li>the contiguous spaces (in that case, one space is preserved).</li>
  239. </ul>
  240.  
  241. <p>If an author wants to preserve all the characters for some elements, he can
  242. use the <code>xml:space</code> attribute or the element <code>PRE</code> (that
  243. element is only valid for XHTML documents). The only possible values for that
  244. attribute are "<code>default</code>" and "<code>preserve</code>". The value
  245. "<code>default</code>" signals that applications' default white-space
  246. treatments are acceptable for these elements. In Amaya, the default treatment
  247. removes the insignificant white-space characters for all supported DTD (see
  248. above). The value "<code>preserve</code>" indicates the intent that
  249. applications preserve all the characters, except the first one that
  250. immediately follows the end tag of the element where it is specified if that
  251. element is an end of line. The <code>xml:space</code> attribute is applied to
  252. all elements within the content of the element where it is specified, unless
  253. overriden with another instance of the <code>xml:space</code> attribute.
  254. Concerning the XHTML DTD, the element <code>PRE</code> causes the same
  255. behaviour that the <code>xml:space</code> attribute with the value
  256. "<code>preserve</code>".</p>
  257.  
  258. <p>Amaya applies the white space handling when it loads a document, not when
  259. we are editing it. A consequence is that if you type insignificant white-space
  260. characters, its will be visible and saved but will be removed at the next
  261. loading. For example, the following source code:</p>
  262.  
  263. <p><code><p>Amaya removes the<strong> insignificant white-space
  264. </strong>when it loads ...</p></code></p>
  265.  
  266. <p>gives during edition:</p>
  267. <pre>Amaya removes the<strong> insignificant white-space </strong>when it loads...</pre>
  268.  
  269. <p>and will be saved with that syntax. At the next loading of the document,
  270. this code will give:</p>
  271.  
  272. <p><code>Amaya removes the</code><strong><code>insignificant
  273. white-space</code></strong><code>when it loads...</code></p>
  274.  
  275. <p>because the leading space and the trailing space of the element
  276. <code>strong</code> are considered as insignificant and are removed.</p>
  277.  
  278. <p>The correct source code would be:</p>
  279.  
  280. <p><code><p>Amaya removes the <strong>insignificant
  281. white-space</strong> when it loads ...</p></code></p>
  282. </div>
  283.  
  284. <p align="right"><a href="Views.html"><img alt="previous" border="0"
  285. src="../Icons/left.gif" /></a> <a href="Manual.html"><img alt="top" border="0"
  286. src="../Icons/up.gif" /></a> <a href="Links.html"><img alt="next" border="0"
  287. src="../Icons/right.gif" /></a></p>
  288. <hr />
  289. </body>
  290. </html>
  291.