0% found this document useful (0 votes)
11 views15 pages

Pec-Cs801d

The document provides a comprehensive overview of Extensible Markup Language (XML), detailing its history, syntax, applications, advantages, and challenges. XML is a flexible data format that allows for the storage and transmission of information in a structured manner, and is widely used in web development, data exchange, and document management. Despite the emergence of alternatives like JSON, XML remains relevant due to its extensibility and self-descriptive nature.

Uploaded by

halderriya56732
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views15 pages

Pec-Cs801d

The document provides a comprehensive overview of Extensible Markup Language (XML), detailing its history, syntax, applications, advantages, and challenges. XML is a flexible data format that allows for the storage and transmission of information in a structured manner, and is widely used in web development, data exchange, and document management. Despite the emergence of alternatives like JSON, XML remains relevant due to its extensibility and self-descriptive nature.

Uploaded by

halderriya56732
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 15

‭1‬

‭2‬

‭Extensible Markup Language‬

‭(XML)‬

‭Name : RIYA HALDER‬

‭GARGI MEMORIAL INSTITUTE OF TECHNOLOGY‬

‭paper name : WEB AND INTERNET TECHNOLOGY‬

‭Paper code : PEC-CS801D‬

‭Instructor : PRONITA MUKHERJEE‬

‭Date : 08/03/2025‬
‭3‬

‭Introduction‬

‭Extensible Markup Language (XML) is a widely used data format‬


‭that facilitates the storage, transmission, and structuring of‬
‭information in a human-readable and machine-readable‬
‭manner. Developed by the World Wide Web Consortium (W3C),‬
‭XML provides a flexible framework for encoding documents and‬
‭data structures in a format that is both software- and‬
‭hardware-independent. This report explores XML in depth,‬
‭covering its history, syntax, applications, advantages, and‬
‭challenges.‬

‭There are many languages based on XML, including XHTML,‬


‭MathML, SVG, RSS, and RDF. You can also define your own.‬

‭History of XML‬

‭XML was developed in the late 1990s as a simplification of the‬


‭Standard Generalized Markup Language (SGML), which was too‬
‭complex for many applications. The first XML specification,‬
‭XML 1.0, was published by the W3C in 1998. It was designed to‬
‭4‬

‭improve upon the limitations of HTML by allowing users to‬


‭define their own elements, making it a more flexible and scalable‬
‭solution for various data exchange and web-based applications.‬

‭Structure of an XML document‬

‭The whole structure of XML and XML-based languages is built on tags.‬

‭XML declaration‬

‭XML - declaration is not a tag. It is used for the transmission of‬


‭the meta-data of a document.‬
‭➢‬ ‭<?xml version="1.0" encoding="UTF-8"?>‬

‭Attributes‬
Version‬

‭Used version XML in this document.‬
Encoding‬

‭Used encoding in this document.‬

‭“Correct” XML (valid and well-formed)‬


‭For an XML document to be correct, the following conditions‬
‭must be fulfilled:‬
‭●‬ ‭Document must be well-formed.‬
‭●‬ ‭Document must conform to all XML syntax rules.‬
‭5‬

‭●‬ ‭Document must conform to semantic rules, which are‬


‭usually set in an XML schema or a DTD (Document Type‬
‭Definition)‬

‭Example‬
‭<?xml version="1.0" encoding="UTF-8"?>‬
‭<message>‬
‭<warning>‬
‭Hello World‬
‭<!--missing </warning> -->‬
‭</message>‬

‭Now let's look at a corrected version of that same document:‬


‭<?xml version="1.0" encoding="UTF-8"?>‬
‭<message>‬
‭<warning>‬
‭Hello World‬
‭</warning>‬
‭</message>‬
‭6‬

‭A document that contains an undefined tag is invalid. For‬


‭example, if we never defined the <warning> tag, the document‬
‭above wouldn't be valid.‬

‭Most browsers offer a debugger that can identify poorly-formed‬


‭XML documents.‬

‭Character references‬
‭Like HTML, XML offers character references for referring to‬
‭some special reserved characters (such as a greater than sign‬
‭which is used for tags). There are five of these characters :‬
‭7‬

