SlideShare ist ein Scribd-Unternehmen logo
1 von 23
DocBook : The Definitive Guide
PART 1
Getting Started with SGML/XML
HTML and SGML vs. XML
HTML (Hypertext Markup Language) is a way of marking up text and graphics so that the most
popular web browsers can interpret them. HTML consists of a set of markup tags with specific
meanings.
SGML, on the other hand, is an international standard that describes how markup languages are
defined. SGML does not consist of particular tags or the rules for their usage.
XML promises an intelligent improvement over HTML, and compatibility with it is already being
built into the most popular web browsers. XML is not a new markup language designed to
compete with HTML, and it's not designed to create conversion headaches for people with tons
of HTML documents.
Basic SGML/XML Concepts
‱ structured, semantic markup
‱ elements
‱ attributes
‱ entities
Structured and Semantic Markup
SGML and XML use named elements, delimited by angle brackets (“<” and “>”) to identify the
markup in a document. In DocBook, a top-level section is <sect1>, so the title of a top-level
section named My First-Level Header would be identified like this:
<sect1><title>My First-Level Header</title>
Clarity
A title begins with < title> and ends with </title>. The sect1 also has an ending </sect1>, but we
haven't shown the whole section so it's not visible.
Hierarchy
“My First-Level Header” is the title of a top-level section because it occurs inside a title in a
sect1. A title element occurring somewhere else, say in a Chapter element, would be the title of
the chapter.
Plain text
SGML documents can have varying character sets, but most are ASCII. XML documents use the
Unicode character set. This makes SGML and XML documents highly portable across systems
and tools.
DocBook specifies that a third-level section can follow a second-level section but cannot follow a first-
level section without an intervening second-level section
This is valid:
<sect1><title>...</title>
<sect2><title>...</title>
<sect3><title>...</title>
...
</sect3>
</sect2>
</sect1>
This is not:
<sect1><title>...</title>
<sect3><title>...</title>
...
</sect3>
</sect1>
Because an SGML/XML document has an associated DTD that describes the valid, logical
structures of the document, you can test the logical structure of any particular document against
the DTD.
This process is performed by a parser. An SGML processor must begin by parsing the document
and determining if it is valid, that is, if it conforms to the rules specified in the DTD.
What are the shortcomings to structural
authoring?
There are a few significant shortcomings to structured authoring:
It requires a significant change in the authoring process. Writing structured documents is very
different from writing with a typical word processor, and change is difficult.
Because semantics are separate from appearance, in order to publish an SGML/XML document,
a stylesheet or other tool must create the presentational form from the structural form
Authoring tools for SGML documents can generally be pretty expensive. While it's not entirely
unreasonable to edit SGML/XML documents with a simple text editor,
Elements and Attributes
SGML/XML markup consists primarily of elements, attributes, and entities. Elements are the
terms we have been speaking about most, like sect1, that describe a document's content and
structure. Most elements are represented by pairs of tags and mark the start and end of the
construct they surround—for example, the SGML source for this particular paragraph begins
with a <para> tag and ends with a </para> tag. Some elements are “empty”.
Elements can, but don't necessarily, include one or more attributes, which are additional terms
that extend the function or refine the content of a given element. For instance, in DocBook a
<sect1> start tag can contain an identifier—an id attribute—that will ultimately allow the writer
to cross-reference it or enable a reader to retrieve it. End tags cannot contain attributes. A
<sect1> element with an id attribute looks like this:
<sect1 id="idvalue">
In SGML, the catalog of attributes that can occur on an element is predefined
The id attribute is one half of a cross reference.
An idref attribute on another element, for example <xref linkend=”idvalue” >, provides the other
half
Entities
Entities are a fundamental concept in SGML and XML, and can be somewhat daunting at first.
They serve a number of related, but slightly different functions, and this makes them a little bit
complicated.
In the most general terms, entities allow you to assign a name to some chunk of data, and use
that name to refer to that data. The complexity arises because there are two different contexts
in which you can use entities (in the DTD and in your documents), two types of entities (parsed
and unparsed), and two or three different ways in which the entities can point to the chunk of
data that they name.
General Entities
In use, general entities are introduced with an ampersand (&) and end with a semicolon (;).
Within the category of general entities, there are two types: internal general entities and
external general entities
Internal general entities
With internal entities, you can associate an essentially arbitrary piece of text (which may have
other markup, including references to other entities) with a name. You can then include that
text by referring to its name.
External general entities
With external entities, you can reference other documents from within your document. If these
entities contain document text (SGML or XML), then references to them cause the parser to
insert the text of the external file directly into your document (these are called parsed entities).
In this way, you can use entities to divide your single, logical document into physically distinct
chunks
For example, you might break your document into four chapters and store them in
separate files. At the top of your document, you would include entity declarations to reference
the four files:
<!ENTITY ch01 SYSTEM "ch01.sgm">
<!ENTITY ch02 SYSTEM "ch02.sgm">
<!ENTITY ch03 SYSTEM "ch03.sgm">
<!ENTITY ch04 SYSTEM "ch04.sgm">
Your Book now consists simply of references to the entities:
<book>
&ch01;
&ch02;
&ch03;
&ch04;
</book>
Sometimes it's useful to reference external files that don't contain document text. For example,
you might want to reference an external graphic. You can do this with entities by declaring the
type of data that's in the entity using a notation (these are called unparsed entities). For
example, the following declaration declares the entity tree as an encapsulated PostScript image:
Special characters
In order for the parser to recognize markup in your document, it must be able to distinguish
markup from content. It does this with two special characters: “<,” which identifies the
beginning of a start or end tag, and “&,” which identifies the beginning of an entity reference.
If you want these characters to have their literal value, they must be encoded as entity
references in your document. The entity reference &lt; produces a left angle bracket; &amp.
If you do not encode each of these as their respective entity references, then an SGML parser or
application is likely to interpret them as characters introducing elements or entities (an XML
parser will always interpret them this way); consequently, they won't appear as you intended.
In SGML, character entities are frequently declared using a third entity category (one that we
deliberately chose to overlook), called data entities. In XML, these are declared using numeric
character references. Numeric character references resemble entity references, but technically
aren't the same. They have the form &#999;, in which “999” is the numeric character number.
In XML, the numeric character number is always the Unicode character number. In addition,
XML allows hexadecimal numeric character references of the form &#xhhhh;. In SGML, the
numeric character number is a number from the document character set that's declared in the
SGML declaration.
Parameter Entities
Parameter entities are only recognized in markup declarations (in the DTD, for example). Instead
of beginning with an ampersand, they begin with a percent sign.
Marked sections
You might use a parameter entity reference in an SGML document in a marked section. Marking
sections is a mechanism for indicating that special processing should apply to a particular block
of text. Marked sections are introduced by the special sequence <![keyword[ and end with ]]>.
The most common keywords are INCLUDE, which indicates that the text in the marked section
should be included in the document; IGNORE, which indicates that the text in the marked
section should be ignored (it completely disappears from the parsed document); and CDATA,
which indicates that all markup characters within that section should be ignored except for the
closing characters ]]>.
In SGML, these keywords can be parameter entities. For example, you might declare the
following parameter entity
in your document:
<!ENTITY % draft "INCLUDE">

