SlideShare une entreprise Scribd logo
XML - Prepared by Sruthi JS - 26/09/2023
XML
Prepared by Sruthi JS
1
XML - Prepared by Sruthi JS - 26/09/2023
1 XML - Introduction
2 XML - Syntax
3 XML - Documents
4 XML - Declaration
5 XML - Tags
6 XML - Elements
7 XML - Attributes
8 XML - Comments
9 XML - Character Entities
10 XML - CDATA Sections
11 XML - WhiteSpaces
12 XML - Processing
13 XML - Encoding
14 XML - Validation
15 XML - DTDs
16 XML - Schemas
17 XML - Tree Structure
18 XML - DOM
19 XML - Namespaces
20 XML - Databases
21 XML - Viewers
22 XML - Editors
23 XML - Parsers
24 XML - Processors
XML - Prepared by Sruthi JS - 26/09/2023
1
XML - introduction
3
XML - Prepared by Sruthi JS - 26/09/2023
1. XML - Introduction
➔ XML stands for Extensible Markup Language.
➔ It is a text-based markup language derived from Standard Generalized Markup Language
(SGML).
Is XML a Programming Language?
➔ A programming language consists of grammar rules and its own vocabulary which is used to
create computer programs. These programs instruct the computer to perform specific tasks.
➔ XML does not qualify to be a programming language as it does not perform any computation or
algorithms. It is usually stored in a simple text file and is processed by special software that is
capable of interpreting XML.
Advantages of xml
➔ XML uses human, not computer, language. XML is readable and understandable, even by
novices, and no more difficult to code than HTML.
➔ XML is completely compatible with Java™ and 100% portable. Any application that can
process XML can use our information, regardless of platform.
➔ XML is extendable. Create our own tags, or use tags created by others, that use the natural
language of our domain, that have the attributes we need, and that makes sense to us and our
users. 4
XML - Prepared by Sruthi JS - 26/09/2023
2
XML - Syntax
5
XML - Prepared by Sruthi JS - 26/09/2023
2. XML - Syntax
➔ The following diagram depicts the syntax rules to write different types of
markup and text in an XML document.
6
XML - Prepared by Sruthi JS - 26/09/2023
3
XML - Documents
7
XML - Prepared by Sruthi JS - 26/09/2023
3. XML - Documents
➔ An XML document is a basic unit of XML information composed of elements and other markup in an
orderly package.
➔ An XML document can contains wide variety of data.
➔ The following image depicts the parts of XML document.
Document Prolog Section :
➔ Document Prolog comes at the top of the document, before the root element.
➔ This section contains −
◆ XML declaration
◆ Document type declaration
Document Elements Section :
➔ Document Elements are the building blocks of XML.
➔ These divide the document into a hierarchy of sections, each serving a specific purpose.
➔ We can separate a document into multiple sections so that they can be rendered differently, or used by
a search engine. The elements can be containers, with a combination of text and other elements. 8
XML - Prepared by Sruthi JS - 26/09/2023
4
XML - Declaration
9
XML - Prepared by Sruthi JS - 26/09/2023
4. XML - Declaration
➔ XML declaration contains details that prepare an XML processor to parse
the XML document.
➔ It is optional, but when used, it must appear in the first line of the XML
document.
➔ Syntax
➔ Rules
◆ If the XML declaration is present in the XML, it must be placed as the first line in the XML
document.
◆ If the XML declaration is included, it must contain version number attribute.
◆ The Parameter names and values are case-sensitive.
◆ The names are always in lowercase.
◆ The order of placing the parameters is important. The correct order is: version, encoding
and standalone.
◆ Either single or double quotes may be used.
◆ The XML declaration has no closing tag i.e. </?xml>
10
XML - Prepared by Sruthi JS - 26/09/2023
5
XML - Tags
11
XML - Prepared by Sruthi JS - 26/09/2023
5. XML - Tags
➔ XML tags form the foundation of XML.
➔ They define the scope of an element in XML.
➔ They can also be used to insert comments, declare settings required for
parsing the environment, and to insert special instructions.
➔ We can broadly categorize XML tags as follows −
◆ Start Tag : The beginning of every non-empty XML element is marked by a start-tag.
◆ End Tag : Every element that has a start tag should end with an end-tag.
◆ Empty Tag : The text that appears between start-tag and end-tag is called content. An
element which has no content is termed as empty.
➔ Rules
◆ XML tags are case-sensitive.
◆ XML tags must be closed in an appropriate order, i.e., an XML tag opened inside another
element must be closed before the outer element is closed.
12
XML - Prepared by Sruthi JS - 26/09/2023
6
XML - Elements
13
XML - Prepared by Sruthi JS - 26/09/2023
6. XML - Elements
➔ XML elements can be defined as building blocks of an XML.
➔ Elements can behave as containers to hold text, elements, attributes, media objects or all
of these.
➔ Each XML document contains one or more elements, the scope of which are either
delimited by start and end tags, or for empty elements, by an empty-element tag.
➔ Syntax
➔ Example
➔ Rules
◆ An element name can contain any alphanumeric characters. The only punctuation mark allowed in
names are the hyphen (-), underscore (_) and period (.).
◆ Names are case sensitive. For example, Address, address, and ADDRESS are different names.
◆ Start and end tags of an element must be identical.
◆ An element, which is a container, can contain text or elements as seen in the above example.
14
XML - Prepared by Sruthi JS - 26/09/2023
7
XML - Attributes
15
XML - Prepared by Sruthi JS - 26/09/2023
7. XML - Attributes
➔ Attributes are part of XML elements. An element can have multiple unique
attributes.
➔ Attribute gives more information about XML elements. To be more precise,
they define properties of elements. An XML attribute is always a name-
value pair.
➔ Rules
◆ An attribute name must not appear more than once in the same start-tag or empty-
element tag.
◆ An attribute must be declared in the Document Type Definition (DTD) using an Attribute-
List Declaration.
◆ Attribute values must not contain direct or indirect entity references to external entities.
◆ The replacement text of any entity referred to directly or indirectly in an attribute value
must not contain a less than sign (<)
16
XML - Prepared by Sruthi JS - 26/09/2023
7. XML - Attributes (cond…)
➔ Example
◆ Attributes are used to distinguish among elements of the same name, when we do not
want to create a new element for every situation. Hence, the use of an attribute can add a
little more detail in differentiating two or more similar elements.
17
XML - Prepared by Sruthi JS - 26/09/2023
8
XML - Comments
18
XML - Prepared by Sruthi JS - 26/09/2023
8. XML - Comments
➔ XML comments are similar to HTML comments. The comments are added
as notes or lines for understanding the purpose of an XML code.
➔ Comments can be used to include related links, information, and terms.
They are visible only in the source code; not in the XML code.
➔ Comments may appear anywhere in XML code.
➔ Rules
◆ Comments cannot appear before XML declaration.
◆ Comments may appear anywhere in a document.
◆ Comments must not appear within attribute values.
◆ Comments cannot be nested inside the other comments.
19
XML - Prepared by Sruthi JS - 26/09/2023
8. XML - Comments (cond…)
➔ Example
20
XML - Prepared by Sruthi JS - 26/09/2023
9
XML - Character
Entities
21
XML - Prepared by Sruthi JS - 26/09/2023
9. XML - Character Entities
➔ There are some characters or symbols which are not available to be typed
directly from the keyboard or reserved for their use, which cannot be used
as content in XML code. Character Entities can be used to display those
symbols/special characters.
➔ Types of Character Entities
◆ Predefined Character Entities
◆ Numbered Character Entities
◆ Named Character Entities
22
XML - Prepared by Sruthi JS - 26/09/2023
10
XML - CDATA
Sections
23
XML - Prepared by Sruthi JS - 26/09/2023
10. XML - CDATA Sections
➔ The term CDATA means, Character Data.
➔ CDATA is defined as blocks of text that are not parsed by the parser, but
are otherwise recognized as markup.
➔ The predefined entities such as &lt;, &gt;, and &amp; require typing and
are generally difficult to read in the markup. In such cases, CDATA
section can be used.
➔ By using CDATA section, we are commanding the parser that the
particular section of the document contains no markup and should be
treated as regular text.
➔ Rules
◆ CDATA cannot contain the string "]]>" anywhere in the XML document.
◆ Nesting is not allowed in CDATA section.
➔ Example
24
XML - Prepared by Sruthi JS - 26/09/2023
11
XML - WhiteSpaces
25
XML - Prepared by Sruthi JS - 26/09/2023
11. XML - WhiteSpaces
➔ Whitespace is a collection of spaces, tabs, and newlines. They are
generally used to make a document more readable.
➔ XML document contains two types of whitespaces -
◆ Significant Whitespace
● A significant Whitespace occurs within the element which contains text and markup
present together.
◆ Insignificant Whitespace.
● Insignificant whitespace means the space where only element content is allowed.
➔ A special attribute named xml:space may be attached to an element. This
indicates that whitespace should not be removed for that element by the
application. We can set this attribute to default or preserve.
◆ The value default signals that the default whitespace processing modes of an application
are acceptable for this element.
◆ The value preserve indicates the application to preserve all the whitespaces.
26
XML - Prepared by Sruthi JS - 26/09/2023
12
XML - Processing
27
XML - Prepared by Sruthi JS - 26/09/2023
12. XML - Processing
➔ Processing instructions (PIs) allow documents to contain instructions for
applications. PIs are not part of the character data of the document, but
MUST be passed through to the application.
➔ Processing instructions (PIs) can be used to pass information to
applications. PIs can appear anywhere in the document outside the
markup. They can appear in the prolog, including the document type
definition (DTD), in textual content, or after the document.
➔ Syntax
➔ Example
◆ Here, the target is xml-stylesheet. href="tutorialspointstyle.css" and type="text/css" are
data or instructions the target application will use at the time of processing the given XML
document.
◆ In this case, a browser recognizes the target by indicating that the XML should be
transformed before being shown; the first attribute states that the type of the transform is
XSL and the second attribute points to its location. 28
XML - Prepared by Sruthi JS - 26/09/2023
13
XML - Encoding
29
XML - Prepared by Sruthi JS - 26/09/2023
13. XML - Encoding
➔ Encoding is the process of converting unicode characters into their
equivalent binary representation.
➔ When the XML processor reads an XML document, it encodes the
document depending on the type of encoding. Hence, we need to specify
the type of encoding in the XML declaration.
➔ Encoding Types
● UTF-8
● UTF-16
◆ UTF stands for UCS Transformation Format, and UCS itself means Universal Character
Set.
30
XML - Prepared by Sruthi JS - 26/09/2023
14
XML - Validation
31
XML - Prepared by Sruthi JS - 26/09/2023
14. XML - Validation
➔ Validation is a process by which an XML document is validated. An XML
document is said to be valid if its contents match with the elements,
attributes and associated document type declaration(DTD), and if the
document complies with the constraints expressed in it.
➔ Validation is dealt in two ways by the XML parser. They are −
◆ Well-formed XML document
● A well-formed document in XML is a document that "adheres to the syntax rules
specified by the XML 1.0 specification in that it must satisfy both physical and
logical structures"
◆ Valid XML document
● If an XML document is well-formed and has an associated Document Type
Declaration (DTD), then it is said to be a valid XML document.
32
XML - Prepared by Sruthi JS - 26/09/2023
15
XML - DTDs
33
XML - Prepared by Sruthi JS - 26/09/2023
15. XML - DTDs
➔ The XML Document Type Declaration, commonly known as DTD, is a way
to describe XML language precisely.
➔ DTDs check vocabulary and validity of the structure of XML documents
against grammatical rules of appropriate XML language.
➔ An XML DTD can be either specified inside the document, or it can be
kept in a separate document.
➔ Syntax
34
XML - Prepared by Sruthi JS - 26/09/2023
15. XML - DTDs
◆ The DTD starts with <!DOCTYPE delimiter.
◆ An element tells the parser to parse the document from the specified root element.
◆ DTD identifier is an identifier for the document type definition, which may be the path to
a file on the system or URL to a file on the internet. If the DTD is pointing to external
path, it is called External Subset.
◆ The square brackets [ ] enclose an optional list of entity declarations called Internal
Subset.
35
XML - Prepared by Sruthi JS - 26/09/2023
16
XML - Schemas
36
XML - Prepared by Sruthi JS - 26/09/2023
16. XML - Schemas
➔ XML Schema is commonly known as XML Schema Definition (XSD).
➔ It is used to describe and validate the structure and the content of XML
data.
➔ XML schema defines the elements, attributes and data types.
➔ Schema element supports Namespaces.
➔ It is similar to a database schema that describes the data in a database.
37
XML - Prepared by Sruthi JS - 26/09/2023
17
XML - Tree
Structure
38
XML - Prepared by Sruthi JS - 26/09/2023
17. XML - Tree Structure
➔ An XML document is always descriptive. The tree structure is often
referred to as XML Tree and plays an important role to describe any XML
document easily.
➔ The tree structure contains root (parent) elements, child elements and so
on. By using tree structure, we can get to know all succeeding branches
and sub-branches starting from the root. The parsing starts at the root,
then moves down the first branch to an element, take the first branch
from there, and so on to the leaf nodes.
39
XML - Prepared by Sruthi JS - 26/09/2023
17. XML - Tree Structure
➔ Example
40
XML - Prepared by Sruthi JS - 26/09/2023
18
XML - DOM
41
XML - Prepared by Sruthi JS - 26/09/2023
18. XML - DOM
➔ The Document Object Model (DOM) is the foundation of XML. XML
documents have a hierarchy of informational units called nodes; DOM is a
way of describing those nodes and the relationships between them.
➔ A DOM document is a collection of nodes or pieces of information
organized in a hierarchy. This hierarchy allows a developer to navigate
through the tree looking for specific information. Because it is based on a
hierarchy of information, the DOM is said to be tree based.
➔ The XML DOM, on the other hand, also provides an API that allows a
developer to add, edit, move, or remove nodes in the tree at any point in
order to create an application.
42
XML - Prepared by Sruthi JS - 26/09/2023
19
XML - Namespaces
43
XML - Prepared by Sruthi JS - 26/09/2023
19. XML - Namespaces
➔ A Namespace is a set of unique names. Namespace is a mechanisms by
which element and attribute name can be assigned to a group. The
Namespace is identified by URI(Uniform Resource Identifiers).
➔ Namespace Declaration
◆ The Namespace starts with the keyword xmlns.
◆ The word name is the Namespace prefix.
◆ The URL is the Namespace identifier.
44
XML - Prepared by Sruthi JS - 26/09/2023
20
XML - Databases
45
XML - Prepared by Sruthi JS - 26/09/2023
20. XML - Databases
➔ XML Database is used to store huge amount of information in the XML
format. As the use of XML is increasing in every field, it is required to
have a secured place to store the XML documents. The data stored in the
database can be queried using XQuery, serialized, and exported into a
desired format.
➔ There are two major types of XML databases −
◆ XML- enabled
● XML enabled database is nothing but the extension provided for the conversion of
XML document.
◆ Native XML (NXD)
● Native XML database is based on the container rather than table format. It can store
large amount of XML document and data. Native XML database is queried by the
XPath-expressions.
46
XML - Prepared by Sruthi JS - 26/09/2023
21
XML - Viewers
47
XML - Prepared by Sruthi JS - 26/09/2023
21. XML - Viewers
➔ An XML document can be viewed using a simple text editor or any
browser.
➔ Most of the major browsers supports XML. XML files can be opened in the
browser by just double-clicking the XML document (if it is a local file) or
by typing the URL path in the address bar (if the file is located on the
server), in the same way as we open other files in the browser.
➔ XML files are saved with a ".xml" extension.
48
XML - Prepared by Sruthi JS - 26/09/2023
22
XML - Editors
49
XML - Prepared by Sruthi JS - 26/09/2023
22. XML - Editors
➔ XML Editor is a markup language editor. The XML documents can be
edited or created using existing editors such as Notepad, WordPad, or any
similar text editor.
➔ Open Source XML Editors
◆ Online XML Editor
◆ Xerlin
◆ CAM - Content Assembly Mechanism
50
XML - Prepared by Sruthi JS - 26/09/2023
23
XML - Parsers
51
XML - Prepared by Sruthi JS - 26/09/2023
23. XML - Parsers
➔ XML parser is a software library or a package that provides interface for
client applications to work with XML documents. It checks for proper
format of the XML document and may also validate the XML documents.
Modern day browsers have built-in XML parsers.
➔ Following diagram shows how XML parser interacts with XML document
52
XML - Prepared by Sruthi JS - 26/09/2023
24
XML - Processors
53
XML - Prepared by Sruthi JS - 26/09/2023
24. XML - Processors
➔ When a software program reads an XML document and takes actions
accordingly, this is called processing the XML.
➔ Any program that can read and process XML documents is known as an
XML processor.
➔ An XML processor reads the XML file and turns it into in-memory
structures that the rest of the program can access.
➔ The most fundamental XML processor reads an XML document and
converts it into an internal representation for other programs or
subroutines to use.
➔ This is called a parser, and it is an important component of every XML
processing program.
54
XML - Prepared by Sruthi JS - 26/09/2023

