blob: 90af295808fc7fefc269cd212218963513675dcb [file] [log] [blame]
<!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>
&lt;p <span class="c1">id="copyright"</span>&gt;
Copyright 2006 My Company. All rights reserved.
&lt;/p&gt;
</pre>
<p>
Then for each document, simply include the copyright paragraph:
</p>
<pre>
&lt;p&gt;
This is my document. It should have a copyright at the end.
&lt;/p&gt;
<span class=
"c1">&lt;include path="my.plugin.id/path/copyright.xhtml/copyright"/&gt;</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>"&lt;plugin_id&gt;/&lt;path_to_file&gt;/&lt;element_id&gt;"</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>