Weitere Àhnliche Inhalte

Was ist angesagt?

XML Introduction
XML IntroductionXML Introduction
XML IntroductionBikash chhetri
 
Xml dtd- Document Type Definition- Web Technology
Xml dtd- Document Type Definition- Web TechnologyXml dtd- Document Type Definition- Web Technology
Xml dtd- Document Type Definition- Web TechnologyRajan Shah
 
XML Schema
XML SchemaXML Schema
XML Schemayht4ever
 
4 xml namespaces and xml schema
4   xml namespaces and xml schema4   xml namespaces and xml schema
4 xml namespaces and xml schemagauravashq
 
Intro to xml
Intro to xmlIntro to xml
Intro to xmlTarun Jain
 
3 xml namespaces and xml schema
3   xml namespaces and xml schema3   xml namespaces and xml schema
3 xml namespaces and xml schemagauravashq
 
Xml Java
Xml JavaXml Java
Xml Javacbee48
 
2 dtd - validating xml documents
2   dtd - validating xml documents2   dtd - validating xml documents
2 dtd - validating xml documentsgauravashq
 
DTD
DTDDTD
DTDKumar
 
XML, DTD & XSD Overview
XML, DTD & XSD OverviewXML, DTD & XSD Overview
XML, DTD & XSD OverviewPradeep Rapolu
 