Contenu connexe

Tendances

Basic concept of frame relay
Basic concept of frame relayBasic concept of frame relay
Basic concept of frame relay
NetProtocol Xpert
 
Image secret sharing using Shamir's scheme with Steganography
Image secret sharing using Shamir's scheme with SteganographyImage secret sharing using Shamir's scheme with Steganography
Image secret sharing using Shamir's scheme with Steganography
2510stk
 
Computer Networks-1 1st unit (10CS55) VTU
Computer Networks-1 1st unit (10CS55) VTUComputer Networks-1 1st unit (10CS55) VTU
Computer Networks-1 1st unit (10CS55) VTU
Siddharaj Junnarkar
 
Importance & Principles of Modeling from UML Designing
Importance & Principles of Modeling from UML DesigningImportance & Principles of Modeling from UML Designing
Importance & Principles of Modeling from UML Designing
ABHISHEK KUMAR
 
Comparative Analysis of Distance Vector Routing & Link State Protocols
Comparative Analysis of Distance Vector Routing & Link State ProtocolsComparative Analysis of Distance Vector Routing & Link State Protocols
Comparative Analysis of Distance Vector Routing & Link State Protocols
East West University
 
Federated learning based_trafiic_flow_prediction.ppt
Federated learning based_trafiic_flow_prediction.pptFederated learning based_trafiic_flow_prediction.ppt
Federated learning based_trafiic_flow_prediction.ppt
khalidhassan105
 
