The translation is temporarily closed for contributions due to maintenance, please come back later.

Source string Read only

(itstool) path: sect3/title
Context English State
Use Parameter Entities to Include Files
The previous steps must have completed before this step.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"" [
<!ENTITY % entities SYSTEM "entities.ent"> %entities;

<tag class="starttag">html xmlns=""</tag>
<tag class="starttag">head</tag>
<tag class="starttag">title</tag>An Example XHTML File<tag class="endtag">title</tag>
<tag class="endtag">head</tag>

<tag class="starttag">body</tag>
<tag class="starttag">p</tag>The current version of this document is: &amp;version;<tag class="endtag">p</tag>

<tag class="endtag">body</tag>
<tag class="endtag">html</tag>
Create a new file called <filename>entities.ent</filename> with this content:
&lt;!ENTITY version "1.1"&gt;
&lt;!ENTITY para1 SYSTEM "para1.xml"&gt;
&lt;!ENTITY para2 SYSTEM "para2.xml"&gt;
&lt;!ENTITY para3 SYSTEM "para3.xml"&gt;
Marked Sections
<acronym>XML</acronym> provides a mechanism to indicate that particular pieces of the document should be processed in a special way. These are called <quote>marked sections</quote>.
Structure of a Marked Section
Contents of marked section
As expected of an <acronym>XML</acronym> construct, a marked section starts with <literal>&lt;!</literal>.
The first square bracket begins the marked section.
<replaceable>KEYWORD</replaceable> describes how this marked section is to be processed by the parser.
The second square bracket indicates the start of the marked section's content.
The marked section is finished by closing the two square brackets, and then returning to the document context from the <acronym>XML</acronym> context with <literal>&gt;</literal>.
Marked Section Keywords
These keywords denote the marked sections <emphasis>content model</emphasis>, and allow you to change it from the default.
When an <acronym>XML</acronym> parser is processing a document, it keeps track of the <quote>content model</quote>.
The content model describes the content the parser is expecting to see and what it will do with that content.
The <literal>CDATA</literal> content model is one of the most useful.
<literal>CDATA</literal> is for <quote>Character Data</quote>. When the parser is in this content model, it expects to see only characters. In this model the <literal>&lt;</literal> and <literal>&amp;</literal> symbols lose their special status, and will be treated as ordinary characters.
When using <literal>CDATA</literal> in examples of text marked up in <acronym>XML</acronym>, remember that the content of <literal>CDATA</literal> is not validated. The included text must be check with other means. For example, the content could be written in another document, validated, and then pasted into the <literal>CDATA</literal> section.
Using a <literal>CDATA</literal> Marked Section
<tag class="starttag">para</tag>Here is an example of how to include some text that contains
many <tag class="starttag">literal</tag>&amp;lt;<tag class="endtag">literal</tag> and <tag class="starttag">literal</tag>&amp;amp;<tag class="endtag">literal</tag>
symbols. The sample text is a fragment of
<tag class="starttag">acronym</tag>XHTML<tag class="endtag">acronym</tag>. The surrounding text (<tag class="starttag">para</tag> and
<tag class="starttag">programlisting</tag>) are from DocBook.<tag class="endtag">para</tag>

<tag class="starttag">programlisting</tag>&lt;![CDATA[<tag class="starttag">p</tag>This is a sample that shows some of the
elements within <tag class="starttag">acronym</tag>XHTML<tag class="endtag">acronym</tag>. Since the angle
brackets are used so many times, it is simpler to say the whole
example is a CDATA marked section than to use the entity names for
the left and right angle brackets throughout.<tag class="endtag">p</tag>

<tag class="starttag">ul</tag>
<tag class="starttag">li</tag>This is a listitem<tag class="endtag">li</tag>
<tag class="starttag">li</tag>This is a second listitem<tag class="endtag">li</tag>
<tag class="starttag">li</tag>This is a third listitem<tag class="endtag">li</tag>
<tag class="endtag">ul</tag>

<tag class="starttag">p</tag>This is the end of the example.<tag class="endtag">p</tag>]]&gt;<tag class="endtag">programlisting</tag>
<literal>INCLUDE</literal> and <literal>IGNORE</literal>
When the keyword is <literal>INCLUDE</literal>, then the contents of the marked section will be processed. When the keyword is <literal>IGNORE</literal>, the marked section is ignored and will not be processed. It will not appear in the output.
Using <literal>INCLUDE</literal> and <literal>IGNORE</literal> in Marked Sections
This text will be processed and included.

This text will not be processed or included.
By itself, this is not too useful. Text to be removed from the document could be cut out, or wrapped in comments.
It becomes more useful when controlled by <link linkend="xml-primer-parameter-entities">parameter entities</link>, yet this usage is limited to entity files.
For example, suppose that documentation was produced in a hard-copy version and an electronic version. Some extra text is desired in the electronic version content that was not to appear in the hard-copy.


No matching activity found.

Browse all component changes

Source information

Source string comment
(itstool) path: sect3/title
Source string location
String age
a year ago
Source string age
a year ago
Translation file
books/fdp-primer.pot, string 545