Difference between dtd and xsd
Difference between dtd and xsdDifference between dtd and xsd
Difference between dtd and xsdUmar Ali
 
Xml Presentation-1
Xml Presentation-1Xml Presentation-1
Xml Presentation-1Sudharsan S
 
XML's validation - DTD
XML's validation - DTDXML's validation - DTD
XML's validation - DTDvidede_group
 
Introduction to DTD
Introduction to DTDIntroduction to DTD
Introduction to DTDtorp42
 

Was ist angesagt? (20)

XML Introduction
XML IntroductionXML Introduction
XML Introduction
 
Xml dtd- Document Type Definition- Web Technology
Xml dtd- Document Type Definition- Web TechnologyXml dtd- Document Type Definition- Web Technology
Xml dtd- Document Type Definition- Web Technology
 
XML Schema
XML SchemaXML Schema
XML Schema
 
4 xml namespaces and xml schema
4   xml namespaces and xml schema4   xml namespaces and xml schema
4 xml namespaces and xml schema
 
Intro to xml
Intro to xmlIntro to xml
Intro to xml
 
Document type definitions part 1
Document type definitions part 1Document type definitions part 1
Document type definitions part 1
 
3 xml namespaces and xml schema
3   xml namespaces and xml schema3   xml namespaces and xml schema
3 xml namespaces and xml schema
 
Xml Java
Xml JavaXml Java
Xml Java
 
2 dtd - validating xml documents
2   dtd - validating xml documents2   dtd - validating xml documents
2 dtd - validating xml documents
 
Xml 1
Xml 1Xml 1
Xml 1
 
Dtd
DtdDtd
Dtd
 
Xml by Luqman
Xml by LuqmanXml by Luqman
Xml by Luqman
 
DTD
DTDDTD
DTD
 
XML, DTD & XSD Overview
XML, DTD & XSD OverviewXML, DTD & XSD Overview
XML, DTD & XSD Overview
 
Difference between dtd and xsd
Difference between dtd and xsdDifference between dtd and xsd
Difference between dtd and xsd
 
DTD
DTDDTD
DTD
 
Xml Presentation-1
Xml Presentation-1Xml Presentation-1
Xml Presentation-1
 
XML's validation - DTD
XML's validation - DTDXML's validation - DTD
XML's validation - DTD
 
XML Databases
XML DatabasesXML Databases
XML Databases
 
Introduction to DTD
Introduction to DTDIntroduction to DTD
Introduction to DTD
 

Andere mochten auch

Basics of XML
Basics of XMLBasics of XML
Basics of XMLindiangarg
 
Remote Login
Remote LoginRemote Login
Remote Loginguest095022
 
Introduction to XML
Introduction to XMLIntroduction to XML
Introduction to XMLyht4ever
 
Xml ppt
Xml pptXml ppt
Xml pptseemadav1
 
File Transfer Protocol
File Transfer ProtocolFile Transfer Protocol
File Transfer Protocolguest029bcd
 

Andere mochten auch (8)

Basics of XML
Basics of XMLBasics of XML
Basics of XML
 
Remote login
Remote loginRemote login
Remote login
 
Sgml and xml
Sgml and xmlSgml and xml
Sgml and xml
 
Remote Login
Remote LoginRemote Login
Remote Login
 
Xml parsers
Xml parsersXml parsers
Xml parsers
 
Introduction to XML
Introduction to XMLIntroduction to XML
Introduction to XML
 
Xml ppt
Xml pptXml ppt
Xml ppt
 
File Transfer Protocol
File Transfer ProtocolFile Transfer Protocol
File Transfer Protocol
 

Ähnlich wie Docbook

Sgml and xml
Sgml and xmlSgml and xml
Sgml and xmlJaya Kumari
 
Oracle soa xml faq
Oracle soa xml faqOracle soa xml faq
Oracle soa xml faqxavier john
 
Xml viva questions
Xml viva questionsXml viva questions
Xml viva questionsVipul Naik
 
Introduction to XML
Introduction to XMLIntroduction to XML
Introduction to XMLPrabu U
 