Diabetic Retinopathy.pptx
Diabetic Retinopathy.pptxDiabetic Retinopathy.pptx
Diabetic Retinopathy.pptx
NGOKUL3
 
Semi join
Semi joinSemi join
Overview of handover decision strategies in heterogeneous networks by narendr...
Overview of handover decision strategies in heterogeneous networks by narendr...Overview of handover decision strategies in heterogeneous networks by narendr...
Overview of handover decision strategies in heterogeneous networks by narendr...
Narendra Prajapati
 
Dynamic user grouping based NOMA
Dynamic user grouping based  NOMADynamic user grouping based  NOMA
Dynamic user grouping based NOMA
ShubhamSingh1797
 
Clusters techniques
Clusters techniquesClusters techniques
Clusters techniques
rajshreemuthiah
 
HDLC(high level data link control)
HDLC(high level data link control)HDLC(high level data link control)
HDLC(high level data link control)
Anand Biradar
 
Steganography
SteganographySteganography
Steganography
Jaykrishna Thakkar
 
Static networks
Static networksStatic networks
Static networks
mohamed_awad121
 
MOBILE COMMUNICATION
MOBILE COMMUNICATIONMOBILE COMMUNICATION
MOBILE COMMUNICATION
junnubabu
 
Presentation on uml
Presentation on umlPresentation on uml
Presentation on uml
Shruti Dalela
 
Firewall DMZ Zone
Firewall DMZ ZoneFirewall DMZ Zone
Firewall DMZ Zone
NetProtocol Xpert
 
Hdlc ppt..
Hdlc ppt..Hdlc ppt..
Hdlc ppt..
Prince Pal Singh
 
