SlideShare a Scribd company logo
XML DTD
OVERVIEW
1. INTRODUCTIONTO DTD?
2. SYNTAX
3. TYPES
4. EXAMPLES
5. PCDATA
6. CDATA
7. WHY USE A DTD?
What is DTD?
■ DTD- in xml DTD define DocumentType Definition.
■ Document structure may be contain elements, attributes, entities.
■ Application can use DTD to verify XML data.
■ It is used to describe the xml language more precisely.
STRUCTUREOF DTD
<!DOCTYPE root_element [
<!ELEMENT element_name(element content)>
]>
EXAMPLE
<!DOCTYPE employee [
<!ELEMENT employee( empno , name , salary )>
<!ELEMENT empno(#PCDATA)>
<!ELEMENT name(#PCDATA)>
<!ELEMENT salary(#PCDATA)>
]>
TYPES
There are two types
1) INTERNAL DTD
2) EXTERNAL DTD
An Internal DTD.
INTERNAL DTD
■ Internal elements are declared with the xml file.
■ If the DTD is declared inside the XML file, it must be wrapped inside the
<!DOCTYPE> definition.
SYNTAX
< !DOCTYPE root-element
[ element-declaration] >
EXAMPLE
<?xml version=“1.0” encoding=“UTF= 8”>
<! DOCTYPE Address [
<! Element Address(Name, company, Phone)>
<! Element Name (#PCDATA)
<! Element Company (#PCDATA)
<! Element Phone(#PCDATA)
]>
<Address>
<Name>ABC </Name>
<Company>AIT </Company>
<Phone>37973882074</Phone>
</Address>
The DTD above is interpreted like this:
■ !DOCTYPE Address defines that the root element of this document is
address
■ !ELEMENT Address defines that the address element must contain
three elements: "Name, company, Phone"
■ !ELEMENT name defines the name element to be of type "#PCDATA"
■ !ELEMENT company defines the company element to be of type
"#PCDATA"
■ !ELEMENT phone defines the phone element to be of type "#PCDATA"
An external DTD
EXTERNAL DTD
■ External element are declared outside the xml file.
■ If the DTD is declared in an external file, the <!DOCTYPE> definition must
contain a reference to the DTD file.
SYNTAX
< !DOCTYPE root-element
element system
“file-name”>
EXAMPLE
<?xml version=“1.0” encoding=“UTF= 8”>
<!DOCTYPE Address SYSTEM “Address.dtd">
<Address>
<Name>ABC</Name>
<Company>AIT</Company>
<Phone>472397455<Phone>
</Address>
The content of the DTD file address.dtd are as shown-
<! Element Address(Name, company, Phone)>
<! Element Name (#PCDATA)>
<! Element Company (#PCDATA)>
<! Element Phone(#PCDATA)>
PCDATA
■ PCDATA means parsed character data
■ character data - the text found between the start tag and the end tag of
an XML element.
■ PCDATA is text that will be parsed by a parser
■ Tags inside the text will be treated as markup and entities will be
expanded
CDATA
■ CDATA also means character data
■ CDATA is text that will NOT be parsed by a parser
■ Tags inside the text will NOT be treated as markup and entities will not
be expanded.
Why use a DTD?
XML provides an application independent way of
sharing data.
With a DTD, independent groups of people can agree to
use a common DTD for interchanging data.
Your application can use a standard DTD to verify that
data that you receive from the outside world is valid.
You can also use a DTD to verify your own data.
THANKYOU
created and presented by:
DEEKSHA- 01124802017
HARSHIT MISHRA- 01224802017
HEENA- 01324802017
HIMANSHI SINGH- 0144802017

More Related Content

What's hot

XML, DTD & XSD Overview
XML, DTD & XSD OverviewXML, DTD & XSD Overview
XML, DTD & XSD Overview
Pradeep Rapolu
 
Apuntes de DTD
Apuntes de DTDApuntes de DTD
Apuntes de DTD
Abrirllave
 
Xml 215-presentation
Xml 215-presentationXml 215-presentation
Xml 215-presentation
Manish Chaurasia
 
Html text formatting
Html text formattingHtml text formatting
Html text formatting
derekoei
 
CSS selectors
CSS selectorsCSS selectors
CSS selectors
Héla Ben Khalfallah
 
Unit I-Data Structures_Intoduction.pptx
Unit I-Data Structures_Intoduction.pptxUnit I-Data Structures_Intoduction.pptx
Unit I-Data Structures_Intoduction.pptx
DrkhanchanaR
 
Singly Linked List & Data Structure
Singly Linked List & Data StructureSingly Linked List & Data Structure
Unit 5 internal sorting &amp; files
Unit 5  internal sorting &amp; filesUnit 5  internal sorting &amp; files
Unit 5 internal sorting &amp; files
DrkhanchanaR
 
Html table tags
Html table tagsHtml table tags
Html table tags
eShikshak
 
Basic HTML
Basic HTMLBasic HTML
Basic HTML
Sayan De
 
Understanding XML DOM
Understanding XML DOMUnderstanding XML DOM
Understanding XML DOM
Om Vikram Thapa
 
Xml schema
Xml schemaXml schema
Xml schema
Prabhakaran V M
 
Lecture 2 introduction to html
Lecture 2  introduction to htmlLecture 2  introduction to html
Lecture 2 introduction to html
palhaftab
 
How to learn HTML in 10 Days
How to learn HTML in 10 DaysHow to learn HTML in 10 Days
How to learn HTML in 10 Days
Manoj kumar Deswal
 
Html basics
Html basicsHtml basics
Html basics
mcatahir947
 
Unit I-Data structures stack & Queue
Unit I-Data structures stack & QueueUnit I-Data structures stack & Queue
Unit I-Data structures stack & Queue
DrkhanchanaR
 
Dom
DomDom
Unit 4 external sorting
Unit 4   external sortingUnit 4   external sorting
Unit 4 external sorting
DrkhanchanaR
 
Html ppt
Html pptHtml ppt
Html ppt
santosh lamba
 
Basic-CSS-tutorial
Basic-CSS-tutorialBasic-CSS-tutorial
Basic-CSS-tutorial
tutorialsruby
 

What's hot (20)

XML, DTD & XSD Overview
XML, DTD & XSD OverviewXML, DTD & XSD Overview
XML, DTD & XSD Overview
 
Apuntes de DTD
Apuntes de DTDApuntes de DTD
Apuntes de DTD
 
Xml 215-presentation
Xml 215-presentationXml 215-presentation
Xml 215-presentation
 
Html text formatting
Html text formattingHtml text formatting
Html text formatting
 
CSS selectors
CSS selectorsCSS selectors
CSS selectors
 
Unit I-Data Structures_Intoduction.pptx
Unit I-Data Structures_Intoduction.pptxUnit I-Data Structures_Intoduction.pptx
Unit I-Data Structures_Intoduction.pptx
 
Singly Linked List & Data Structure
Singly Linked List & Data StructureSingly Linked List & Data Structure
Singly Linked List & Data Structure
 
Unit 5 internal sorting &amp; files
Unit 5  internal sorting &amp; filesUnit 5  internal sorting &amp; files
Unit 5 internal sorting &amp; files
 
Html table tags
Html table tagsHtml table tags
Html table tags
 
Basic HTML
Basic HTMLBasic HTML
Basic HTML
 
Understanding XML DOM
Understanding XML DOMUnderstanding XML DOM
Understanding XML DOM
 
Xml schema
Xml schemaXml schema
Xml schema
 
Lecture 2 introduction to html
Lecture 2  introduction to htmlLecture 2  introduction to html
Lecture 2 introduction to html
 
How to learn HTML in 10 Days
How to learn HTML in 10 DaysHow to learn HTML in 10 Days
How to learn HTML in 10 Days
 
Html basics
Html basicsHtml basics
Html basics
 
Unit I-Data structures stack & Queue
Unit I-Data structures stack & QueueUnit I-Data structures stack & Queue
Unit I-Data structures stack & Queue
 
Dom
DomDom
Dom
 
Unit 4 external sorting
Unit 4   external sortingUnit 4   external sorting
Unit 4 external sorting
 
Html ppt
Html pptHtml ppt
Html ppt
 
Basic-CSS-tutorial
Basic-CSS-tutorialBasic-CSS-tutorial
Basic-CSS-tutorial
 

Similar to Xml dtd

Xml2
Xml2Xml2
XML's validation - DTD
XML's validation - DTDXML's validation - DTD
XML's validation - DTD
videde_group
 
2-DTD.ppt
2-DTD.ppt2-DTD.ppt
2-DTD.ppt
KGSCSEPSGCT
 
It8074 soa-unit i
It8074 soa-unit iIt8074 soa-unit i
It8074 soa-unit i
RevathiAPICSE
 
it8074-soa-uniti-.pdf
it8074-soa-uniti-.pdfit8074-soa-uniti-.pdf
it8074-soa-uniti-.pdf
FreeFire293813
 
DTD1.pptx
DTD1.pptxDTD1.pptx
DTD1.pptx
MouDhara1
 
XML DTD DOCUMENT TYPE DEFINITION
XML DTD DOCUMENT TYPE DEFINITIONXML DTD DOCUMENT TYPE DEFINITION
XML DTD DOCUMENT TYPE DEFINITION
SaraswathiRamalingam
 
XXE
XXEXXE
Xxe
XxeXxe
Unit iv xml
Unit iv xmlUnit iv xml
Unit iv xml
smitha273566
 
Xml dtd
Xml dtdXml dtd
Xml dtd
sana mateen
 
Xml2
Xml2Xml2
Xml
XmlXml
Dtd
DtdDtd
It8074 soa-unit i
It8074 soa-unit iIt8074 soa-unit i
It8074 soa-unit i
smitha273566
 
distributed system concerned lab sessions
distributed system concerned lab sessionsdistributed system concerned lab sessions
distributed system concerned lab sessions
milkesa13
 
Xml 20111006 hurd
Xml 20111006 hurdXml 20111006 hurd
Xml 20111006 hurd
carishurd
 
01 xml document structure
01 xml document structure01 xml document structure
01 xml document structure
Baskarkncet
 
Document type definition
Document type definitionDocument type definition
Document type definition
Raghu nath
 
Dtd
DtdDtd

Similar to Xml dtd (20)

Xml2
Xml2Xml2
Xml2
 
XML's validation - DTD
XML's validation - DTDXML's validation - DTD
XML's validation - DTD
 
2-DTD.ppt
2-DTD.ppt2-DTD.ppt
2-DTD.ppt
 
It8074 soa-unit i
It8074 soa-unit iIt8074 soa-unit i
It8074 soa-unit i
 
it8074-soa-uniti-.pdf
it8074-soa-uniti-.pdfit8074-soa-uniti-.pdf
it8074-soa-uniti-.pdf
 
DTD1.pptx
DTD1.pptxDTD1.pptx
DTD1.pptx
 
XML DTD DOCUMENT TYPE DEFINITION
XML DTD DOCUMENT TYPE DEFINITIONXML DTD DOCUMENT TYPE DEFINITION
XML DTD DOCUMENT TYPE DEFINITION
 
XXE
XXEXXE
XXE
 
Xxe
XxeXxe
Xxe
 
Unit iv xml
Unit iv xmlUnit iv xml
Unit iv xml
 
Xml dtd
Xml dtdXml dtd
Xml dtd
 
Xml2
Xml2Xml2
Xml2
 
Xml
XmlXml
Xml
 
Dtd
DtdDtd
Dtd
 
It8074 soa-unit i
It8074 soa-unit iIt8074 soa-unit i
It8074 soa-unit i
 
distributed system concerned lab sessions
distributed system concerned lab sessionsdistributed system concerned lab sessions
distributed system concerned lab sessions
 
Xml 20111006 hurd
Xml 20111006 hurdXml 20111006 hurd
Xml 20111006 hurd
 
01 xml document structure
01 xml document structure01 xml document structure
01 xml document structure
 
Document type definition
Document type definitionDocument type definition
Document type definition
 
Dtd
DtdDtd
Dtd
 

Recently uploaded

🏎️Tech Transformation: DevOps Insights from the Experts 👩‍💻
🏎️Tech Transformation: DevOps Insights from the Experts 👩‍💻🏎️Tech Transformation: DevOps Insights from the Experts 👩‍💻
🏎️Tech Transformation: DevOps Insights from the Experts 👩‍💻
campbellclarkson
 
The Comprehensive Guide to Validating Audio-Visual Performances.pdf
The Comprehensive Guide to Validating Audio-Visual Performances.pdfThe Comprehensive Guide to Validating Audio-Visual Performances.pdf
The Comprehensive Guide to Validating Audio-Visual Performances.pdf
kalichargn70th171
 
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
dakas1
 
Boost Your Savings with These Money Management Apps
Boost Your Savings with These Money Management AppsBoost Your Savings with These Money Management Apps
Boost Your Savings with These Money Management Apps
Jhone kinadey
 
Stork Product Overview: An AI-Powered Autonomous Delivery Fleet
Stork Product Overview: An AI-Powered Autonomous Delivery FleetStork Product Overview: An AI-Powered Autonomous Delivery Fleet
Stork Product Overview: An AI-Powered Autonomous Delivery Fleet
Vince Scalabrino
 
Streamlining End-to-End Testing Automation
Streamlining End-to-End Testing AutomationStreamlining End-to-End Testing Automation
Streamlining End-to-End Testing Automation
Anand Bagmar
 
A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...
A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...
A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...
kalichargn70th171
 
The Rising Future of CPaaS in the Middle East 2024
The Rising Future of CPaaS in the Middle East 2024The Rising Future of CPaaS in the Middle East 2024
The Rising Future of CPaaS in the Middle East 2024
Yara Milbes
 
一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理
一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理
一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理
kgyxske
 
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
safelyiotech
 
Photoshop Tutorial for Beginners (2024 Edition)
Photoshop Tutorial for Beginners (2024 Edition)Photoshop Tutorial for Beginners (2024 Edition)
Photoshop Tutorial for Beginners (2024 Edition)
alowpalsadig
 
Operational ease MuleSoft and Salesforce Service Cloud Solution v1.0.pptx
Operational ease MuleSoft and Salesforce Service Cloud Solution v1.0.pptxOperational ease MuleSoft and Salesforce Service Cloud Solution v1.0.pptx
Operational ease MuleSoft and Salesforce Service Cloud Solution v1.0.pptx
sandeepmenon62
 
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
Bert Jan Schrijver
 
How GenAI Can Improve Supplier Performance Management.pdf
How GenAI Can Improve Supplier Performance Management.pdfHow GenAI Can Improve Supplier Performance Management.pdf
How GenAI Can Improve Supplier Performance Management.pdf
Zycus
 
Baha Majid WCA4Z IBM Z Customer Council Boston June 2024.pdf
Baha Majid WCA4Z IBM Z Customer Council Boston June 2024.pdfBaha Majid WCA4Z IBM Z Customer Council Boston June 2024.pdf
Baha Majid WCA4Z IBM Z Customer Council Boston June 2024.pdf
Baha Majid
 
Assure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyesAssure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
All you need to know about Spring Boot and GraalVM
All you need to know about Spring Boot and GraalVMAll you need to know about Spring Boot and GraalVM
All you need to know about Spring Boot and GraalVM
Alina Yurenko
 
WMF 2024 - Unlocking the Future of Data Powering Next-Gen AI with Vector Data...
WMF 2024 - Unlocking the Future of Data Powering Next-Gen AI with Vector Data...WMF 2024 - Unlocking the Future of Data Powering Next-Gen AI with Vector Data...
WMF 2024 - Unlocking the Future of Data Powering Next-Gen AI with Vector Data...
Luigi Fugaro
 
Superpower Your Apache Kafka Applications Development with Complementary Open...
Superpower Your Apache Kafka Applications Development with Complementary Open...Superpower Your Apache Kafka Applications Development with Complementary Open...
Superpower Your Apache Kafka Applications Development with Complementary Open...
Paul Brebner
 
Ensuring Efficiency and Speed with Practical Solutions for Clinical Operations
Ensuring Efficiency and Speed with Practical Solutions for Clinical OperationsEnsuring Efficiency and Speed with Practical Solutions for Clinical Operations
Ensuring Efficiency and Speed with Practical Solutions for Clinical Operations
OnePlan Solutions
 

Recently uploaded (20)

🏎️Tech Transformation: DevOps Insights from the Experts 👩‍💻
🏎️Tech Transformation: DevOps Insights from the Experts 👩‍💻🏎️Tech Transformation: DevOps Insights from the Experts 👩‍💻
🏎️Tech Transformation: DevOps Insights from the Experts 👩‍💻
 
The Comprehensive Guide to Validating Audio-Visual Performances.pdf
The Comprehensive Guide to Validating Audio-Visual Performances.pdfThe Comprehensive Guide to Validating Audio-Visual Performances.pdf
The Comprehensive Guide to Validating Audio-Visual Performances.pdf
 
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
 
Boost Your Savings with These Money Management Apps
Boost Your Savings with These Money Management AppsBoost Your Savings with These Money Management Apps
Boost Your Savings with These Money Management Apps
 
Stork Product Overview: An AI-Powered Autonomous Delivery Fleet
Stork Product Overview: An AI-Powered Autonomous Delivery FleetStork Product Overview: An AI-Powered Autonomous Delivery Fleet
Stork Product Overview: An AI-Powered Autonomous Delivery Fleet
 
Streamlining End-to-End Testing Automation
Streamlining End-to-End Testing AutomationStreamlining End-to-End Testing Automation
Streamlining End-to-End Testing Automation
 
A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...
A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...
A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...
 
The Rising Future of CPaaS in the Middle East 2024
The Rising Future of CPaaS in the Middle East 2024The Rising Future of CPaaS in the Middle East 2024
The Rising Future of CPaaS in the Middle East 2024
 
一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理
一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理
一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理
 
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
 
Photoshop Tutorial for Beginners (2024 Edition)
Photoshop Tutorial for Beginners (2024 Edition)Photoshop Tutorial for Beginners (2024 Edition)
Photoshop Tutorial for Beginners (2024 Edition)
 
Operational ease MuleSoft and Salesforce Service Cloud Solution v1.0.pptx
Operational ease MuleSoft and Salesforce Service Cloud Solution v1.0.pptxOperational ease MuleSoft and Salesforce Service Cloud Solution v1.0.pptx
Operational ease MuleSoft and Salesforce Service Cloud Solution v1.0.pptx
 
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
 
How GenAI Can Improve Supplier Performance Management.pdf
How GenAI Can Improve Supplier Performance Management.pdfHow GenAI Can Improve Supplier Performance Management.pdf
How GenAI Can Improve Supplier Performance Management.pdf
 
Baha Majid WCA4Z IBM Z Customer Council Boston June 2024.pdf
Baha Majid WCA4Z IBM Z Customer Council Boston June 2024.pdfBaha Majid WCA4Z IBM Z Customer Council Boston June 2024.pdf
Baha Majid WCA4Z IBM Z Customer Council Boston June 2024.pdf
 
Assure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyesAssure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyes
 
All you need to know about Spring Boot and GraalVM
All you need to know about Spring Boot and GraalVMAll you need to know about Spring Boot and GraalVM
All you need to know about Spring Boot and GraalVM
 
WMF 2024 - Unlocking the Future of Data Powering Next-Gen AI with Vector Data...
WMF 2024 - Unlocking the Future of Data Powering Next-Gen AI with Vector Data...WMF 2024 - Unlocking the Future of Data Powering Next-Gen AI with Vector Data...
WMF 2024 - Unlocking the Future of Data Powering Next-Gen AI with Vector Data...
 
Superpower Your Apache Kafka Applications Development with Complementary Open...
Superpower Your Apache Kafka Applications Development with Complementary Open...Superpower Your Apache Kafka Applications Development with Complementary Open...
Superpower Your Apache Kafka Applications Development with Complementary Open...
 
Ensuring Efficiency and Speed with Practical Solutions for Clinical Operations
Ensuring Efficiency and Speed with Practical Solutions for Clinical OperationsEnsuring Efficiency and Speed with Practical Solutions for Clinical Operations
Ensuring Efficiency and Speed with Practical Solutions for Clinical Operations
 

Xml dtd

  • 2. OVERVIEW 1. INTRODUCTIONTO DTD? 2. SYNTAX 3. TYPES 4. EXAMPLES 5. PCDATA 6. CDATA 7. WHY USE A DTD?
  • 3. What is DTD? ■ DTD- in xml DTD define DocumentType Definition. ■ Document structure may be contain elements, attributes, entities. ■ Application can use DTD to verify XML data. ■ It is used to describe the xml language more precisely.
  • 4. STRUCTUREOF DTD <!DOCTYPE root_element [ <!ELEMENT element_name(element content)> ]>
  • 5. EXAMPLE <!DOCTYPE employee [ <!ELEMENT employee( empno , name , salary )> <!ELEMENT empno(#PCDATA)> <!ELEMENT name(#PCDATA)> <!ELEMENT salary(#PCDATA)> ]>
  • 6. TYPES There are two types 1) INTERNAL DTD 2) EXTERNAL DTD
  • 7. An Internal DTD. INTERNAL DTD ■ Internal elements are declared with the xml file. ■ If the DTD is declared inside the XML file, it must be wrapped inside the <!DOCTYPE> definition. SYNTAX < !DOCTYPE root-element [ element-declaration] >
  • 8. EXAMPLE <?xml version=“1.0” encoding=“UTF= 8”> <! DOCTYPE Address [ <! Element Address(Name, company, Phone)> <! Element Name (#PCDATA) <! Element Company (#PCDATA) <! Element Phone(#PCDATA) ]> <Address> <Name>ABC </Name> <Company>AIT </Company> <Phone>37973882074</Phone> </Address>
  • 9. The DTD above is interpreted like this: ■ !DOCTYPE Address defines that the root element of this document is address ■ !ELEMENT Address defines that the address element must contain three elements: "Name, company, Phone" ■ !ELEMENT name defines the name element to be of type "#PCDATA" ■ !ELEMENT company defines the company element to be of type "#PCDATA" ■ !ELEMENT phone defines the phone element to be of type "#PCDATA"
  • 10. An external DTD EXTERNAL DTD ■ External element are declared outside the xml file. ■ If the DTD is declared in an external file, the <!DOCTYPE> definition must contain a reference to the DTD file. SYNTAX < !DOCTYPE root-element element system “file-name”>
  • 11. EXAMPLE <?xml version=“1.0” encoding=“UTF= 8”> <!DOCTYPE Address SYSTEM “Address.dtd"> <Address> <Name>ABC</Name> <Company>AIT</Company> <Phone>472397455<Phone> </Address>
  • 12. The content of the DTD file address.dtd are as shown- <! Element Address(Name, company, Phone)> <! Element Name (#PCDATA)> <! Element Company (#PCDATA)> <! Element Phone(#PCDATA)>
  • 13. PCDATA ■ PCDATA means parsed character data ■ character data - the text found between the start tag and the end tag of an XML element. ■ PCDATA is text that will be parsed by a parser ■ Tags inside the text will be treated as markup and entities will be expanded
  • 14. CDATA ■ CDATA also means character data ■ CDATA is text that will NOT be parsed by a parser ■ Tags inside the text will NOT be treated as markup and entities will not be expanded.
  • 15. Why use a DTD? XML provides an application independent way of sharing data. With a DTD, independent groups of people can agree to use a common DTD for interchanging data. Your application can use a standard DTD to verify that data that you receive from the outside world is valid. You can also use a DTD to verify your own data.
  • 16. THANKYOU created and presented by: DEEKSHA- 01124802017 HARSHIT MISHRA- 01224802017 HEENA- 01324802017 HIMANSHI SINGH- 0144802017