Web engineering UNIT IV as per RGPV syllabus
Web engineering UNIT IV as per RGPV syllabusWeb engineering UNIT IV as per RGPV syllabus
Web engineering UNIT IV as per RGPV syllabusNANDINI SHARMA
 
chapter 4 web authoring unit 4 xml.pptx
chapter 4 web authoring  unit 4 xml.pptxchapter 4 web authoring  unit 4 xml.pptx
chapter 4 web authoring unit 4 xml.pptxamare63
 
XML notes.pptx
XML notes.pptxXML notes.pptx
XML notes.pptxAmarYa2
 
Web engineering notes unit 4
Web engineering notes unit 4Web engineering notes unit 4
Web engineering notes unit 4inshu1890
 
Jaxp Xmltutorial 11 200108
Jaxp Xmltutorial 11 200108Jaxp Xmltutorial 11 200108
Jaxp Xmltutorial 11 200108nit Allahabad
 
XML-Unit 1.ppt
XML-Unit 1.pptXML-Unit 1.ppt
XML-Unit 1.pptssuseree7dcd
 
Ch2 neworder
Ch2 neworderCh2 neworder
Ch2 neworderdavidlahr32
 
XML Presentation-2
XML Presentation-2XML Presentation-2
XML Presentation-2Sudharsan S
 

Ähnlich wie Docbook (20)

Sgml and xml
Sgml and xmlSgml and xml
Sgml and xml
 
Oracle soa xml faq
Oracle soa xml faqOracle soa xml faq
Oracle soa xml faq
 
O9xml
O9xmlO9xml
O9xml
 
Xml viva questions
Xml viva questionsXml viva questions
Xml viva questions
 
Introduction to XML
Introduction to XMLIntroduction to XML
Introduction to XML
 
Xml
XmlXml
Xml
 
Bt0078
Bt0078Bt0078
Bt0078
 
XML.pptx
XML.pptxXML.pptx
XML.pptx
 
Session 1
Session 1Session 1
Session 1
 
Xml
XmlXml
Xml
 
Web engineering UNIT IV as per RGPV syllabus
Web engineering UNIT IV as per RGPV syllabusWeb engineering UNIT IV as per RGPV syllabus
Web engineering UNIT IV as per RGPV syllabus
 
chapter 4 web authoring unit 4 xml.pptx
chapter 4 web authoring  unit 4 xml.pptxchapter 4 web authoring  unit 4 xml.pptx
chapter 4 web authoring unit 4 xml.pptx
 
Chapter 18
Chapter 18Chapter 18
Chapter 18
 
XML notes.pptx
XML notes.pptxXML notes.pptx
XML notes.pptx
 
Web engineering notes unit 4
Web engineering notes unit 4Web engineering notes unit 4
Web engineering notes unit 4
 
XML
XMLXML
XML
 
Jaxp Xmltutorial 11 200108
Jaxp Xmltutorial 11 200108Jaxp Xmltutorial 11 200108
Jaxp Xmltutorial 11 200108
 
XML-Unit 1.ppt
XML-Unit 1.pptXML-Unit 1.ppt
XML-Unit 1.ppt
 
Ch2 neworder
Ch2 neworderCh2 neworder
Ch2 neworder
 
XML Presentation-2
XML Presentation-2XML Presentation-2
XML Presentation-2
 

Mehr von Raghu nath

Mongo db
Mongo dbMongo db
Mongo dbRaghu nath
 
Ftp (file transfer protocol)
Ftp (file transfer protocol)Ftp (file transfer protocol)
Ftp (file transfer protocol)Raghu nath
 
MS WORD 2013
MS WORD 2013MS WORD 2013
MS WORD 2013Raghu nath
 
Javascript part1
Javascript part1Javascript part1
Javascript part1Raghu nath
 
Regular expressions
Regular expressionsRegular expressions
Regular expressionsRaghu nath
 
Selection sort
Selection sortSelection sort
Selection sortRaghu nath
 
Binary search
Binary search Binary search
Binary search Raghu nath
 
JSON(JavaScript Object Notation)
JSON(JavaScript Object Notation)JSON(JavaScript Object Notation)
JSON(JavaScript Object Notation)Raghu nath
 
Stemming algorithms
Stemming algorithmsStemming algorithms
Stemming algorithmsRaghu nath
 
Step by step guide to install dhcp role
Step by step guide to install dhcp roleStep by step guide to install dhcp role
Step by step guide to install dhcp roleRaghu nath
 
Network essentials chapter 4
Network essentials  chapter 4Network essentials  chapter 4
Network essentials chapter 4Raghu nath
 
Network essentials chapter 3
Network essentials  chapter 3Network essentials  chapter 3
Network essentials chapter 3Raghu nath
 
Network essentials chapter 2
Network essentials  chapter 2Network essentials  chapter 2
Network essentials chapter 2Raghu nath
 
Network essentials - chapter 1
Network essentials - chapter 1Network essentials - chapter 1
Network essentials - chapter 1Raghu nath
 
Python chapter 2
Python chapter 2Python chapter 2
Python chapter 2Raghu nath
 
python chapter 1
python chapter 1python chapter 1
python chapter 1Raghu nath
 
Linux Shell Scripting
Linux Shell ScriptingLinux Shell Scripting
Linux Shell ScriptingRaghu nath
 

Mehr von Raghu nath (20)

Mongo db
Mongo dbMongo db
Mongo db
 
Ftp (file transfer protocol)
Ftp (file transfer protocol)Ftp (file transfer protocol)
Ftp (file transfer protocol)
 
MS WORD 2013
MS WORD 2013MS WORD 2013
MS WORD 2013
 
Msword
MswordMsword
Msword
 
Ms word
Ms wordMs word
Ms word
 
Javascript part1
Javascript part1Javascript part1
Javascript part1
 
Regular expressions
Regular expressionsRegular expressions
Regular expressions
 
Selection sort
Selection sortSelection sort
Selection sort
 
Binary search
Binary search Binary search
Binary search
 
JSON(JavaScript Object Notation)
JSON(JavaScript Object Notation)JSON(JavaScript Object Notation)
JSON(JavaScript Object Notation)
 
Stemming algorithms
Stemming algorithmsStemming algorithms
Stemming algorithms
 
Step by step guide to install dhcp role
Step by step guide to install dhcp roleStep by step guide to install dhcp role
Step by step guide to install dhcp role
 
Network essentials chapter 4
Network essentials  chapter 4Network essentials  chapter 4
Network essentials chapter 4
 
Network essentials chapter 3
Network essentials  chapter 3Network essentials  chapter 3
Network essentials chapter 3
 
Network essentials chapter 2
Network essentials  chapter 2Network essentials  chapter 2
Network essentials chapter 2
 
Network essentials - chapter 1
Network essentials - chapter 1Network essentials - chapter 1
Network essentials - chapter 1
 
Python chapter 2
Python chapter 2Python chapter 2
Python chapter 2
 
python chapter 1
python chapter 1python chapter 1
python chapter 1
 
Linux Shell Scripting
Linux Shell ScriptingLinux Shell Scripting
Linux Shell Scripting
 
Perl
PerlPerl
Perl
 

KĂŒrzlich hochgeladen

INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxHumphrey A Beña
 
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxGrade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxChelloAnnAsuncion2
 
USPSÂź Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPSÂź Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPSÂź Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPSÂź Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...Postal Advocate Inc.
 
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxBarangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxCarlos105
 
Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxKarra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxAshokKarra1
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Celine George
 
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSJoshuaGantuangco2
 
Judging the Relevance and worth of ideas part 2.pptx
Judging the Relevance  and worth of ideas part 2.pptxJudging the Relevance  and worth of ideas part 2.pptx
Judging the Relevance and worth of ideas part 2.pptxSherlyMaeNeri
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersSabitha Banu
 
HỌC TỐT TIáșŸNG ANH 11 THEO CHÆŻÆ NG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIáșŸT - Cáșą NĂ...
HỌC TỐT TIáșŸNG ANH 11 THEO CHÆŻÆ NG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIáșŸT - Cáșą NĂ...HỌC TỐT TIáșŸNG ANH 11 THEO CHÆŻÆ NG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIáșŸT - Cáșą NĂ...
HỌC TỐT TIáșŸNG ANH 11 THEO CHÆŻÆ NG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIáșŸT - Cáșą NĂ...Nguyen Thanh Tu Collection
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPCeline George
 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfTechSoup
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxDr.Ibrahim Hassaan
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfSpandanaRallapalli
 

