Web Technology · Unit 5 · 7 hrs
AJAX and XML
Exam-focused notes for AJAX and XML (Web Technology, CSC329): what the TU syllabus asks and how it has actually been tested, with 11 solved past questions from this unit.
What this unit covers
- Basics of AJAX
- Introduction to XML and its Application
- Syntax Rules for creating XML document
- XML Elements
- XML Attributes
- XML Tree
- XML Namespace
- XML schema languages: Document Type Definition(DTD), XML Schema Definition (XSD)
- XSD Simple Types
- XSD Attributes
- XSD Complex Types
- XML Style Sheets (XSLT)
- XQuery
XSD Complex Types
What is the use of XML? Create an XML file having complex type elements containing other elements and text. At least one element should contain an attribute. Similarly, there should be elements containing string, integer and date type values. Now write the equivalent XSD for the XML.[10]
--- XML (eXtensible Markup Language) is used for: - Data storage and transport between applications and systems - Platform-independent data exchange over the internet - Configuration files for software applications (e.g., web.xml, pom.xml) - Web services (S...
Full solved answer →Syntax Rules for creating XML document
Describe the rules for creating XML document. Create a XML file with simple type and elements with attribute and nested elements. Write its equivalent XSD.[10]
The following rules must be followed: Rule 1: Every XML document must have exactly one Root Element All XML content must be enclosed within a single root element. Rule 2: All Tags Must Be Closed Every opening tag must have a corresponding closing tag. Rule ...
Full solved answer →How XML is different from HTML? Write XML script to create XML document containing element Person having sub elements Age, Name and Pincode. Write equivalent XSD for validating restrictions on the elements as the Age should be between 10 and 20, the Name should be only accepting either Ram or Shyam and the pincode should be 3 digit.[10]
Feature XML HTML --------- Purpose Designed to store and transport data Designed to display data Tag Definition Tags are user-defined (custom tags) Tags are predefined and fixed Case Sensitivity Tags are case-sensitive (<Name and <name are different) Tags a...
Full solved answer →XML Style Sheets
How can you transform XML document into HTML using XSLT. Support your answer with an example. [5]
XSLT (Extensible Stylesheet Language Transformations) is a language for transforming XML documents into other formats such as HTML for web pages, plain text, or other XML documents. The original document is not changed; rather, a new document is created bas...
Full solved answer →Introduction to XML and its Application
What is XML? Why is it called extensible? Mention the use of XML. [5]
--- XML (eXtensible Markup Language) is a markup language designed to store, transport, and describe data in a structured, human-readable, and machine-readable format. It was developed by the W3C (World Wide Web Consortium) and became a W3C recommendation i...
Full solved answer →What is XML? Create an XML file containing records of employee having elements of simple and complex types. [5]
XML (eXtensible Markup Language) is a markup language designed to store and transport data in a structured, human-readable, and machine-readable format. Unlike HTML, XML does not have predefined tags; instead, users define their own tags to describe the dat...
Full solved answer →Basics of AJAX
What is XMLHttpRequest object? Write HTML script with AJAX showing the use of XMLHttpRequest object. [5]
The XMLHttpRequest (XHR) object is a built-in browser object that is used to exchange data with a web server in the background. It is the core component of AJAX technology. Using the XMLHttpRequest object, a web page can request data from a server and updat...
Full solved answer →XML schema languages
What is the use of XML? Create a XML file with simple type and complex type elements. Write its equivalent DTD.[10]
XML (eXtensible Markup Language) is a markup language designed to store, transport, and structure data in a human-readable and machine-readable format. Its main uses are: Use Description ------------------ Data Storage Stores data in a structured, self-desc...
Full solved answer →What is DTD? Create a XML file and write its equivalent DTD. [5]
DTD (Document Type Definition) is a set of rules or declarations that defines the structure, legal elements, and attributes of an XML document. It acts as a blueprint that specifies: - What elements are allowed in the XML document - The order and nesting of...
Full solved answer →XML Namespace
What is XML Namespace? How is it used to avoid element name conflict in XML? Justify with an example. [5]
An XML Namespace is a mechanism used to avoid element name conflicts in XML documents by associating element and attribute names with a unique identifier (URI - Uniform Resource Identifier). When XML documents from different sources are combined, or when th...
Full solved answer →XSD Attributes
How XSD of a XML file is created? Illustrate with an example. [5]
XSD (XML Schema Definition) is a way to describe the structure and constraints of an XML document. It defines: - The elements and attributes that can appear in an XML document - The data types of elements and attributes - The number and order of child eleme...
Full solved answer →Make Unit 5 stick
Practice CSC329 with flashcards & quizzes