data-link layer protocols
data-link layer protocols  data-link layer protocols
data-link layer protocols
BE Smârt
 
A Technical Seminar on OSI model
A Technical Seminar on OSI modelA Technical Seminar on OSI model
A Technical Seminar on OSI model
Likan Patra
 

Tendances (20)

Basic concept of frame relay
Basic concept of frame relayBasic concept of frame relay
Basic concept of frame relay
 
Image secret sharing using Shamir's scheme with Steganography
Image secret sharing using Shamir's scheme with SteganographyImage secret sharing using Shamir's scheme with Steganography
Image secret sharing using Shamir's scheme with Steganography
 
Computer Networks-1 1st unit (10CS55) VTU
Computer Networks-1 1st unit (10CS55) VTUComputer Networks-1 1st unit (10CS55) VTU
Computer Networks-1 1st unit (10CS55) VTU
 
Importance & Principles of Modeling from UML Designing
Importance & Principles of Modeling from UML DesigningImportance & Principles of Modeling from UML Designing
Importance & Principles of Modeling from UML Designing
 
Comparative Analysis of Distance Vector Routing & Link State Protocols
Comparative Analysis of Distance Vector Routing & Link State ProtocolsComparative Analysis of Distance Vector Routing & Link State Protocols
Comparative Analysis of Distance Vector Routing & Link State Protocols
 
Federated learning based_trafiic_flow_prediction.ppt
Federated learning based_trafiic_flow_prediction.pptFederated learning based_trafiic_flow_prediction.ppt
Federated learning based_trafiic_flow_prediction.ppt
 
Diabetic Retinopathy.pptx
Diabetic Retinopathy.pptxDiabetic Retinopathy.pptx
Diabetic Retinopathy.pptx
 
Semi join
Semi joinSemi join
Semi join
 
Overview of handover decision strategies in heterogeneous networks by narendr...
Overview of handover decision strategies in heterogeneous networks by narendr...Overview of handover decision strategies in heterogeneous networks by narendr...
Overview of handover decision strategies in heterogeneous networks by narendr...
 
Dynamic user grouping based NOMA
Dynamic user grouping based  NOMADynamic user grouping based  NOMA
Dynamic user grouping based NOMA
 
Clusters techniques
Clusters techniquesClusters techniques
Clusters techniques
 
HDLC(high level data link control)
HDLC(high level data link control)HDLC(high level data link control)
HDLC(high level data link control)
 
Steganography
SteganographySteganography
Steganography
 
Static networks
Static networksStatic networks
Static networks
 
MOBILE COMMUNICATION
MOBILE COMMUNICATIONMOBILE COMMUNICATION
MOBILE COMMUNICATION
 
Presentation on uml
Presentation on umlPresentation on uml
Presentation on uml
 
Firewall DMZ Zone
Firewall DMZ ZoneFirewall DMZ Zone
Firewall DMZ Zone
 
Hdlc ppt..
Hdlc ppt..Hdlc ppt..
Hdlc ppt..
 
data-link layer protocols
data-link layer protocols  data-link layer protocols
data-link layer protocols
 
A Technical Seminar on OSI model
A Technical Seminar on OSI modelA Technical Seminar on OSI model
A Technical Seminar on OSI model
 

Similaire à XML

XML Presentation-2
XML Presentation-2XML Presentation-2
XML Presentation-2
Sudharsan S
 
WEB TECHNOLOGIES XML
WEB TECHNOLOGIES XMLWEB TECHNOLOGIES XML
Introduction to xml
Introduction to xmlIntroduction to xml
Introduction to xml
Shivalik college of engineering
 
XML
XMLXML
XML
XMLXML
XML notes.pptx
XML notes.pptxXML notes.pptx
XML notes.pptx
AmarYa2
 
Xml
XmlXml
Xml
XmlXml
XML
XMLXML
Introduction to XML
Introduction to XMLIntroduction to XML
Introduction to XML
Prabu U
 
eXtensible Markup Language (By Dr.Hatem Mohamed)
eXtensible Markup Language (By Dr.Hatem Mohamed)eXtensible Markup Language (By Dr.Hatem Mohamed)
eXtensible Markup Language (By Dr.Hatem Mohamed)
MUFIX Community
 
Intro xml
Intro xmlIntro xml
Intro xml
sana mateen
 
WT UNIT-2 XML.pdf
WT UNIT-2 XML.pdfWT UNIT-2 XML.pdf
WT UNIT-2 XML.pdf
Ranjeet Reddy
 
Sgml and xml
Sgml and xmlSgml and xml
Sgml and xml
Jaya Kumari
 
XML
XMLXML
Xml
XmlXml
Xml tutorial
Xml tutorialXml tutorial
Xml tutorial
IT
 
M.FLORENCE DAYANA WEB DESIGN -Unit 5 XML
M.FLORENCE DAYANA WEB DESIGN -Unit 5   XMLM.FLORENCE DAYANA WEB DESIGN -Unit 5   XML
M.FLORENCE DAYANA WEB DESIGN -Unit 5 XML
Dr.Florence Dayana
 
Unit 5 xml (1)
Unit 5   xml (1)Unit 5   xml (1)
Unit 5 xml (1)
manochitra10
 
Xml
XmlXml

Similaire à XML (20)

XML Presentation-2
XML Presentation-2XML Presentation-2
XML Presentation-2
 
WEB TECHNOLOGIES XML
WEB TECHNOLOGIES XMLWEB TECHNOLOGIES XML
WEB TECHNOLOGIES XML
 
Introduction to xml
Introduction to xmlIntroduction to xml
Introduction to xml
 
XML
XMLXML
XML
 
XML
XMLXML
XML
 
XML notes.pptx
XML notes.pptxXML notes.pptx
XML notes.pptx
 
Xml
XmlXml
Xml
 
Xml
XmlXml
Xml
 
XML
XMLXML
XML
 
Introduction to XML
Introduction to XMLIntroduction to XML
Introduction to XML
 
eXtensible Markup Language (By Dr.Hatem Mohamed)
eXtensible Markup Language (By Dr.Hatem Mohamed)eXtensible Markup Language (By Dr.Hatem Mohamed)
eXtensible Markup Language (By Dr.Hatem Mohamed)
 
Intro xml
Intro xmlIntro xml
Intro xml
 
WT UNIT-2 XML.pdf
WT UNIT-2 XML.pdfWT UNIT-2 XML.pdf
WT UNIT-2 XML.pdf
 
Sgml and xml
Sgml and xmlSgml and xml
Sgml and xml
 
XML
XMLXML
XML
 
Xml
XmlXml
Xml
 
Xml tutorial
Xml tutorialXml tutorial
Xml tutorial
 
