module2B.pptx
module2B.pptx
module2B.pptx
1. XML 1.0
2. XML 1.1
XML
XML
XML
XML
XML
XML
XML Features
• It is extensible and human-readable.
• It is platform and language independent.
• It separates data from HTML.
• XML tags are not predefined. You need to define your customized
tags.
XML Declaration
<age> 20 </age>
<gm>Mr. Wood</gm>
</company>
They are −
DTD Rules
• If DTD is present, it must appear at the start of the document
(only the XML declaration can appear above the DTD).
• The DTD name and element type of the root element must be the
same.
XML Namespaces
Namespaces help to avoid element name conflicts.
Namespace Declaration -
<element xmlns:name="URL">
</abt:person>
XML Schemas
• XML schema (also known as XML schema definition or XSD) use to
describe the XML document structure. It is an alternative to DTD.
Why Schema is Important?
• DTD is not powerful as schema as it is not extensible and flexible
enough. So, it may not be suitable for some situations. In such a
situation schema is important.
• The main purpose of using XML schema is to define the elements
and attributes of an XML document.
XML Schemas
Following code segment shows an example of XML schema.
<xs:schema xmlns:xs = "http://www.w3.org/2001/XMLSchema">
<xs:element name = "employee">
<xs:complexType>
<xs:sequence>
<xs:element name = "firstname" type = "xs:string" />
<xs:element name = "lastname" type = "xs:string" />
<xs:element name = "phone" type = "xs:int" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
XSL - EXtensible Stylesheet Language
Need for XSL
• HTML document, tags are predefined such as table, div, and span;
and the browser knows how to add style to them and display those
using CSS styles.
• But in case of XML documents, tags are not predefined.
• In order to understand and style an XML document, World Wide
Web Consortium (W3C) developed XSL which can act as XML based
Stylesheet Language.
https://www.guru99.com/xml-tutorials.h
tml