SlideShare ist ein Scribd-Unternehmen logo
1 von 28
Document Type
Definition
DTD
Document Tvpe Definitions
(DTDs) define an XML document's structure (e.g., what elements,attributes, etc. are permitted
in the document). An XML document is not required to have a corresponding DTD. However,
DTDs are often recommended to ensure document conformity, especially in business-to-
business (B2B) transactions, where XML documents are exchanged. DTDs specify an XML
document's structure and are themselves defined using EBNF (Extended Backus-Naur Form)
grammar-not the XML syntax.
Observation:
A transition is underway in the XML community from DTDs to Schema, which improve upon
DTDs. Schema use XML syntax, not EBNF grammar.
Parsers, Well-formed and Valid XML Documents:
Parsers are generally classified as validating or nonvalidating. A validating parser is able to read
the DTD and determine whether or not the XML document conforms to it. If the document
conforms to the DTD, it is referred to as valid. If the document fails to conform to the DTD but
is syntactically correct, it is well formed but not valid. By definition, a valid document is well
formed. A nonvalidating parser is able to read the DTD, but cannot check the document against
the DTD for conformity. If the document is syntactically correct, it is well formed.
Document Type Declaration
DTDs are introduced into XML documents using the document type declaration (i.e .DOCTYPE).
A document type declaration is placed in the XML document's prolog and begins with
<!DOCTYPE and ends with >. The document type declaration can point to declarations
that are outside the XML document (called the external subset) or can contain the declaration
inside the document (called internal subset).
For example, an internal subset mightlook like
<!DOCTYPE myMessage [
<!ELEMENT myMessage ( #PCDATA )>
]
The first myMessage
is the name of the document type declaration. Anything inside the square brackets ( [ ] )
constitutes the internal subset. As we will see momentarily,
ELEMENT and
#PCDATA are used in "element declarations.“
External subsets physically exist in a different file that typically ends with the .
Dtd extension,although this file extension is not required. External subsets are specified using
either keyword SYSTEM or PUBLIC.
For example. the
DOCTYPE
external subset might look like
<!DOCTYPE myMessage SYSTEM "myDTD.dtd">
which points to the myDTD.dtd document. Using the PUBLIC
keyword indicates that the DTD is widely used (e.g., the DTD for HTML documents). The DTD
may be made available in well-known locations for more efficient downloading. The
DOCTYPE
<!DOCTYPE HTML PUBLIC "-//w3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
uses the PUBLIC
keyword to reference the well-known DTD for HTML version 4.01. XML parsers that do not have
a local copy of the DTD may use the URL provided to download the DTD to perform validation
Both the internal and external subset may be specified at the same time. For example, the
DOCTYPE
<!DOCTYPE myMessage SYSTEM "myDTD.dtd“ <!ELEMENT myElement ( #PCDATA )>
contains declarations from the myDTD.dtd document as well as an internal declaration
Observation:
The document type declaration internal subset plus its external subset form the DTD.
The internal subset is visible only within the document in which it resides. Other external
documents cannot be validated against it. DTDs that are used by many documents should be
placed in the external subset.
Element Type Declarations
Elements are the primary building block used in XML documents and are declared in a DTD
with element type declarations (ELEMENTs). For example, to declare element myMessage,
we might write
The element name (e.g., MyElement) that follows ELEMENT is often called a generic identifier.
The set of parentheses that follow the element name specify the element's allowed content and
is called the content specification.
Keyword
PCDATA
specifies that the element must contain parsable character data. This data will be parsed by the
XML parser, therefore any markup text (i.e., <, >, &, etc.) will be treated as markup.
Error:
Attempting to use the same element name in multiple element type declarations is an error.
Example 1 lists an XML document that contains a reference to an external DTD in the
I)DOCTYPE.
Microsoft's XML Validator will be used to check the document's conformity
against its DTD. To use XML Validator, Internet Explorer 5 is required. Parsers XML4J and
Xerces can be used to check a document's validity against a DTD programmatically. Using Java
and one of these parsers provides a platform-independent way to validate XML documents.
<?xml version = "1.0"?>
<!DOCTYPE myMessage SYSTEM "intro.dtd">
<myMessage>
<message>Welcome to XML!</message>
</myMessage>
Example 1. XML document declaring associated DTD.
The document type declaration is named myMessage-the name of the root element. The
element myMessage contains a single child element named message .
<!ELEMENT myMessage ( message )> <!ELEMENT message ( #PCDATA )> Example 2. Validation
with using an external DTD The DTD declares element myMessage.
Notice that the content specification contains the name message. This indicates that element
myMessage contains exactly one child element named message. Because myMessage can only
have an element as its content, it is said to have element content. Element message whose
content is of type PCDATA. The XML Validator is capable of validating an XML document against
both DTDs and Schemas
Error:
Having a root element name other than the name specified in the document type declaration is
an error.
Document Type Definitions (DTDs) define an XML document's structure (e.g., what
elements, attributes, etc. are permitted in the XML document). An XML document is not
required to have a corresponding DTD. DTDs use EBNF (Extended Backus-Naur Form)
grammar
Parsers are generally classified as validating or nonvalidating. A validating parser is able to
read the DTD and determine whether or not the XML document conforms to it. If the
document conforms to the DTD, it is referred to as valid. If the document fails to conform to
the DTD but is syntactically correct, it is well formed but not valid. By definition, a valid
document is well formed.
A nonvalidating parser is able to read a DTD, but cannot check the document against the
DTD for conformity. If the document is syntactically correct, it is well formed.
DTDs are introduced into XML documents by using the document type declaration (i.e.,
DOCTYPE). The document type declaration can point to declarations that are outside the
XML document (called the external subset) or can contain the declaration inside the
document (called internal subset).
External subsets physically exist in a different file that typically ends with the .dtd
extension, although this file extension is not required. External Subsets are specified using
keyword SYSTEM. Both the internal and external subset may be specified at the same
time
Elements are the primary building block used in XML documents and are declared in a
DTD with element type declarations (ELEMENTs).
The element name that follows ELEMENT is often called a generic identifier. The set of
parentheses that follow the element name specify the element's allowed content and is
called the content specification.
Keyword PCDATA
specifies that the element must contain parsable character data-that is,any text except the
characters less-than ( < ), greater-than ( > ), ampersand ( & ), quote ( ' ) and double quote ( " ).
An XML document is a standalone XML document if it does not reference an external DTD.
An XML element that can only have another element for content, it is said to have element
content.
DTDs allow the document author to define the order and frequency of child elements. The
comma ( , ) - called a sequence - specifies the order in which the elements must occur.
Choices are specified using the pipe ( | ) character. The content specification may contain
any number of pipe character separated choises.
An element's frequency (i.e., number of occurrences) is specified by using either the plus
sign (+), asterisk (*) or question mark (?) occurrence indicator
The frequency of an element group (i.e., two or more elements that occur in some
combinaition) is specified by enclosing the element names inside the content specification
followed by an occurrence indicator
Elements can be further refined by describing the content types they may contain. Content
specification types (e.g., EMPTY, mixed content, ANY, etc.) describe nonelement content.
An element can be declared as having mixed content (i.e., a combination of elements and
PCDATA). The comma ( , ), plus sign ( + ) and question mark ( ? ) occurrence indicators
cannot be used with mixed content elements

Weitere ähnliche Inhalte

Was ist angesagt?

Introduction to XML
Introduction to XMLIntroduction to XML
Introduction to XMLyht4ever
 
Introduction to DTD
Introduction to DTDIntroduction to DTD
Introduction to DTDtorp42
 
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
 
Difference between dtd and xsd
Difference between dtd and xsdDifference between dtd and xsd
Difference between dtd and xsdUmar Ali
 
Xml Java
Xml JavaXml Java
Xml Javacbee48
 
SQL Server - Querying and Managing XML Data
SQL Server - Querying and Managing XML DataSQL Server - Querying and Managing XML Data
SQL Server - Querying and Managing XML DataMarek Maśko
 
4 xml namespaces and xml schema
4   xml namespaces and xml schema4   xml namespaces and xml schema
4 xml namespaces and xml schemagauravashq
 
01 xml document structure
01 xml document structure01 xml document structure
01 xml document structureBaskarkncet
 
3 xml namespaces and xml schema
3   xml namespaces and xml schema3   xml namespaces and xml schema
3 xml namespaces and xml schemagauravashq
 
XML Schema
XML SchemaXML Schema
XML Schemayht4ever
 
Xml For Dummies Chapter 8 Understanding And Using Dt Ds it-slideshares.blog...
Xml For Dummies   Chapter 8 Understanding And Using Dt Ds it-slideshares.blog...Xml For Dummies   Chapter 8 Understanding And Using Dt Ds it-slideshares.blog...
Xml For Dummies Chapter 8 Understanding And Using Dt Ds it-slideshares.blog...phanleson
 
XML, DTD & XSD Overview
XML, DTD & XSD OverviewXML, DTD & XSD Overview
XML, DTD & XSD OverviewPradeep Rapolu
 

Was ist angesagt? (20)

Dtd
DtdDtd
Dtd
 
Introduction to XML
Introduction to XMLIntroduction to XML
Introduction to XML
 
Introduction to DTD
Introduction to DTDIntroduction to DTD
Introduction to DTD
 
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
 
DTD
DTDDTD
DTD
 
Document type definitions part 1
Document type definitions part 1Document type definitions part 1
Document type definitions part 1
 
Difference between dtd and xsd
Difference between dtd and xsdDifference between dtd and xsd
Difference between dtd and xsd
 
XML and DTD
XML and DTDXML and DTD
XML and DTD
 
DTD
DTDDTD
DTD
 
Xml Java
Xml JavaXml Java
Xml Java
 
SQL Server - Querying and Managing XML Data
SQL Server - Querying and Managing XML DataSQL Server - Querying and Managing XML Data
SQL Server - Querying and Managing XML Data
 
XML Introduction
XML IntroductionXML Introduction
XML Introduction
 
4 xml namespaces and xml schema
4   xml namespaces and xml schema4   xml namespaces and xml schema
4 xml namespaces and xml schema
 
Xml2
Xml2Xml2
Xml2
 
01 xml document structure
01 xml document structure01 xml document structure
01 xml document structure
 
3 xml namespaces and xml schema
3   xml namespaces and xml schema3   xml namespaces and xml schema
3 xml namespaces and xml schema
 
XML Schema
XML SchemaXML Schema
XML Schema
 
Xml For Dummies Chapter 8 Understanding And Using Dt Ds it-slideshares.blog...
Xml For Dummies   Chapter 8 Understanding And Using Dt Ds it-slideshares.blog...Xml For Dummies   Chapter 8 Understanding And Using Dt Ds it-slideshares.blog...
Xml For Dummies Chapter 8 Understanding And Using Dt Ds it-slideshares.blog...
 
XML, DTD & XSD Overview
XML, DTD & XSD OverviewXML, DTD & XSD Overview
XML, DTD & XSD Overview
 
Basic XML
Basic XMLBasic XML
Basic XML
 

Andere mochten auch

Different document types
Different document typesDifferent document types
Different document typesBreach_P
 
HTML Link - Image - Comments
HTML  Link - Image - CommentsHTML  Link - Image - Comments
HTML Link - Image - CommentsHameda Hurmat
 
Hyperlinks in HTML
Hyperlinks in HTMLHyperlinks in HTML
Hyperlinks in HTMLAarti P
 
XML Document Object Model (DOM)
XML Document Object Model (DOM)XML Document Object Model (DOM)
XML Document Object Model (DOM)BOSS Webtech
 
CSS-Cascading Style Sheets - Introduction
CSS-Cascading Style Sheets - IntroductionCSS-Cascading Style Sheets - Introduction
CSS-Cascading Style Sheets - IntroductionMukesh Tekwani
 
Html table tags
Html table tagsHtml table tags
Html table tagseShikshak
 
How Cascading Style Sheets (CSS) Works
How Cascading Style Sheets (CSS) WorksHow Cascading Style Sheets (CSS) Works
How Cascading Style Sheets (CSS) WorksAmit Tyagi
 
Images and Lists in HTML
Images and Lists in HTMLImages and Lists in HTML
Images and Lists in HTMLMarlon Jamera
 
SharePoint Document Types
SharePoint Document TypesSharePoint Document Types
SharePoint Document TypesGregory Zelfond
 
Introduction to Cascading Style Sheets (CSS)
Introduction to Cascading Style Sheets (CSS)Introduction to Cascading Style Sheets (CSS)
Introduction to Cascading Style Sheets (CSS)Chris Poteet
 
Introduction to CSS
Introduction to CSSIntroduction to CSS
Introduction to CSSAmit Tyagi
 
cascading style sheet ppt
cascading style sheet pptcascading style sheet ppt
cascading style sheet pptabhilashagupta
 
Introduction to html
Introduction to htmlIntroduction to html
Introduction to htmlvikasgaur31
 
International Trade Documents: 10 Top Documents
International Trade Documents: 10 Top DocumentsInternational Trade Documents: 10 Top Documents
International Trade Documents: 10 Top DocumentsGlobal Negotiator
 
Introduction to HTML
Introduction to HTMLIntroduction to HTML
Introduction to HTMLMayaLisa
 
Types of contract
Types of contractTypes of contract
Types of contractSweetp999
 

Andere mochten auch (20)

Different document types
Different document typesDifferent document types
Different document types
 
Documentation Types
Documentation TypesDocumentation Types
Documentation Types
 
Tablas html
Tablas htmlTablas html
Tablas html
 
HTML Link - Image - Comments
HTML  Link - Image - CommentsHTML  Link - Image - Comments
HTML Link - Image - Comments
 
Hyperlinks in HTML
Hyperlinks in HTMLHyperlinks in HTML
Hyperlinks in HTML
 
XML Document Object Model (DOM)
XML Document Object Model (DOM)XML Document Object Model (DOM)
XML Document Object Model (DOM)
 
CSS-Cascading Style Sheets - Introduction
CSS-Cascading Style Sheets - IntroductionCSS-Cascading Style Sheets - Introduction
CSS-Cascading Style Sheets - Introduction
 
Html table tags
Html table tagsHtml table tags
Html table tags
 
How Cascading Style Sheets (CSS) Works
How Cascading Style Sheets (CSS) WorksHow Cascading Style Sheets (CSS) Works
How Cascading Style Sheets (CSS) Works
 
Images and Lists in HTML
Images and Lists in HTMLImages and Lists in HTML
Images and Lists in HTML
 
SharePoint Document Types
SharePoint Document TypesSharePoint Document Types
SharePoint Document Types
 
Css Ppt
Css PptCss Ppt
Css Ppt
 
Introduction to Cascading Style Sheets (CSS)
Introduction to Cascading Style Sheets (CSS)Introduction to Cascading Style Sheets (CSS)
Introduction to Cascading Style Sheets (CSS)
 
Introduction to CSS
Introduction to CSSIntroduction to CSS
Introduction to CSS
 
cascading style sheet ppt
cascading style sheet pptcascading style sheet ppt
cascading style sheet ppt
 
Introduction to html
Introduction to htmlIntroduction to html
Introduction to html
 
International Trade Documents: 10 Top Documents
International Trade Documents: 10 Top DocumentsInternational Trade Documents: 10 Top Documents
International Trade Documents: 10 Top Documents
 
Html Ppt
Html PptHtml Ppt
Html Ppt
 
Introduction to HTML
Introduction to HTMLIntroduction to HTML
Introduction to HTML
 
Types of contract
Types of contractTypes of contract
Types of contract
 

Ähnlich wie Document type definition

Ähnlich wie Document type definition (20)

DTD1.pptx
DTD1.pptxDTD1.pptx
DTD1.pptx
 
Xml2
Xml2Xml2
Xml2
 
Xml by Luqman
Xml by LuqmanXml by Luqman
Xml by Luqman
 
Intro to xml
Intro to xmlIntro to xml
Intro to xml
 
distributed system concerned lab sessions
distributed system concerned lab sessionsdistributed system concerned lab sessions
distributed system concerned lab sessions
 
XML Bible
XML BibleXML Bible
XML Bible
 
XML External Entity (XXE)
XML External Entity (XXE)XML External Entity (XXE)
XML External Entity (XXE)
 
XML DTD DOCUMENT TYPE DEFINITION
XML DTD DOCUMENT TYPE DEFINITIONXML DTD DOCUMENT TYPE DEFINITION
XML DTD DOCUMENT TYPE DEFINITION
 
XML-Unit 1.ppt
XML-Unit 1.pptXML-Unit 1.ppt
XML-Unit 1.ppt
 
Bt0078
Bt0078Bt0078
Bt0078
 
XML Schema.pptx
XML Schema.pptxXML Schema.pptx
XML Schema.pptx
 
Xml
XmlXml
Xml
 
Xml sasidhar
Xml  sasidharXml  sasidhar
Xml sasidhar
 
Xml11
Xml11Xml11
Xml11
 
Xml Presentation-1
Xml Presentation-1Xml Presentation-1
Xml Presentation-1
 
XML.ppt
XML.pptXML.ppt
XML.ppt
 
Introduction to XML
Introduction to XMLIntroduction to XML
Introduction to XML
 
Applied xml programming for microsoft 3
Applied xml programming for microsoft 3Applied xml programming for microsoft 3
Applied xml programming for microsoft 3
 
uptu web technology unit 2 Xml2
uptu web technology unit 2 Xml2uptu web technology unit 2 Xml2
uptu web technology unit 2 Xml2
 
Xml schema
Xml schemaXml schema
Xml schema
 

Mehr von Raghu nath

Ftp (file transfer protocol)
Ftp (file transfer protocol)Ftp (file transfer protocol)
Ftp (file transfer protocol)Raghu 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

Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptxDecoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptxDhatriParmar
 
4.9.24 School Desegregation in Boston.pptx
4.9.24 School Desegregation in Boston.pptx4.9.24 School Desegregation in Boston.pptx
4.9.24 School Desegregation in Boston.pptxmary850239
 
CHEST Proprioceptive neuromuscular facilitation.pptx
CHEST Proprioceptive neuromuscular facilitation.pptxCHEST Proprioceptive neuromuscular facilitation.pptx
CHEST Proprioceptive neuromuscular facilitation.pptxAneriPatwari
 
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptxDIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptxMichelleTuguinay1
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfJemuel Francisco
 
Tree View Decoration Attribute in the Odoo 17
Tree View Decoration Attribute in the Odoo 17Tree View Decoration Attribute in the Odoo 17
Tree View Decoration Attribute in the Odoo 17Celine George
 
Textual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHSTextual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHSMae Pangan
 
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...Association for Project Management
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptxmary850239
 
Active Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfActive Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfPatidar M
 
Sulphonamides, mechanisms and their uses
Sulphonamides, mechanisms and their usesSulphonamides, mechanisms and their uses
Sulphonamides, mechanisms and their usesVijayaLaxmi84
 
MS4 level being good citizen -imperative- (1) (1).pdf
MS4 level   being good citizen -imperative- (1) (1).pdfMS4 level   being good citizen -imperative- (1) (1).pdf
MS4 level being good citizen -imperative- (1) (1).pdfMr Bounab Samir
 
How to Make a Duplicate of Your Odoo 17 Database
How to Make a Duplicate of Your Odoo 17 DatabaseHow to Make a Duplicate of Your Odoo 17 Database
How to Make a Duplicate of Your Odoo 17 DatabaseCeline George
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management SystemChristalin Nelson
 
4.11.24 Mass Incarceration and the New Jim Crow.pptx
4.11.24 Mass Incarceration and the New Jim Crow.pptx4.11.24 Mass Incarceration and the New Jim Crow.pptx
4.11.24 Mass Incarceration and the New Jim Crow.pptxmary850239
 
How to Fix XML SyntaxError in Odoo the 17
How to Fix XML SyntaxError in Odoo the 17How to Fix XML SyntaxError in Odoo the 17
How to Fix XML SyntaxError in Odoo the 17Celine George
 

Kürzlich hochgeladen (20)

Faculty Profile prashantha K EEE dept Sri Sairam college of Engineering
Faculty Profile prashantha K EEE dept Sri Sairam college of EngineeringFaculty Profile prashantha K EEE dept Sri Sairam college of Engineering
Faculty Profile prashantha K EEE dept Sri Sairam college of Engineering
 
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptxDecoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
 
4.9.24 School Desegregation in Boston.pptx
4.9.24 School Desegregation in Boston.pptx4.9.24 School Desegregation in Boston.pptx
4.9.24 School Desegregation in Boston.pptx
 
CHEST Proprioceptive neuromuscular facilitation.pptx
CHEST Proprioceptive neuromuscular facilitation.pptxCHEST Proprioceptive neuromuscular facilitation.pptx
CHEST Proprioceptive neuromuscular facilitation.pptx
 
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptxDIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
 
INCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptx
INCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptxINCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptx
INCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptx
 
Tree View Decoration Attribute in the Odoo 17
Tree View Decoration Attribute in the Odoo 17Tree View Decoration Attribute in the Odoo 17
Tree View Decoration Attribute in the Odoo 17
 
Textual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHSTextual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHS
 
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx
 
Active Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfActive Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdf
 
Sulphonamides, mechanisms and their uses
Sulphonamides, mechanisms and their usesSulphonamides, mechanisms and their uses
Sulphonamides, mechanisms and their uses
 
MS4 level being good citizen -imperative- (1) (1).pdf
MS4 level   being good citizen -imperative- (1) (1).pdfMS4 level   being good citizen -imperative- (1) (1).pdf
MS4 level being good citizen -imperative- (1) (1).pdf
 
Mattingly "AI & Prompt Design: Large Language Models"
Mattingly "AI & Prompt Design: Large Language Models"Mattingly "AI & Prompt Design: Large Language Models"
Mattingly "AI & Prompt Design: Large Language Models"
 
Paradigm shift in nursing research by RS MEHTA
Paradigm shift in nursing research by RS MEHTAParadigm shift in nursing research by RS MEHTA
Paradigm shift in nursing research by RS MEHTA
 
How to Make a Duplicate of Your Odoo 17 Database
How to Make a Duplicate of Your Odoo 17 DatabaseHow to Make a Duplicate of Your Odoo 17 Database
How to Make a Duplicate of Your Odoo 17 Database
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management System
 
4.11.24 Mass Incarceration and the New Jim Crow.pptx
4.11.24 Mass Incarceration and the New Jim Crow.pptx4.11.24 Mass Incarceration and the New Jim Crow.pptx
4.11.24 Mass Incarceration and the New Jim Crow.pptx
 
How to Fix XML SyntaxError in Odoo the 17
How to Fix XML SyntaxError in Odoo the 17How to Fix XML SyntaxError in Odoo the 17
How to Fix XML SyntaxError in Odoo the 17
 

Document type definition

  • 2. Document Tvpe Definitions (DTDs) define an XML document's structure (e.g., what elements,attributes, etc. are permitted in the document). An XML document is not required to have a corresponding DTD. However, DTDs are often recommended to ensure document conformity, especially in business-to- business (B2B) transactions, where XML documents are exchanged. DTDs specify an XML document's structure and are themselves defined using EBNF (Extended Backus-Naur Form) grammar-not the XML syntax.
  • 3. Observation: A transition is underway in the XML community from DTDs to Schema, which improve upon DTDs. Schema use XML syntax, not EBNF grammar. Parsers, Well-formed and Valid XML Documents: Parsers are generally classified as validating or nonvalidating. A validating parser is able to read the DTD and determine whether or not the XML document conforms to it. If the document conforms to the DTD, it is referred to as valid. If the document fails to conform to the DTD but is syntactically correct, it is well formed but not valid. By definition, a valid document is well formed. A nonvalidating parser is able to read the DTD, but cannot check the document against the DTD for conformity. If the document is syntactically correct, it is well formed.
  • 4. Document Type Declaration DTDs are introduced into XML documents using the document type declaration (i.e .DOCTYPE). A document type declaration is placed in the XML document's prolog and begins with <!DOCTYPE and ends with >. The document type declaration can point to declarations that are outside the XML document (called the external subset) or can contain the declaration inside the document (called internal subset). For example, an internal subset mightlook like
  • 5. <!DOCTYPE myMessage [ <!ELEMENT myMessage ( #PCDATA )> ]
  • 6. The first myMessage is the name of the document type declaration. Anything inside the square brackets ( [ ] ) constitutes the internal subset. As we will see momentarily, ELEMENT and #PCDATA are used in "element declarations.“
  • 7. External subsets physically exist in a different file that typically ends with the . Dtd extension,although this file extension is not required. External subsets are specified using either keyword SYSTEM or PUBLIC. For example. the DOCTYPE external subset might look like
  • 8. <!DOCTYPE myMessage SYSTEM "myDTD.dtd"> which points to the myDTD.dtd document. Using the PUBLIC keyword indicates that the DTD is widely used (e.g., the DTD for HTML documents). The DTD may be made available in well-known locations for more efficient downloading. The DOCTYPE
  • 9. <!DOCTYPE HTML PUBLIC "-//w3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> uses the PUBLIC keyword to reference the well-known DTD for HTML version 4.01. XML parsers that do not have a local copy of the DTD may use the URL provided to download the DTD to perform validation Both the internal and external subset may be specified at the same time. For example, the DOCTYPE
  • 10. <!DOCTYPE myMessage SYSTEM "myDTD.dtd“ <!ELEMENT myElement ( #PCDATA )> contains declarations from the myDTD.dtd document as well as an internal declaration
  • 11. Observation: The document type declaration internal subset plus its external subset form the DTD. The internal subset is visible only within the document in which it resides. Other external documents cannot be validated against it. DTDs that are used by many documents should be placed in the external subset.
  • 12. Element Type Declarations Elements are the primary building block used in XML documents and are declared in a DTD with element type declarations (ELEMENTs). For example, to declare element myMessage, we might write
  • 13. The element name (e.g., MyElement) that follows ELEMENT is often called a generic identifier. The set of parentheses that follow the element name specify the element's allowed content and is called the content specification. Keyword PCDATA specifies that the element must contain parsable character data. This data will be parsed by the XML parser, therefore any markup text (i.e., <, >, &, etc.) will be treated as markup.
  • 14. Error: Attempting to use the same element name in multiple element type declarations is an error. Example 1 lists an XML document that contains a reference to an external DTD in the I)DOCTYPE. Microsoft's XML Validator will be used to check the document's conformity against its DTD. To use XML Validator, Internet Explorer 5 is required. Parsers XML4J and
  • 15. Xerces can be used to check a document's validity against a DTD programmatically. Using Java and one of these parsers provides a platform-independent way to validate XML documents. <?xml version = "1.0"?> <!DOCTYPE myMessage SYSTEM "intro.dtd"> <myMessage> <message>Welcome to XML!</message> </myMessage> Example 1. XML document declaring associated DTD.
  • 16. The document type declaration is named myMessage-the name of the root element. The element myMessage contains a single child element named message . <!ELEMENT myMessage ( message )> <!ELEMENT message ( #PCDATA )> Example 2. Validation with using an external DTD The DTD declares element myMessage. Notice that the content specification contains the name message. This indicates that element myMessage contains exactly one child element named message. Because myMessage can only have an element as its content, it is said to have element content. Element message whose content is of type PCDATA. The XML Validator is capable of validating an XML document against both DTDs and Schemas
  • 17. Error: Having a root element name other than the name specified in the document type declaration is an error.
  • 18. Document Type Definitions (DTDs) define an XML document's structure (e.g., what elements, attributes, etc. are permitted in the XML document). An XML document is not required to have a corresponding DTD. DTDs use EBNF (Extended Backus-Naur Form) grammar
  • 19. Parsers are generally classified as validating or nonvalidating. A validating parser is able to read the DTD and determine whether or not the XML document conforms to it. If the document conforms to the DTD, it is referred to as valid. If the document fails to conform to the DTD but is syntactically correct, it is well formed but not valid. By definition, a valid document is well formed.
  • 20. A nonvalidating parser is able to read a DTD, but cannot check the document against the DTD for conformity. If the document is syntactically correct, it is well formed.
  • 21. DTDs are introduced into XML documents by using the document type declaration (i.e., DOCTYPE). The document type declaration can point to declarations that are outside the XML document (called the external subset) or can contain the declaration inside the document (called internal subset).
  • 22. External subsets physically exist in a different file that typically ends with the .dtd extension, although this file extension is not required. External Subsets are specified using keyword SYSTEM. Both the internal and external subset may be specified at the same time
  • 23. Elements are the primary building block used in XML documents and are declared in a DTD with element type declarations (ELEMENTs). The element name that follows ELEMENT is often called a generic identifier. The set of parentheses that follow the element name specify the element's allowed content and is called the content specification.
  • 24. Keyword PCDATA specifies that the element must contain parsable character data-that is,any text except the characters less-than ( < ), greater-than ( > ), ampersand ( & ), quote ( ' ) and double quote ( " ). An XML document is a standalone XML document if it does not reference an external DTD. An XML element that can only have another element for content, it is said to have element content.
  • 25. DTDs allow the document author to define the order and frequency of child elements. The comma ( , ) - called a sequence - specifies the order in which the elements must occur. Choices are specified using the pipe ( | ) character. The content specification may contain any number of pipe character separated choises.
  • 26. An element's frequency (i.e., number of occurrences) is specified by using either the plus sign (+), asterisk (*) or question mark (?) occurrence indicator
  • 27. The frequency of an element group (i.e., two or more elements that occur in some combinaition) is specified by enclosing the element names inside the content specification followed by an occurrence indicator Elements can be further refined by describing the content types they may contain. Content specification types (e.g., EMPTY, mixed content, ANY, etc.) describe nonelement content.
  • 28. An element can be declared as having mixed content (i.e., a combination of elements and PCDATA). The comma ( , ), plus sign ( + ) and question mark ( ? ) occurrence indicators cannot be used with mixed content elements