M.FLORENCE DAYANA WEB DESIGN -Unit 5 XML
M.FLORENCE DAYANA WEB DESIGN -Unit 5   XMLM.FLORENCE DAYANA WEB DESIGN -Unit 5   XML
M.FLORENCE DAYANA WEB DESIGN -Unit 5 XML
 
Unit 5 xml (1)
Unit 5   xml (1)Unit 5   xml (1)
Unit 5 xml (1)
 
Xml
XmlXml
Xml
 

Dernier

5G Radio Network Througput Problem Analysis HCIA.pdf
5G Radio Network Througput Problem Analysis HCIA.pdf5G Radio Network Througput Problem Analysis HCIA.pdf
5G Radio Network Througput Problem Analysis HCIA.pdf
AlvianRamadhani5
 
Digital Twins Computer Networking Paper Presentation.pptx
Digital Twins Computer Networking Paper Presentation.pptxDigital Twins Computer Networking Paper Presentation.pptx
Digital Twins Computer Networking Paper Presentation.pptx
aryanpankaj78
 
Tools & Techniques for Commissioning and Maintaining PV Systems W-Animations ...
Tools & Techniques for Commissioning and Maintaining PV Systems W-Animations ...Tools & Techniques for Commissioning and Maintaining PV Systems W-Animations ...
Tools & Techniques for Commissioning and Maintaining PV Systems W-Animations ...
Transcat
 
smart pill dispenser is designed to improve medication adherence and safety f...
smart pill dispenser is designed to improve medication adherence and safety f...smart pill dispenser is designed to improve medication adherence and safety f...
smart pill dispenser is designed to improve medication adherence and safety f...
um7474492
 
一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理
一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理
一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理
ecqow
 
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
Sinan KOZAK
 
OOPS_Lab_Manual - programs using C++ programming language
OOPS_Lab_Manual - programs using C++ programming languageOOPS_Lab_Manual - programs using C++ programming language
OOPS_Lab_Manual - programs using C++ programming language
PreethaV16
 
Height and depth gauge linear metrology.pdf
Height and depth gauge linear metrology.pdfHeight and depth gauge linear metrology.pdf
Height and depth gauge linear metrology.pdf
q30122000
 
4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf
4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf
4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf
Gino153088
 
Applications of artificial Intelligence in Mechanical Engineering.pdf
Applications of artificial Intelligence in Mechanical Engineering.pdfApplications of artificial Intelligence in Mechanical Engineering.pdf
Applications of artificial Intelligence in Mechanical Engineering.pdf
Atif Razi
 
一比一原版(爱大毕业证书)爱荷华大学毕业证如何办理
一比一原版(爱大毕业证书)爱荷华大学毕业证如何办理一比一原版(爱大毕业证书)爱荷华大学毕业证如何办理
一比一原版(爱大毕业证书)爱荷华大学毕业证如何办理
nedcocy
 
Mechatronics material . Mechanical engineering
Mechatronics material . Mechanical engineeringMechatronics material . Mechanical engineering
Mechatronics material . Mechanical engineering
sachin chaurasia
 
Mechanical Engineering on AAI Summer Training Report-003.pdf
Mechanical Engineering on AAI Summer Training Report-003.pdfMechanical Engineering on AAI Summer Training Report-003.pdf
Mechanical Engineering on AAI Summer Training Report-003.pdf
21UME003TUSHARDEB
 
2. protection of river banks and bed erosion protection works.ppt
2. protection of river banks and bed erosion protection works.ppt2. protection of river banks and bed erosion protection works.ppt
2. protection of river banks and bed erosion protection works.ppt
abdatawakjira
 
Software Engineering and Project Management - Introduction, Modeling Concepts...
Software Engineering and Project Management - Introduction, Modeling Concepts...Software Engineering and Project Management - Introduction, Modeling Concepts...
Software Engineering and Project Management - Introduction, Modeling Concepts...
Prakhyath Rai
 
一比一原版(osu毕业证书)美国俄勒冈州立大学毕业证如何办理
一比一原版(osu毕业证书)美国俄勒冈州立大学毕业证如何办理一比一原版(osu毕业证书)美国俄勒冈州立大学毕业证如何办理
一比一原版(osu毕业证书)美国俄勒冈州立大学毕业证如何办理
upoux
 
SENTIMENT ANALYSIS ON PPT AND Project template_.pptx
SENTIMENT ANALYSIS ON PPT AND Project template_.pptxSENTIMENT ANALYSIS ON PPT AND Project template_.pptx
SENTIMENT ANALYSIS ON PPT AND Project template_.pptx
b0754201
 
SCALING OF MOS CIRCUITS m .pptx
SCALING OF MOS CIRCUITS m                 .pptxSCALING OF MOS CIRCUITS m                 .pptx
SCALING OF MOS CIRCUITS m .pptx
harshapolam10
 
Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...
Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...
Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...
shadow0702a
 
一比一原版(uoft毕业证书)加拿大多伦多大学毕业证如何办理
一比一原版(uoft毕业证书)加拿大多伦多大学毕业证如何办理一比一原版(uoft毕业证书)加拿大多伦多大学毕业证如何办理
一比一原版(uoft毕业证书)加拿大多伦多大学毕业证如何办理
sydezfe
 

Dernier (20)

5G Radio Network Througput Problem Analysis HCIA.pdf
5G Radio Network Througput Problem Analysis HCIA.pdf5G Radio Network Througput Problem Analysis HCIA.pdf
5G Radio Network Througput Problem Analysis HCIA.pdf
 
Digital Twins Computer Networking Paper Presentation.pptx
Digital Twins Computer Networking Paper Presentation.pptxDigital Twins Computer Networking Paper Presentation.pptx
Digital Twins Computer Networking Paper Presentation.pptx
 
Tools & Techniques for Commissioning and Maintaining PV Systems W-Animations ...
Tools & Techniques for Commissioning and Maintaining PV Systems W-Animations ...Tools & Techniques for Commissioning and Maintaining PV Systems W-Animations ...
Tools & Techniques for Commissioning and Maintaining PV Systems W-Animations ...
 
smart pill dispenser is designed to improve medication adherence and safety f...
smart pill dispenser is designed to improve medication adherence and safety f...smart pill dispenser is designed to improve medication adherence and safety f...
smart pill dispenser is designed to improve medication adherence and safety f...
 
一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理
一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理
一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理
 
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
 
OOPS_Lab_Manual - programs using C++ programming language
OOPS_Lab_Manual - programs using C++ programming languageOOPS_Lab_Manual - programs using C++ programming language
OOPS_Lab_Manual - programs using C++ programming language
 
Height and depth gauge linear metrology.pdf
Height and depth gauge linear metrology.pdfHeight and depth gauge linear metrology.pdf
Height and depth gauge linear metrology.pdf
 
4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf
4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf
4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf
 