‭XML Syntax and Structure‬

‭XML documents consist of elements enclosed within tags,‬


‭following a hierarchical structure. Some fundamental rules and‬
‭components of XML syntax include:‬

‭●‬ ‭Elements: The basic building blocks, enclosed in opening‬


‭(‬‭<tag>‬‭) and closing (‬‭</tag>‬‭) tags.‬
‭●‬ ‭Attributes: Provide additional information about an‬
‭element, specified within the opening tag (e.g.,‬‭<person‬
‭age="30">‬‭).‬

‭●‬ ‭Prolog: The XML declaration at the beginning of the‬


‭document (e.g.,‬‭<?xml version="1.0" encoding="UTF-8"?>‬‭).‬
‭●‬ ‭Well-formedness: XML documents must adhere to correct‬
‭nesting, case sensitivity, and a single root element.‬
‭●‬ ‭Comments: Inserted using‬‭<!-- comment -->‬‭.‬
‭●‬ ‭CDATA Sections: Used to include data that should not be‬
‭parsed as XML markup (‬‭<![CDATA[ raw data ]]>‬‭).‬
‭8‬

‭Displaying XML‬
‭XML is usually used for descriptive purposes, but there are ways‬
‭to display XML data. If you don't define a specific way for the‬
‭XML to be rendered, the raw XML is displayed in the browser.‬
‭One way to style XML output is to specify CSS to apply to the‬
‭document using the xml-stylesheet processing instruction.‬
‭<?xml-stylesheet type="text/css" href="stylesheet.css"?>‬

‭There is also another more powerful way to display XML: the‬


‭Extensible Stylesheet Language Transformations (XSLT) which‬
‭can be used to transform XML into other languages such as‬
‭HTML. This makes XML incredibly versatile.‬
‭<?xml-stylesheet type="text/xsl" href="transform.xsl"?>‬

‭Applications of XML‬

‭XML is widely used in various fields and technologies, including:‬

‭1.‬ ‭Web Development: Used in web services such as SOAP‬


‭(Simple Object Access Protocol) and configuration files like‬
‭XHTML.‬
‭9‬

‭2.‬ ‭Data Storage and Exchange: Acts as an intermediary format‬


‭for data exchange between different software and systems.‬
‭3.‬ ‭Configuration Files: Many applications use XML-based‬
.NET‬‭applications,‬
‭configuration files to store settings (e.g.,‬‭
‭Android manifests).‬
‭4.‬ ‭RSS Feeds: Used to syndicate content such as blogs and‬
‭news updates.‬
‭5.‬ ‭Document Management: Forms the foundation of‬
‭standards like DocBook and OpenDocument.‬
‭6.‬ ‭Database Interactions: XML-based databases like BaseX and‬
‭Oracle XML DB store and query structured data.‬

‭How Can XML be Used?‬

‭XML is used in many aspects of web development.‬


‭XML is often used to separate data from presentation.‬

‭XML Separates Data from Presentation‬

‭XML does not carry any information about how to be displayed.‬


‭The same XML data can be used in many different presentation‬
‭scenarios.‬
‭10‬

‭Because of this, with XML, there is a full separation between data‬


‭and presentation.‬

‭XML is Often a Complement to HTML‬

‭In many HTML applications, XML is used to store or transport‬


‭data, while HTML is used to format and display the same data.‬

‭XML Separates Data from HTML‬

‭When displaying data in HTML, you should not have to edit the‬
‭HTML file when the data changes.‬
‭With XML, the data can be stored in separate XML files.‬
‭With a few lines of JavaScript code, you can read an XML file and‬
‭update the data content of any HTML page.‬

‭Transaction Data‬

‭Thousands of XML formats exist, in many different industries,‬


‭to describe day-to-day data transactions:‬
‭●‬ ‭Stocks and Shares‬
‭●‬ ‭Financial transactions‬
‭●‬ ‭Medical data‬
‭●‬ ‭Mathematical data‬
‭●‬ ‭Scientific measurements‬
‭●‬ ‭News information‬
‭11‬