KĂŒrzlich hochgeladen (20)

INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
 
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxGrade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
Raw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptxRaw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptx
 
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptxYOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
 
USPSÂź Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPSÂź Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPSÂź Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPSÂź Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
 
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxBarangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
 
Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxKarra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptx
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
 
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
 
Judging the Relevance and worth of ideas part 2.pptx
Judging the Relevance  and worth of ideas part 2.pptxJudging the Relevance  and worth of ideas part 2.pptx
Judging the Relevance and worth of ideas part 2.pptx
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginners
 
HỌC TỐT TIáșŸNG ANH 11 THEO CHÆŻÆ NG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIáșŸT - Cáșą NĂ...
HỌC TỐT TIáșŸNG ANH 11 THEO CHÆŻÆ NG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIáșŸT - Cáșą NĂ...HỌC TỐT TIáșŸNG ANH 11 THEO CHÆŻÆ NG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIáșŸT - Cáșą NĂ...
HỌC TỐT TIáșŸNG ANH 11 THEO CHÆŻÆ NG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIáșŸT - Cáșą NĂ...
 
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptxFINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERP
 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptx
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdf
 

Docbook

  • 1. DocBook : The Definitive Guide PART 1
  • 2. Getting Started with SGML/XML HTML and SGML vs. XML HTML (Hypertext Markup Language) is a way of marking up text and graphics so that the most popular web browsers can interpret them. HTML consists of a set of markup tags with specific meanings. SGML, on the other hand, is an international standard that describes how markup languages are defined. SGML does not consist of particular tags or the rules for their usage.
  • 3. XML promises an intelligent improvement over HTML, and compatibility with it is already being built into the most popular web browsers. XML is not a new markup language designed to compete with HTML, and it's not designed to create conversion headaches for people with tons of HTML documents.
  • 4. Basic SGML/XML Concepts ‱ structured, semantic markup ‱ elements ‱ attributes ‱ entities
  • 5. Structured and Semantic Markup SGML and XML use named elements, delimited by angle brackets (“<” and “>”) to identify the markup in a document. In DocBook, a top-level section is <sect1>, so the title of a top-level section named My First-Level Header would be identified like this: <sect1><title>My First-Level Header</title> Clarity A title begins with < title> and ends with </title>. The sect1 also has an ending </sect1>, but we haven't shown the whole section so it's not visible.
  • 6. Hierarchy “My First-Level Header” is the title of a top-level section because it occurs inside a title in a sect1. A title element occurring somewhere else, say in a Chapter element, would be the title of the chapter. Plain text SGML documents can have varying character sets, but most are ASCII. XML documents use the Unicode character set. This makes SGML and XML documents highly portable across systems and tools.
  • 7. DocBook specifies that a third-level section can follow a second-level section but cannot follow a first- level section without an intervening second-level section This is valid: <sect1><title>...</title> <sect2><title>...</title> <sect3><title>...</title> ... </sect3> </sect2> </sect1>
  • 9. Because an SGML/XML document has an associated DTD that describes the valid, logical structures of the document, you can test the logical structure of any particular document against the DTD. This process is performed by a parser. An SGML processor must begin by parsing the document and determining if it is valid, that is, if it conforms to the rules specified in the DTD.
  • 10. What are the shortcomings to structural authoring? There are a few significant shortcomings to structured authoring: It requires a significant change in the authoring process. Writing structured documents is very different from writing with a typical word processor, and change is difficult. Because semantics are separate from appearance, in order to publish an SGML/XML document, a stylesheet or other tool must create the presentational form from the structural form Authoring tools for SGML documents can generally be pretty expensive. While it's not entirely unreasonable to edit SGML/XML documents with a simple text editor,
  • 11. Elements and Attributes SGML/XML markup consists primarily of elements, attributes, and entities. Elements are the terms we have been speaking about most, like sect1, that describe a document's content and structure. Most elements are represented by pairs of tags and mark the start and end of the construct they surround—for example, the SGML source for this particular paragraph begins with a <para> tag and ends with a </para> tag. Some elements are “empty”.
  • 12. Elements can, but don't necessarily, include one or more attributes, which are additional terms that extend the function or refine the content of a given element. For instance, in DocBook a <sect1> start tag can contain an identifier—an id attribute—that will ultimately allow the writer to cross-reference it or enable a reader to retrieve it. End tags cannot contain attributes. A <sect1> element with an id attribute looks like this:
  • 13. <sect1 id="idvalue"> In SGML, the catalog of attributes that can occur on an element is predefined The id attribute is one half of a cross reference. An idref attribute on another element, for example <xref linkend=”idvalue” >, provides the other half
  • 14. Entities Entities are a fundamental concept in SGML and XML, and can be somewhat daunting at first. They serve a number of related, but slightly different functions, and this makes them a little bit complicated. In the most general terms, entities allow you to assign a name to some chunk of data, and use that name to refer to that data. The complexity arises because there are two different contexts in which you can use entities (in the DTD and in your documents), two types of entities (parsed and unparsed), and two or three different ways in which the entities can point to the chunk of data that they name.
  • 15. General Entities In use, general entities are introduced with an ampersand (&) and end with a semicolon (;). Within the category of general entities, there are two types: internal general entities and external general entities Internal general entities With internal entities, you can associate an essentially arbitrary piece of text (which may have other markup, including references to other entities) with a name. You can then include that text by referring to its name.
  • 16. External general entities With external entities, you can reference other documents from within your document. If these entities contain document text (SGML or XML), then references to them cause the parser to insert the text of the external file directly into your document (these are called parsed entities). In this way, you can use entities to divide your single, logical document into physically distinct chunks For example, you might break your document into four chapters and store them in separate files. At the top of your document, you would include entity declarations to reference the four files:
  • 17. <!ENTITY ch01 SYSTEM "ch01.sgm"> <!ENTITY ch02 SYSTEM "ch02.sgm"> <!ENTITY ch03 SYSTEM "ch03.sgm"> <!ENTITY ch04 SYSTEM "ch04.sgm">
  • 18. Your Book now consists simply of references to the entities: <book> &ch01; &ch02; &ch03; &ch04; </book>
  • 19. Sometimes it's useful to reference external files that don't contain document text. For example, you might want to reference an external graphic. You can do this with entities by declaring the type of data that's in the entity using a notation (these are called unparsed entities). For example, the following declaration declares the entity tree as an encapsulated PostScript image:
  • 20. Special characters In order for the parser to recognize markup in your document, it must be able to distinguish markup from content. It does this with two special characters: “<,” which identifies the beginning of a start or end tag, and “&,” which identifies the beginning of an entity reference. If you want these characters to have their literal value, they must be encoded as entity references in your document. The entity reference &lt; produces a left angle bracket; &amp. If you do not encode each of these as their respective entity references, then an SGML parser or application is likely to interpret them as characters introducing elements or entities (an XML parser will always interpret them this way); consequently, they won't appear as you intended.
  • 21. In SGML, character entities are frequently declared using a third entity category (one that we deliberately chose to overlook), called data entities. In XML, these are declared using numeric character references. Numeric character references resemble entity references, but technically aren't the same. They have the form &#999;, in which “999” is the numeric character number. In XML, the numeric character number is always the Unicode character number. In addition, XML allows hexadecimal numeric character references of the form &#xhhhh;. In SGML, the numeric character number is a number from the document character set that's declared in the SGML declaration.
  • 22. Parameter Entities Parameter entities are only recognized in markup declarations (in the DTD, for example). Instead of beginning with an ampersand, they begin with a percent sign. Marked sections You might use a parameter entity reference in an SGML document in a marked section. Marking sections is a mechanism for indicating that special processing should apply to a particular block of text. Marked sections are introduced by the special sequence <![keyword[ and end with ]]>.
  • 23. The most common keywords are INCLUDE, which indicates that the text in the marked section should be included in the document; IGNORE, which indicates that the text in the marked section should be ignored (it completely disappears from the parsed document); and CDATA, which indicates that all markup characters within that section should be ignored except for the closing characters ]]>. In SGML, these keywords can be parameter entities. For example, you might declare the following parameter entity in your document: <!ENTITY % draft "INCLUDE">