File: Introduction.xml

package info (click to toggle)
publican 2.1-2%2Bsqueeze1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 4,108 kB
  • ctags: 195
  • sloc: xml: 6,511; perl: 6,356; makefile: 30
file content (151 lines) | stat: -rw-r--r-- 7,381 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
<?xml version='1.0' encoding='utf-8' ?>
<!DOCTYPE preface PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
<!ENTITY % BOOK_ENTITIES SYSTEM "Users_Guide.ent">
%BOOK_ENTITIES;
]>
<preface id="pref-Users_Guide-Introduction">
	<title>Introduction</title>
	 <indexterm>
		<primary>Introduction 1</primary>
	</indexterm>
	 <para>
		<indexterm>
			<primary>Introduction 2</primary>
		</indexterm>
		 <application>Publican</application> <indexterm>
			<primary>Introduction 3</primary>
		</indexterm>
		is a tool for publishing material authored in DocBook XML. This guide explains how to create and build books and articles using <application>Publican</application>. It is not a general DocBook XML tutorial; refer to <citetitle>DocBook: The Definitive Guide</citetitle> by Norman Walsh and Leonard Muellner, available at <ulink url="http://www.docbook.org/tdg/en/html/docbook.html" /> for more general help with DocBook XML.
	</para>
	 <para>
		<application>Publican</application> began life as an internal tool used by Red Hat&apos;s Documentation Group (now known as Engineering Content Services). On occasion, this legacy is visible.
	</para>
	 <formalpara id="form-Users_Guide-Introduction-Design">
		<title>Design</title>
		 <para>
			<application>Publican</application> is a publication system, not just a DocBook processing tool. As well as ensuring your DocBook XML is valid, <application>Publican</application> works to ensure your XML is up to publishable standard.
		</para>

	</formalpara>
	 <para>
		The branding functionality allows you to create your own presentation rules and look, overriding many parts of the default style to meet your publishing needs. Choices executed in code, however, are not changeable.
	</para>
	 <para>
		Entities, for example, can be validly defined in any XML file. However, to ensure the DTD declaration is present, valid and standardized, <application>Publican</application> rewrites the declaration in every XML file before it builds a book or article. Consequently, all entities declared in all XML files are lost. <application>Publican</application>, therefore, requires you define entities in the <filename><replaceable>Doc_Name</replaceable>.ent</filename> file (refer to <xref linkend="sect-Users_Guide-Files_in_the_book_directory-Doc_Name.ent" />).
	</para>
	 <para>
		As publishing workflows grow, unrestrained entity definition leads to entity duplication and other practices that cause maintenance difficulties. Consolidating entity definitions in a single, predictable place alleviates these maintenance issues and helps the automation of the build process stay robust.
	</para>
	 <para>
		Entities also present an essentially insurmountable obstacle to quality translation (refer to <xref linkend="sect-Users_Guide-Entities_and_translation" />). Consequently, while we are not reducing the <filename><replaceable>Doc_Name</replaceable>.ent</filename> file&apos;s functionality, we are no longer considering requests to add functionality or features associated with entity use.
	</para>
	<!--  https://bugzilla.redhat.com/show_bug.cgi?id=604255  --><!-- example>
  <title>"Hello world!" in C++</title>
  <programlisting language="C++"><![CDATA[
#include <qpid/messaging/Connection.h>
#include <qpid/messaging/Message.h>
#include <qpid/messaging/Receiver.h>
#include <qpid/messaging/Sender.h>
#include <qpid/messaging/Session.h>

#include <iostream>]]>

using namespace qpid::messaging;

int main(int argc, char** argv) {
    std::string broker = argc > 1 ? argv[1] : "localhost:5672";
    std::string address = argc > 2 ? argv[2] : "amq.topic";
    Connection connection(broker); 
    try {
        connection.open();  <co id="hello-cpp-open" linkends="callout-cpp-open"/>
        Session session = connection.createSession(); <co id="hello-cpp-session" linkends="callout-cpp-session"/>

        Receiver receiver = session.createReceiver(address); <co id="hello-cpp-receiver" linkends="callout-cpp-receiver"/>
        Sender sender = session.createSender(address); <co id="hello-cpp-sender" linkends="callout-cpp-sender"/>

        sender.send(Message("Hello world!"));

        Message message = receiver.fetch(Duration::SECOND * 1); <co id="hello-cpp-fetch" linkends="callout-cpp-fetch"/>
        <![CDATA[std::cout << message.getContent() << std::endl;]]>
        session.acknowledge(); <co id="hello-cpp-acknowledge" linkends="callout-cpp-acknowledge"/>

        connection.close(); <co id="hello-cpp-close" linkends="callout-cpp-close"/>
        return 0;
    } catch(const std::exception&amp; error) {
        <![CDATA[std::cerr << error.what() << std::endl;]]>
        connection.close();
        return 1;   
    }
  }</programlisting>

  <calloutlist>
    <callout id="callout-cpp-open" arearefs="hello-cpp-open">
      <para>Establishes the connection with the messaging broker.</para>
    </callout>
    <callout id="callout-cpp-session" arearefs="hello-cpp-session">
      <para>Creates a session object, which maintains the state of all
interactions with the messaging broker, and manages senders and
receivers.</para>
    </callout>
    <callout id="callout-cpp-receiver" arearefs="hello-cpp-receiver">
      <para>Creates a receiver that reads from the given address.</para>
    </callout>
    <callout id="callout-cpp-sender" arearefs="hello-cpp-sender">
      <para>Creates a sender that sends to the given address.</para>
    </callout>
    <callout id="callout-cpp-fetch" arearefs="hello-cpp-fetch">
      <para>Reads the next message. The duration is optional, if omitted, will
wait indefinitely for the next message.</para>
    </callout>
    <callout id="callout-cpp-acknowledge" arearefs="hello-cpp-acknowledge">
      <para>Acknowledges messages that have been read. To guarantee delivery, a
message remains on the messaging broker until it is acknowledged by a client.
session.acknowledge() acknowledges all unacknowledged messages for the given
session&mdash;this allows acknowledgements to be batched, which is  more
efficient than acknowledging messages individually.</para>
    </callout>
    <callout id="callout-cpp-close" arearefs="hello-cpp-close">
      <para>Closes the connection, all sessions managed by the connection, and
all senders and receivers managed by each session.</para>
    </callout>
  </calloutlist>
</example --> <!-- programlistingco>
    <areaspec>
 <area id="index1" coords="2 65"/>
 <area id="index2" coords="3 11"/>
    </areaspec>
<programlisting language="XML">  &lt;list-index 
        column="column_name"
        base="0|1|..."/&gt;
</programlisting>
    <calloutlist>
 <callout arearefs="index1">
     <para>
  <literal>column_name</literal> (required): the name of the column holding the
  collection index values.
     </para>
 </callout>
 <callout arearefs="index2">
     <para>
  <literal>base</literal> (optional - defaults to <literal>0</literal>): the
value
  of the index column that corresponds to the first element of the list or
array.
     </para>
 </callout>
    </calloutlist>
</programlistingco --> <!--     para>
<equation>
<title>My MathML example</title>
<mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML">
  <mml:mrow>
    <mml:mo>&sum;</mml:mo>
    <mml:mn>4</mml:mn>
    <mml:mo>+</mml:mo>
    <mml:mi>x</mml:mi>
  </mml:mrow>
</mml:math>
</equation>
      </para     -->
</preface>