| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" |
| "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| <html lang="en" xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> |
| <head> |
| <meta name="copyright" content= |
| "Copyright (c) IBM Corporation and others 2000, 2011. This page is made available under license. For full details see the LEGAL in the documentation book that contains this page." /> |
| <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
| <meta http-equiv="Content-Style-Type" content="text/css" /> |
| <link rel="STYLESHEET" href="../book.css" charset="ISO-8859-1" type= |
| "text/css" /> |
| <script language="JavaScript" src= |
| "PLUGINS_ROOT/org.eclipse.help/livehelp.js" type="text/javascript"> |
| </script> |
| <title> |
| Includes |
| </title> |
| |
| <style type="text/css"> |
| /*<![CDATA[*/ |
| span.c1 {color: blue} |
| /*]]>*/ |
| </style> |
| </head> |
| <body> |
| <h2> |
| Includes |
| </h2> |
| <p> |
| Includes are used include parts of other documents into your document. |
| The markup specifies the document and element to include, and before the |
| document is shown to the user, the include element will be |
| <i>replaced</i> with the element referred to. |
| </p> |
| |
| <p> |
| For example, you may wish to show a copyright at the end of each help |
| document you provide. You could copy and paste it in each document, but |
| if the copyright changes (e.g. the copyright year), you have to modify |
| <i>every</i> one of your documents. |
| </p> |
| <p> |
| Instead, you can place the copyright in a separate XHTML file called |
| <code>copyright.xhtml</code> and assign it a unique identifier, like |
| this: |
| </p> |
| <pre> |
| |
| <p <span class="c1">id="copyright"</span>> |
| Copyright 2006 My Company. All rights reserved. |
| </p> |
| </pre> |
| <p> |
| Then for each document, simply include the copyright paragraph: |
| </p> |
| <pre> |
| <p> |
| |
| This is my document. It should have a copyright at the end. |
| </p> |
| <span class= |
| "c1"><include path="my.plugin.id/path/copyright.xhtml/copyright"/></span> |
| </pre> |
| <p> |
| Before the document is sent to the browser to be displayed, the |
| <code>include</code> element will be <i>replaced</i> by the copyright |
| paragraph. |
| </p> |
| |
| <h3> |
| Where can I use includes? |
| </h3> |
| <p> |
| See below for a list of the document types in which includes can be used. |
| The format of the <code>path</code> element of the include <i>depends on |
| the type of document you're including from</i>. As you can see in the |
| example above, the format for XHTML help documents is |
| <code>"<plugin_id>/<path_to_file>/<element_id>"</code>. |
| Refer to the links below for the format for your document type. |
| </p> |
| |
| <ul> |
| <li> |
| <a href="ua_intro_xhtml.htm">Welcome/Intro XML/XHTML format</a> |
| </li> |
| <li> |
| <a href="ua_help_content_xhtml.htm#include_format">Help XHTML |
| format</a> |
| </li> |
| </ul> |
| |
| </body> |
| </html> |