Applications of artificial Intelligence in Mechanical Engineering.pdf
Applications of artificial Intelligence in Mechanical Engineering.pdfApplications of artificial Intelligence in Mechanical Engineering.pdf
Applications of artificial Intelligence in Mechanical Engineering.pdf
 
一比一原版(爱大毕业证书)爱荷华大学毕业证如何办理
一比一原版(爱大毕业证书)爱荷华大学毕业证如何办理一比一原版(爱大毕业证书)爱荷华大学毕业证如何办理
一比一原版(爱大毕业证书)爱荷华大学毕业证如何办理
 
Mechatronics material . Mechanical engineering
Mechatronics material . Mechanical engineeringMechatronics material . Mechanical engineering
Mechatronics material . Mechanical engineering
 
Mechanical Engineering on AAI Summer Training Report-003.pdf
Mechanical Engineering on AAI Summer Training Report-003.pdfMechanical Engineering on AAI Summer Training Report-003.pdf
Mechanical Engineering on AAI Summer Training Report-003.pdf
 
2. protection of river banks and bed erosion protection works.ppt
2. protection of river banks and bed erosion protection works.ppt2. protection of river banks and bed erosion protection works.ppt
2. protection of river banks and bed erosion protection works.ppt
 
Software Engineering and Project Management - Introduction, Modeling Concepts...
Software Engineering and Project Management - Introduction, Modeling Concepts...Software Engineering and Project Management - Introduction, Modeling Concepts...
Software Engineering and Project Management - Introduction, Modeling Concepts...
 
一比一原版(osu毕业证书)美国俄勒冈州立大学毕业证如何办理
一比一原版(osu毕业证书)美国俄勒冈州立大学毕业证如何办理一比一原版(osu毕业证书)美国俄勒冈州立大学毕业证如何办理
一比一原版(osu毕业证书)美国俄勒冈州立大学毕业证如何办理
 
SENTIMENT ANALYSIS ON PPT AND Project template_.pptx
SENTIMENT ANALYSIS ON PPT AND Project template_.pptxSENTIMENT ANALYSIS ON PPT AND Project template_.pptx
SENTIMENT ANALYSIS ON PPT AND Project template_.pptx
 
SCALING OF MOS CIRCUITS m .pptx
SCALING OF MOS CIRCUITS m                 .pptxSCALING OF MOS CIRCUITS m                 .pptx
SCALING OF MOS CIRCUITS m .pptx
 
Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...
Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...
Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...
 
一比一原版(uoft毕业证书)加拿大多伦多大学毕业证如何办理
一比一原版(uoft毕业证书)加拿大多伦多大学毕业证如何办理一比一原版(uoft毕业证书)加拿大多伦多大学毕业证如何办理
一比一原版(uoft毕业证书)加拿大多伦多大学毕业证如何办理
 

XML

  • 1. XML - Prepared by Sruthi JS - 26/09/2023 XML Prepared by Sruthi JS 1
  • 2. XML - Prepared by Sruthi JS - 26/09/2023 1 XML - Introduction 2 XML - Syntax 3 XML - Documents 4 XML - Declaration 5 XML - Tags 6 XML - Elements 7 XML - Attributes 8 XML - Comments 9 XML - Character Entities 10 XML - CDATA Sections 11 XML - WhiteSpaces 12 XML - Processing 13 XML - Encoding 14 XML - Validation 15 XML - DTDs 16 XML - Schemas 17 XML - Tree Structure 18 XML - DOM 19 XML - Namespaces 20 XML - Databases 21 XML - Viewers 22 XML - Editors 23 XML - Parsers 24 XML - Processors
  • 3. XML - Prepared by Sruthi JS - 26/09/2023 1 XML - introduction 3
  • 4. XML - Prepared by Sruthi JS - 26/09/2023 1. XML - Introduction ➔ XML stands for Extensible Markup Language. ➔ It is a text-based markup language derived from Standard Generalized Markup Language (SGML). Is XML a Programming Language? ➔ A programming language consists of grammar rules and its own vocabulary which is used to create computer programs. These programs instruct the computer to perform specific tasks. ➔ XML does not qualify to be a programming language as it does not perform any computation or algorithms. It is usually stored in a simple text file and is processed by special software that is capable of interpreting XML. Advantages of xml ➔ XML uses human, not computer, language. XML is readable and understandable, even by novices, and no more difficult to code than HTML. ➔ XML is completely compatible with Java™ and 100% portable. Any application that can process XML can use our information, regardless of platform. ➔ XML is extendable. Create our own tags, or use tags created by others, that use the natural language of our domain, that have the attributes we need, and that makes sense to us and our users. 4
  • 5. XML - Prepared by Sruthi JS - 26/09/2023 2 XML - Syntax 5
  • 6. XML - Prepared by Sruthi JS - 26/09/2023 2. XML - Syntax ➔ The following diagram depicts the syntax rules to write different types of markup and text in an XML document. 6
  • 7. XML - Prepared by Sruthi JS - 26/09/2023 3 XML - Documents 7
  • 8. XML - Prepared by Sruthi JS - 26/09/2023 3. XML - Documents ➔ An XML document is a basic unit of XML information composed of elements and other markup in an orderly package. ➔ An XML document can contains wide variety of data. ➔ The following image depicts the parts of XML document. Document Prolog Section : ➔ Document Prolog comes at the top of the document, before the root element. ➔ This section contains − ◆ XML declaration ◆ Document type declaration Document Elements Section : ➔ Document Elements are the building blocks of XML. ➔ These divide the document into a hierarchy of sections, each serving a specific purpose. ➔ We can separate a document into multiple sections so that they can be rendered differently, or used by a search engine. The elements can be containers, with a combination of text and other elements. 8
  • 9. XML - Prepared by Sruthi JS - 26/09/2023 4 XML - Declaration 9
  • 10. XML - Prepared by Sruthi JS - 26/09/2023 4. XML - Declaration ➔ XML declaration contains details that prepare an XML processor to parse the XML document. ➔ It is optional, but when used, it must appear in the first line of the XML document. ➔ Syntax ➔ Rules ◆ If the XML declaration is present in the XML, it must be placed as the first line in the XML document. ◆ If the XML declaration is included, it must contain version number attribute. ◆ The Parameter names and values are case-sensitive. ◆ The names are always in lowercase. ◆ The order of placing the parameters is important. The correct order is: version, encoding and standalone. ◆ Either single or double quotes may be used. ◆ The XML declaration has no closing tag i.e. </?xml> 10
  • 11. XML - Prepared by Sruthi JS - 26/09/2023 5 XML - Tags 11
  • 12. XML - Prepared by Sruthi JS - 26/09/2023 5. XML - Tags ➔ XML tags form the foundation of XML. ➔ They define the scope of an element in XML. ➔ They can also be used to insert comments, declare settings required for parsing the environment, and to insert special instructions. ➔ We can broadly categorize XML tags as follows − ◆ Start Tag : The beginning of every non-empty XML element is marked by a start-tag. ◆ End Tag : Every element that has a start tag should end with an end-tag. ◆ Empty Tag : The text that appears between start-tag and end-tag is called content. An element which has no content is termed as empty. ➔ Rules ◆ XML tags are case-sensitive. ◆ XML tags must be closed in an appropriate order, i.e., an XML tag opened inside another element must be closed before the outer element is closed. 12
  • 13. XML - Prepared by Sruthi JS - 26/09/2023 6 XML - Elements 13
  • 14. XML - Prepared by Sruthi JS - 26/09/2023 6. XML - Elements ➔ XML elements can be defined as building blocks of an XML. ➔ Elements can behave as containers to hold text, elements, attributes, media objects or all of these. ➔ Each XML document contains one or more elements, the scope of which are either delimited by start and end tags, or for empty elements, by an empty-element tag. ➔ Syntax ➔ Example ➔ Rules ◆ An element name can contain any alphanumeric characters. The only punctuation mark allowed in names are the hyphen (-), underscore (_) and period (.). ◆ Names are case sensitive. For example, Address, address, and ADDRESS are different names. ◆ Start and end tags of an element must be identical. ◆ An element, which is a container, can contain text or elements as seen in the above example. 14
  • 15. XML - Prepared by Sruthi JS - 26/09/2023 7 XML - Attributes 15
  • 16. XML - Prepared by Sruthi JS - 26/09/2023 7. XML - Attributes ➔ Attributes are part of XML elements. An element can have multiple unique attributes. ➔ Attribute gives more information about XML elements. To be more precise, they define properties of elements. An XML attribute is always a name- value pair. ➔ Rules ◆ An attribute name must not appear more than once in the same start-tag or empty- element tag. ◆ An attribute must be declared in the Document Type Definition (DTD) using an Attribute- List Declaration. ◆ Attribute values must not contain direct or indirect entity references to external entities. ◆ The replacement text of any entity referred to directly or indirectly in an attribute value must not contain a less than sign (<) 16
  • 17. XML - Prepared by Sruthi JS - 26/09/2023 7. XML - Attributes (cond…) ➔ Example ◆ Attributes are used to distinguish among elements of the same name, when we do not want to create a new element for every situation. Hence, the use of an attribute can add a little more detail in differentiating two or more similar elements. 17
  • 18. XML - Prepared by Sruthi JS - 26/09/2023 8 XML - Comments 18
  • 19. XML - Prepared by Sruthi JS - 26/09/2023 8. XML - Comments ➔ XML comments are similar to HTML comments. The comments are added as notes or lines for understanding the purpose of an XML code. ➔ Comments can be used to include related links, information, and terms. They are visible only in the source code; not in the XML code. ➔ Comments may appear anywhere in XML code. ➔ Rules ◆ Comments cannot appear before XML declaration. ◆ Comments may appear anywhere in a document. ◆ Comments must not appear within attribute values. ◆ Comments cannot be nested inside the other comments. 19
  • 20. XML - Prepared by Sruthi JS - 26/09/2023 8. XML - Comments (cond…) ➔ Example 20
  • 21. XML - Prepared by Sruthi JS - 26/09/2023 9 XML - Character Entities 21
  • 22. XML - Prepared by Sruthi JS - 26/09/2023 9. XML - Character Entities ➔ There are some characters or symbols which are not available to be typed directly from the keyboard or reserved for their use, which cannot be used as content in XML code. Character Entities can be used to display those symbols/special characters. ➔ Types of Character Entities ◆ Predefined Character Entities ◆ Numbered Character Entities ◆ Named Character Entities 22
  • 23. XML - Prepared by Sruthi JS - 26/09/2023 10 XML - CDATA Sections 23
  • 24. XML - Prepared by Sruthi JS - 26/09/2023 10. XML - CDATA Sections ➔ The term CDATA means, Character Data. ➔ CDATA is defined as blocks of text that are not parsed by the parser, but are otherwise recognized as markup. ➔ The predefined entities such as &lt;, &gt;, and &amp; require typing and are generally difficult to read in the markup. In such cases, CDATA section can be used. ➔ By using CDATA section, we are commanding the parser that the particular section of the document contains no markup and should be treated as regular text. ➔ Rules ◆ CDATA cannot contain the string "]]>" anywhere in the XML document. ◆ Nesting is not allowed in CDATA section. ➔ Example 24
  • 25. XML - Prepared by Sruthi JS - 26/09/2023 11 XML - WhiteSpaces 25
  • 26. XML - Prepared by Sruthi JS - 26/09/2023 11. XML - WhiteSpaces ➔ Whitespace is a collection of spaces, tabs, and newlines. They are generally used to make a document more readable. ➔ XML document contains two types of whitespaces - ◆ Significant Whitespace ● A significant Whitespace occurs within the element which contains text and markup present together. ◆ Insignificant Whitespace. ● Insignificant whitespace means the space where only element content is allowed. ➔ A special attribute named xml:space may be attached to an element. This indicates that whitespace should not be removed for that element by the application. We can set this attribute to default or preserve. ◆ The value default signals that the default whitespace processing modes of an application are acceptable for this element. ◆ The value preserve indicates the application to preserve all the whitespaces. 26
  • 27. XML - Prepared by Sruthi JS - 26/09/2023 12 XML - Processing 27
  • 28. XML - Prepared by Sruthi JS - 26/09/2023 12. XML - Processing ➔ Processing instructions (PIs) allow documents to contain instructions for applications. PIs are not part of the character data of the document, but MUST be passed through to the application. ➔ Processing instructions (PIs) can be used to pass information to applications. PIs can appear anywhere in the document outside the markup. They can appear in the prolog, including the document type definition (DTD), in textual content, or after the document. ➔ Syntax ➔ Example ◆ Here, the target is xml-stylesheet. href="tutorialspointstyle.css" and type="text/css" are data or instructions the target application will use at the time of processing the given XML document. ◆ In this case, a browser recognizes the target by indicating that the XML should be transformed before being shown; the first attribute states that the type of the transform is XSL and the second attribute points to its location. 28
  • 29. XML - Prepared by Sruthi JS - 26/09/2023 13 XML - Encoding 29
  • 30. XML - Prepared by Sruthi JS - 26/09/2023 13. XML - Encoding ➔ Encoding is the process of converting unicode characters into their equivalent binary representation. ➔ When the XML processor reads an XML document, it encodes the document depending on the type of encoding. Hence, we need to specify the type of encoding in the XML declaration. ➔ Encoding Types ● UTF-8 ● UTF-16 ◆ UTF stands for UCS Transformation Format, and UCS itself means Universal Character Set. 30
  • 31. XML - Prepared by Sruthi JS - 26/09/2023 14 XML - Validation 31
  • 32. XML - Prepared by Sruthi JS - 26/09/2023 14. XML - Validation ➔ Validation is a process by which an XML document is validated. An XML document is said to be valid if its contents match with the elements, attributes and associated document type declaration(DTD), and if the document complies with the constraints expressed in it. ➔ Validation is dealt in two ways by the XML parser. They are − ◆ Well-formed XML document ● A well-formed document in XML is a document that "adheres to the syntax rules specified by the XML 1.0 specification in that it must satisfy both physical and logical structures" ◆ Valid XML document ● If an XML document is well-formed and has an associated Document Type Declaration (DTD), then it is said to be a valid XML document. 32
  • 33. XML - Prepared by Sruthi JS - 26/09/2023 15 XML - DTDs 33
  • 34. XML - Prepared by Sruthi JS - 26/09/2023 15. XML - DTDs ➔ The XML Document Type Declaration, commonly known as DTD, is a way to describe XML language precisely. ➔ DTDs check vocabulary and validity of the structure of XML documents against grammatical rules of appropriate XML language. ➔ An XML DTD can be either specified inside the document, or it can be kept in a separate document. ➔ Syntax 34
  • 35. XML - Prepared by Sruthi JS - 26/09/2023 15. XML - DTDs ◆ The DTD starts with <!DOCTYPE delimiter. ◆ An element tells the parser to parse the document from the specified root element. ◆ DTD identifier is an identifier for the document type definition, which may be the path to a file on the system or URL to a file on the internet. If the DTD is pointing to external path, it is called External Subset. ◆ The square brackets [ ] enclose an optional list of entity declarations called Internal Subset. 35
  • 36. XML - Prepared by Sruthi JS - 26/09/2023 16 XML - Schemas 36
  • 37. XML - Prepared by Sruthi JS - 26/09/2023 16. XML - Schemas ➔ XML Schema is commonly known as XML Schema Definition (XSD). ➔ It is used to describe and validate the structure and the content of XML data. ➔ XML schema defines the elements, attributes and data types. ➔ Schema element supports Namespaces. ➔ It is similar to a database schema that describes the data in a database. 37
  • 38. XML - Prepared by Sruthi JS - 26/09/2023 17 XML - Tree Structure 38
  • 39. XML - Prepared by Sruthi JS - 26/09/2023 17. XML - Tree Structure ➔ An XML document is always descriptive. The tree structure is often referred to as XML Tree and plays an important role to describe any XML document easily. ➔ The tree structure contains root (parent) elements, child elements and so on. By using tree structure, we can get to know all succeeding branches and sub-branches starting from the root. The parsing starts at the root, then moves down the first branch to an element, take the first branch from there, and so on to the leaf nodes. 39
  • 40. XML - Prepared by Sruthi JS - 26/09/2023 17. XML - Tree Structure ➔ Example 40
  • 41. XML - Prepared by Sruthi JS - 26/09/2023 18 XML - DOM 41
  • 42. XML - Prepared by Sruthi JS - 26/09/2023 18. XML - DOM ➔ The Document Object Model (DOM) is the foundation of XML. XML documents have a hierarchy of informational units called nodes; DOM is a way of describing those nodes and the relationships between them. ➔ A DOM document is a collection of nodes or pieces of information organized in a hierarchy. This hierarchy allows a developer to navigate through the tree looking for specific information. Because it is based on a hierarchy of information, the DOM is said to be tree based. ➔ The XML DOM, on the other hand, also provides an API that allows a developer to add, edit, move, or remove nodes in the tree at any point in order to create an application. 42
  • 43. XML - Prepared by Sruthi JS - 26/09/2023 19 XML - Namespaces 43
  • 44. XML - Prepared by Sruthi JS - 26/09/2023 19. XML - Namespaces ➔ A Namespace is a set of unique names. Namespace is a mechanisms by which element and attribute name can be assigned to a group. The Namespace is identified by URI(Uniform Resource Identifiers). ➔ Namespace Declaration ◆ The Namespace starts with the keyword xmlns. ◆ The word name is the Namespace prefix. ◆ The URL is the Namespace identifier. 44
  • 45. XML - Prepared by Sruthi JS - 26/09/2023 20 XML - Databases 45
  • 46. XML - Prepared by Sruthi JS - 26/09/2023 20. XML - Databases ➔ XML Database is used to store huge amount of information in the XML format. As the use of XML is increasing in every field, it is required to have a secured place to store the XML documents. The data stored in the database can be queried using XQuery, serialized, and exported into a desired format. ➔ There are two major types of XML databases − ◆ XML- enabled ● XML enabled database is nothing but the extension provided for the conversion of XML document. ◆ Native XML (NXD) ● Native XML database is based on the container rather than table format. It can store large amount of XML document and data. Native XML database is queried by the XPath-expressions. 46
  • 47. XML - Prepared by Sruthi JS - 26/09/2023 21 XML - Viewers 47
  • 48. XML - Prepared by Sruthi JS - 26/09/2023 21. XML - Viewers ➔ An XML document can be viewed using a simple text editor or any browser. ➔ Most of the major browsers supports XML. XML files can be opened in the browser by just double-clicking the XML document (if it is a local file) or by typing the URL path in the address bar (if the file is located on the server), in the same way as we open other files in the browser. ➔ XML files are saved with a ".xml" extension. 48
  • 49. XML - Prepared by Sruthi JS - 26/09/2023 22 XML - Editors 49
  • 50. XML - Prepared by Sruthi JS - 26/09/2023 22. XML - Editors ➔ XML Editor is a markup language editor. The XML documents can be edited or created using existing editors such as Notepad, WordPad, or any similar text editor. ➔ Open Source XML Editors ◆ Online XML Editor ◆ Xerlin ◆ CAM - Content Assembly Mechanism 50
  • 51. XML - Prepared by Sruthi JS - 26/09/2023 23 XML - Parsers 51
  • 52. XML - Prepared by Sruthi JS - 26/09/2023 23. XML - Parsers ➔ XML parser is a software library or a package that provides interface for client applications to work with XML documents. It checks for proper format of the XML document and may also validate the XML documents. Modern day browsers have built-in XML parsers. ➔ Following diagram shows how XML parser interacts with XML document 52
  • 53. XML - Prepared by Sruthi JS - 26/09/2023 24 XML - Processors 53
  • 54. XML - Prepared by Sruthi JS - 26/09/2023 24. XML - Processors ➔ When a software program reads an XML document and takes actions accordingly, this is called processing the XML. ➔ Any program that can read and process XML documents is known as an XML processor. ➔ An XML processor reads the XML file and turns it into in-memory structures that the rest of the program can access. ➔ The most fundamental XML processor reads an XML document and converts it into an internal representation for other programs or subroutines to use. ➔ This is called a parser, and it is an important component of every XML processing program. 54
  • 55. XML - Prepared by Sruthi JS - 26/09/2023