Source string Read only

(itstool) path: sect1/para
107/1070
Context English State
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.
Create an entity file that defines general entities to include each chapter and guard these definitions with a parameter entity that can be set to either <literal>INCLUDE</literal> or <literal>IGNORE</literal> to control whether the entity is defined. After these conditional general entity definitions, place one more definition for each general entity to set them to an empty value. This technique makes use of the fact that entity definitions cannot be overridden but the first definition always takes effect. So the inclusion of the chapter is controlled with the corresponding parameter entity. Set to <literal>INCLUDE</literal>, the first general entity definition will be read and the second one will be ignored. Set to <literal>IGNORE</literal>, the first definition will be ignored and the second one will take effect.
Using a Parameter Entity to Control a Marked Section
&lt;!ENTITY % electronic.copy "INCLUDE"&gt;

&lt;![%electronic.copy;[
&lt;!ENTITY chap.preface SYSTEM "preface.xml"&gt;
]]&gt;

&lt;!ENTITY chap.preface ""&gt;
When producing the hard-copy version, change the parameter entity's definition to:
&lt;!ENTITY % electronic.copy "IGNORE"&gt;
Modify <filename>entities.ent</filename> to contain the following:
&lt;!ENTITY version "1.1"&gt;
&lt;!ENTITY % conditional.text "IGNORE"&gt;

&lt;![%conditional.text;[
&lt;!ENTITY para1 SYSTEM "para1.xml"&gt;
]]&gt;

&lt;!ENTITY para1 ""&gt;

&lt;!ENTITY para2 SYSTEM "para2.xml"&gt;
&lt;!ENTITY para3 SYSTEM "para3.xml"&gt;
Normalize <filename>example.xml</filename> and notice that the conditional text is not present in the output document. Set the parameter entity guard to <literal>INCLUDE</literal> and regenerate the normalized document and the text will appear again. This method makes sense if there are more conditional chunks depending on the same condition. For example, to control generating printed or online text.
Conclusion
That is the conclusion of this <acronym>XML</acronym> primer. For reasons of space and complexity, several things have not been covered in depth (or at all). However, the previous sections cover enough <acronym>XML</acronym> to introduce the organization of the <acronym>FDP</acronym> documentation.
<acronym>XHTML</acronym> Markup
Introduction
This chapter describes usage of the <acronym>XHTML</acronym> markup language used for the FreeBSD web site.
<acronym>XHTML</acronym> is the <acronym>XML</acronym> version of the HyperText Markup Language, the markup language of choice on the World Wide Web. More information can be found at <uri xlink:href="http://www.w3.org/">http://www.w3.org/</uri>.
<acronym>XHTML</acronym> is used to mark up pages on the FreeBSD web site. It is usually not used to mark up other documentation, since DocBook offers a far richer set of elements from which to choose. Consequently, <acronym>XHTML</acronym> pages will normally only be encountered when writing for the web site.
<acronym>HTML</acronym> has gone through a number of versions. The <acronym>XML</acronym>-compliant version described here is called <acronym>XHTML</acronym>. The latest widespread version is <acronym>XHTML</acronym> 1.0, available in both <emphasis>strict</emphasis> and <emphasis>transitional</emphasis> variants.
The <acronym>XHTML</acronym> <acronym>DTDs</acronym> are available from the Ports Collection in <package>textproc/xhtml</package>. They are automatically installed by the <package>textproc/docproj</package> port.
This is <emphasis>not</emphasis> an exhaustive list of elements, since that would just repeat the documentation for <acronym>XHTML</acronym>. The aim is to list those elements most commonly used. Please post questions about elements or uses not covered here to the <link xlink:href="http://lists.FreeBSD.org/mailman/listinfo/freebsd-doc">FreeBSD documentation project mailing list</link>.
Inline Versus Block
In the remainder of this document, when describing elements, <emphasis>inline</emphasis> means that the element can occur within a block element, and does not cause a line break. A <emphasis>block</emphasis> element, by comparison, will cause a line break (and other processing) when it is encountered.
Formal Public Identifier (<acronym>FPI</acronym>)
There are a number of <acronym>XHTML</acronym> <acronym>FPI</acronym>s, depending upon the version, or <emphasis>level</emphasis> of <acronym>XHTML</acronym> to which a document conforms. Most <acronym>XHTML</acronym> documents on the FreeBSD web site comply with the transitional version of <acronym>XHTML</acronym> 1.0.
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
Sectional Elements
An <acronym>XHTML</acronym> document is normally split into two sections. The first section, called the <emphasis>head</emphasis>, contains meta-information about the document, such as its title, the name of the author, the parent document, and so on. The second section, the <emphasis>body</emphasis>, contains content that will be displayed to the user.
These sections are indicated with <tag>head</tag> and <tag>body</tag> elements respectively. These elements are contained within the top-level <tag>html</tag> element.
Normal <acronym>XHTML</acronym> Document Structure
<tag class="starttag">html xmlns="http://www.w3.org/1999/xhtml"</tag>
<tag class="starttag">head</tag>
<tag class="starttag">title</tag><replaceable>The Document's Title</replaceable><tag class="endtag">title</tag>
<tag class="endtag">head</tag>

<tag class="starttag">body</tag>



<tag class="endtag">body</tag>
<tag class="endtag">html</tag>

Loading…

No matching activity found.

Browse all component changes

Glossary

English English
No related strings found in the glossary.

Source information

Source string comment
(itstool) path: sect1/para
Flags
read-only
Source string location
book.translate.xml:3481
String age
a year ago
Source string age
a year ago
Translation file
books/fdp-primer.pot, string 573