‭●‬ ‭Weather services‬

‭The XML Tree Structure‬

‭What is an XML Element?‬

‭An XML element is everything from (including) the element's‬


‭start tag to (including) the element's end tag.‬
‭An element can contain:‬
‭●‬ ‭text‬
‭●‬ ‭attributes‬
‭●‬ ‭other elements‬
‭●‬ ‭or a mix of the above‬
‭12‬

‭XML HttpRequest‬

‭All modern browsers have a built-in XMLHttpRequest object to‬


‭request data from a server.‬

‭The XMLHttpRequest Object‬

‭The XMLHttpRequest object can be used to request data from a‬


‭web server.‬
‭The XMLHttpRequest object is a developers dream, because you‬
‭can:‬
‭●‬ ‭Update a web page without reloading the page‬
‭●‬ ‭Request data from a server - after the page has loaded‬
‭●‬ ‭Receive data from a server - after the page has loaded‬
‭●‬ ‭Send data to a server - in the background‬

‭XML Parser‬

‭All major browsers have a built-in XML parser to access and‬


‭manipulate XML.‬
‭The XML DOM (Document Object Model) defines the properties‬
‭and methods for accessing and editing XML.‬
‭13‬

‭However, before an XML document can be accessed, it must be‬


‭loaded into an XML DOM object.‬
‭All modern browsers have a built-in XML parser that can convert‬
‭text into an XML DOM object.‬

‭Advantages of XML‬

‭●‬ ‭Platform Independence: XML can be used across different‬


‭operating systems and applications.‬
‭●‬ ‭Self-Descriptive: Elements contain both data and metadata,‬
‭making the document easy to understand.‬
‭●‬ ‭Extensibility: Users can define their own tags and structure.‬
‭●‬ ‭Human-Readable: XML is structured in a way that is‬
‭understandable to both humans and machines.‬
‭●‬ ‭Integration with Other Technologies: XML can be used with‬
‭XSLT for transformation, XPath for querying, and XQuery‬
‭for data manipulation.‬

‭Challenges and Limitations‬

‭Despite its benefits, XML has some drawbacks:‬

‭●‬ ‭Verbose Syntax: XML documents can be bulky due to‬


‭redundant tags.‬
‭14‬

‭●‬ ‭Processing Overhead: Parsing XML requires more‬


‭computational resources compared to lightweight formats‬
‭like JSON.‬
‭●‬ ‭Complexity in Data Querying: Unlike relational databases,‬
‭querying XML data requires additional tools like XPath and‬
‭XQuery.‬
‭●‬ ‭Security Concerns: XML-based attacks, such as XML‬
‭External Entity (XXE) attacks, can pose threats if not‬
‭handled properly.‬

‭XML vs. JSON‬

‭In recent years, JSON (JavaScript Object Notation) has gained‬


‭popularity as an alternative to XML, especially in web APIs. A‬
‭comparison of the two formats:‬

‭●‬ ‭Readability‬‭: JSON is more concise and readable compared to‬


‭XML.‬
‭●‬ ‭Data Processing‬‭: JSON has better native support in‬
‭JavaScript and requires less parsing overhead.‬
‭●‬ ‭Use Cases‬‭: XML is preferred in document-centric‬
‭applications, whereas JSON is widely used in web services‬
‭and APIs.‬
‭15‬

‭Future of XML‬

‭Despite the rise of JSON and other modern data formats, XML‬
‭continues to be relevant in various domains, especially where‬
‭data integrity, standardization, and document handling are‬
‭crucial. The integration of XML with AI-driven data processing‬
‭and cloud computing is expected to keep it in use for years to‬
‭come.‬

‭Conclusion‬

‭XML remains a robust and widely used format for data‬


‭structuring, transmission, and storage. Its flexibility,‬
‭extensibility, and self-descriptive nature make it a powerful tool‬
‭for various industries, despite the growing adoption of‬
‭alternative data formats. Understanding XML and its‬
‭applications is essential for developers, data analysts, and IT‬
‭professionals dealing with structured data and interoperability‬
‭challenges.‬

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy