2023 question paper

Web Technology

26 questions

  1. Q1a. Which of the following tag is used to embed CSS in HTML page? (i) <css> (ii) <!DOCTYPE html> (iii) <script> (iv) <style>20232m

    Module I: Introduction to Web Technologies & Architectures

    Which of the following tag is used to embed CSS in HTML page?

    (i) <css>
    (ii) <!DOCTYPE html>
    (iii) <script>
    (iv) <style>

    View this question on its own page →
    Worked Solution

    Answer

    (iv) <style>

    Step-by-step

    1. Embedded/Internal CSS means CSS written inside the HTML document.
    2. HTML provides the <style> element specifically for containing CSS rules.
    3. <css> is not a standard HTML element.
    4. <!DOCTYPE html> declares the HTML document type.
    5. <script> is used for JavaScript.

    Example

    <style>
      p { color: blue; }
    </style>
    

    Final answer: (iv) <style>

  2. Q1b. Which of the following is not a web server? (i) Apache Tomcat (ii) BlueGriffon (iii) Jetty (iv) Tornado20232m

    Module II: Browser & Apache Web Server Architecture; Common Protocols

    Which of the following is not a web server?

    (i) Apache Tomcat
    (ii) BlueGriffon
    (iii) Jetty
    (iv) Tornado

    View this question on its own page →
    Worked Solution

    Answer

    (ii) BlueGriffon

    Explanation

    • Apache Tomcat, Jetty, and Tornado are web/server technologies used to serve web applications.
    • BlueGriffon is a WYSIWYG web-page editor, not a web server.

    Final answer: (ii) BlueGriffon

  3. Q1c. Which of the following are automatically loaded and operate as a part of the browser? (i) Add-ons (ii) Plug-ins (iii) Utilities (iv) Widgets20232m

    Module II: Browser & Apache Web Server Architecture; Common Protocols

    Which of the following are automatically loaded and operate as a part of the browser?

    (i) Add-ons
    (ii) Plug-ins
    (iii) Utilities
    (iv) Widgets

    View this question on its own page →
    Worked Solution

    Answer

    (ii) Plug-ins

    Explanation

    Browser plug-ins extend browser functionality and, in the terminology used by this question, operate as components of the browser environment. Add-ons are broader browser extensions, while utilities and widgets are not the intended answer.

    Final answer: (ii) Plug-ins

  4. Q1d. A characteristic of a file server is which of the following? (i) Acts as a fat client and is limited to one PC (ii) Manages file operations and is limited to one PC (iii) Acts as a fat client and is shared on a network (iv) Manages file operations and is shared on a network20232m

    Module II: Browser & Apache Web Server Architecture; Common Protocols

    A characteristic of a file server is which of the following?

    (i) Acts as a fat client and is limited to one PC
    (ii) Manages file operations and is limited to one PC
    (iii) Acts as a fat client and is shared on a network
    (iv) Manages file operations and is shared on a network

    View this question on its own page →
    Worked Solution

    Answer

    (iv) Manages file operations and is shared on a network

    Step-by-step

    1. A file server centrally stores and manages files.
    2. Clients on a network request files from the server.
    3. Therefore, file operations are managed centrally.
    4. A file server is intended to be accessible over a network, not restricted to one PC.

    Final answer: (iv)

  5. Q1e. Which of the following is the correct syntax for adding an external style sheet? (i) <style href='main.css'></style> (ii) <style src='main.css'></style> (iii) <link rel='stylesheet' type='text/css' src='main.css'> (iv) <link rel='stylesheet' type='text/css' href='main.css'>20232m

    Module I: Introduction to Web Technologies & Architectures

    Which of the following is the correct syntax for adding an external style sheet?

    (i) <style href='main.css'></style>
    (ii) <style src='main.css'></style>
    (iii) <link rel='stylesheet' type='text/css' src='main.css'>
    (iv) <link rel='stylesheet' type='text/css' href='main.css'>

    View this question on its own page →
    Worked Solution

    Answer

    (iv) <link rel='stylesheet' type='text/css' href='main.css'>

    Step-by-step

    1. An external stylesheet is attached with the HTML <link> element.
    2. rel="stylesheet" identifies the linked resource as a stylesheet.
    3. href="main.css" specifies the CSS file location.
    4. src is not the attribute used by <link> for the stylesheet URL.

    Example

    <link rel="stylesheet" href="main.css">
    

    Final answer: (iv)

  6. Q1f. What is HTML? (i) HTML describes the structure of a webpage (ii) HTML is the standard markup language mainly used to create web pages (iii) HTML consists of a set of elements that helps the browser how to view the content (iv) All of the mentioned20232m

    Module I: Introduction to Web Technologies & Architectures

    What is HTML?

    (i) HTML describes the structure of a webpage
    (ii) HTML is the standard markup language mainly used to create web pages
    (iii) HTML consists of a set of elements that helps the browser how to view the content
    (iv) All of the mentioned

    View this question on its own page →
    Worked Solution

    Answer

    (iv) All of the mentioned

    Explanation

    HTML:

    • Describes the structure of a webpage.
    • Is the standard markup language used to create web pages.
    • Uses elements that tell the browser how content should be structured and presented.

    Therefore, all three statements are correct.

    Final answer: (iv) All of the mentioned

  7. Q1g. What is an event in delegation event model used by Java programming language? (i) An event is an object that describes a state change in a source (ii) An event is an object that describes a state change in processing (iii) An event is an object that describes any change by the user and system (iv) An event is a class used for defining objects, to create events20232m

    Module III: Basics of Web Programming

    What is an event in delegation event model used by Java programming language?

    (i) An event is an object that describes a state change in a source
    (ii) An event is an object that describes a state change in processing
    (iii) An event is an object that describes any change by the user and system
    (iv) An event is a class used for defining objects, to create events

    View this question on its own page →
    Worked Solution

    Answer

    (i) An event is an object that describes a state change in a source

    Step-by-step

    1. Java's Delegation Event Model represents an event as an object.
    2. The event describes a change or action involving an event source, such as a button being clicked.
    3. The source generates the event and a registered listener handles it.

    Example

    A button click can generate an ActionEvent, which is delivered to an ActionListener.

    Final answer: (i)

  8. Q1h. XML is designed to ____ and ____ data. (i) design, style (ii) design, send (iii) store, style (iv) store, transport20232m

    Module V: Web 3.0 — Semantic Web and Supporting Technologies

    XML is designed to ____ and ____ data.

    (i) design, style
    (ii) design, send
    (iii) store, style
    (iv) store, transport

    View this question on its own page →
    Worked Solution

    Answer

    (iv) store, transport

    Explanation

    XML (Extensible Markup Language) is designed to represent and structure data so that it can be stored and transported between systems.

    Unlike HTML, XML is primarily concerned with describing data rather than displaying it.

    Final answer: (iv) store, transport

  9. Q1i. What will be the output of the following JavaScript code snippet? <p id="demo"></p> <script> var txt1 = "BEU_"; var txt2 = "Javascript"; document.getElementById("demo").innerHTML = txt1 + txt2; </script> (i) error (ii) BEU_Javascript (iii) undefined (iv) BEU_Javascript20232m

    Module III: Basics of Web Programming

    What will be the output of the following JavaScript code snippet?

    <p id="demo"></p> <script> var txt1 = "BEU_"; var txt2 = "Javascript"; document.getElementById("demo").innerHTML = txt1 + txt2; </script>

    (i) error
    (ii) BEU_Javascript
    (iii) undefined
    (iv) BEU_Javascript

    View this question on its own page →
    Worked Solution

    Answer

    (ii) BEU_Javascript

    Step-by-step

    1. txt1 is assigned the string BEU_.
    2. txt2 is assigned the string Javascript.
    3. The + operator concatenates the two strings.
    4. Therefore, txt1 + txt2 becomes BEU_Javascript.
    5. innerHTML places that result inside the element with id="demo".
    var txt1 = "BEU_";
    var txt2 = "Javascript";
    document.getElementById("demo").innerHTML = txt1 + txt2;
    

    Final answer: (ii) BEU_Javascript

    Note: Options (ii) and (iv) appear duplicated in the supplied paper; the value is still BEU_Javascript.

  10. Q1j. Which server supports Ajax? (i) WWW (ii) SMTP (iii) HTTP (iv) All of the above20232m

    Module II: Browser & Apache Web Server Architecture; Common Protocols

    Which server supports Ajax?

    (i) WWW
    (ii) SMTP
    (iii) HTTP
    (iv) All of the above

    View this question on its own page →
    Worked Solution

    Answer

    (iii) HTTP

    Explanation

    AJAX allows a browser to communicate asynchronously with a server. The XMLHttpRequest API commonly sends requests using HTTP (or HTTPS).

    • WWW is the overall Web system, not the protocol used for the request.
    • SMTP is used for email transfer.
    • HTTP is the standard request/response protocol used by AJAX communication.

    Final answer: (iii) HTTP

  11. Q2a. Explain TCP/IP in detail.20237m

    Module II: Browser & Apache Web Server Architecture; Common Protocols

    Explain TCP/IP in detail.

    View this question on its own page →
    Worked Solution

    TCP/IP in Detail

    TCP/IP (Transmission Control Protocol/Internet Protocol) is the protocol suite used for communication between computers over interconnected networks, including the Internet.

    Layers of TCP/IP

    Layer Main role Examples
    Application Provides network services to applications HTTP, FTP, SMTP, DNS
    Transport End-to-end delivery and reliability TCP, UDP
    Internet Logical addressing and routing IP, ICMP
    Network Access Transfers frames over the physical/local network Ethernet, Wi-Fi

    TCP

    TCP is connection-oriented and reliable. It provides sequencing, acknowledgements, retransmission, flow control and congestion control.

    Basic TCP communication

    1. A connection is established using the three-way handshake: SYN → SYN-ACK → ACK.
    2. Data is divided into segments and numbered.
    3. The receiver acknowledges received data.
    4. Lost data can be retransmitted.
    5. The connection is closed after communication finishes.

    IP

    IP provides addressing and routing of packets between networks. IPv4 uses 32-bit addresses, while IPv6 uses 128-bit addresses.

    Advantages

    • Reliable communication through TCP.
    • Routing across different networks through IP.
    • Scalable and interoperable.
    • Supports many application protocols.

    In short: TCP provides reliable transport; IP provides addressing and routing.

  12. Q2b. Explain the server-side scripting and client-side scripting in detail with examples.20237m

    Module III: Basics of Web Programming

    Explain the server-side scripting and client-side scripting in detail with examples.

    View this question on its own page →
    Worked Solution

    Client-side vs Server-side Scripting

    Client-side scripting

    Client-side scripts execute in the user's browser after the page is delivered by the server.

    Examples: JavaScript, DOM manipulation, form validation.

    <script>
    document.getElementById('msg').innerHTML = 'Hello';
    </script>
    

    Server-side scripting

    Server-side scripts execute on the web server. They can access databases, authenticate users, process business logic and generate a response.

    Examples: PHP, JSP/Servlets, ASP.NET, Python web frameworks.

    <?php
    echo "Hello from server";
    ?>
    

    Difference

    Client-side Server-side
    Runs in browser Runs on server
    Usually used for UI and interaction Used for business logic/data processing
    Can reduce server requests for UI operations Can access server-side databases/resources
    Source is generally delivered to the client Implementation can remain on the server

    Summary: Client-side scripting improves browser-side interaction; server-side scripting processes requests and generates server responses.

  13. Q3. Explain the XML parser. Describe DTD and Schema with an example.202314m

    Module V: Web 3.0 — Semantic Web and Supporting Technologies

    Explain the XML parser. Describe DTD and Schema with an example.

    View this question on its own page →
    Worked Solution

    XML Parser, DTD and Schema

    XML Parser

    An XML parser reads an XML document and converts its textual representation into a form that a program can process. It checks XML syntax and, for validating parsers, can also check the document against a DTD or schema.

    Types

    • DOM parser: loads the document into an in-memory tree; convenient for random access but uses more memory.
    • SAX parser: processes XML sequentially through events; efficient for large documents but does not keep the whole tree in memory.

    DTD

    A Document Type Definition (DTD) defines the legal structure and elements of an XML document.

    <!DOCTYPE student [
      <!ELEMENT student (name, roll)>
      <!ELEMENT name (#PCDATA)>
      <!ELEMENT roll (#PCDATA)>
    ]>
    

    XML Schema (XSD)

    An XML Schema Definition (XSD) also defines XML structure, but provides richer data types, namespaces and more precise constraints.

    <xs:element name="roll" type="xs:integer"/>
    

    DTD vs Schema

    DTD XML Schema
    Older validation mechanism XML-based validation language
    Limited data types Rich built-in data types
    Less expressive More expressive constraints
    Syntax is not XML Uses XML syntax

    Conclusion: The parser processes XML; DTD and XSD provide rules used to validate its structure.

  14. Q4a. Write a JavaScript to print all prime numbers from 1 to 100.20237m

    Module III: Basics of Web Programming

    Write a JavaScript to print all prime numbers from 1 to 100.

    View this question on its own page →
    Worked Solution

    JavaScript: Prime Numbers from 1 to 100

    A prime number is greater than 1 and has exactly two positive divisors: 1 and itself.

    Program

    for (let n = 2; n <= 100; n++) {
        let prime = true;
    
        for (let i = 2; i * i <= n; i++) {
            if (n % i === 0) {
                prime = false;
                break;
            }
        }
    
        if (prime) {
            console.log(n);
        }
    }
    

    Logic

    1. Start from 2 because 1 is not prime.
    2. Test each number up to 100.
    3. Check possible divisors from 2 through √n.
    4. If any divisor divides n exactly, it is not prime.
    5. Otherwise print the number.

    Output: 2, 3, 5, 7, 11, 13, ... , 97.

  15. Q4b. Explain the difference between client-side and server-side JavaScript.20237m

    Module III: Basics of Web Programming

    Explain the difference between client-side and server-side JavaScript.

    View this question on its own page →
    Worked Solution

    Client-side vs Server-side JavaScript

    Feature Client-side JavaScript Server-side JavaScript
    Execution Browser Server/runtime
    Main purpose UI interaction, DOM manipulation, validation Business logic, APIs, database access
    DOM access Yes, normally Not to the user's browser DOM
    Visibility Code is generally delivered to the client Server implementation can remain private
    Example Browser JavaScript Node.js

    Client-side example

    document.getElementById('msg').textContent = 'Hello';
    

    Server-side example

    // Node.js
    const http = require('http');
    http.createServer((req, res) => {
      res.end('Hello from server');
    }).listen(3000);
    

    Conclusion: Client-side JavaScript mainly controls behavior in the browser, whereas server-side JavaScript executes on the server to process requests and data.

  16. Q5a. What is MySQL? Give its salient features.20237m

    Module III: Basics of Web Programming

    What is MySQL? Give its salient features.

    View this question on its own page →
    Worked Solution

    MySQL and Its Salient Features

    MySQL is an open-source relational database management system (RDBMS) that uses SQL (Structured Query Language) to create, store, retrieve and manage structured data.

    Salient features

    1. Relational database: Data is organized in tables with rows and columns.
    2. SQL support: Supports SQL for querying and manipulating data.
    3. Open source: MySQL Community Edition is freely available under its open-source licensing model.
    4. Multi-user: Multiple users/applications can access databases concurrently.
    5. Client-server architecture: Applications communicate with the database server.
    6. Transactions: Supports transactional operations with InnoDB and ACID properties.
    7. Security: Provides authentication and privilege management.
    8. Scalability and performance: Suitable for applications ranging from small systems to large services.
    9. Cross-platform: Available on major operating systems.

    Example

    CREATE TABLE Student (
        id INT PRIMARY KEY,
        name VARCHAR(50)
    );
    
    SELECT * FROM Student;
    

    Conclusion: MySQL provides a practical SQL-based system for storing and managing relational data.

  17. Q5b. Write a note on type conversion in PHP with example.20237m

    Module III: Basics of Web Programming

    Write a note on type conversion in PHP with example.

    View this question on its own page →
    Worked Solution

    Type Conversion in PHP

    Type conversion means changing a value from one data type to another. PHP supports automatic type conversion in many expressions and explicit conversion using casting.

    1. Automatic type conversion

    PHP may convert a value automatically when an operation requires another type.

    $a = "10";
    $b = 5;
    result=result = a + $b;   // 15
    

    Here the numeric string is converted to a number for the arithmetic operation.

    2. Explicit type casting

    A programmer can explicitly cast a value:

    $x = "25";
    y=(int)y = (int)x;
    z=(float)z = (float)x;
    

    Common casts include (int), (float), (string), (bool) and (array).

    Example

    $price = "99.50";
    amount=(float)amount = (float)price;
    echo $amount + 10;   // 109.5
    

    Conclusion: PHP supports both implicit conversion and explicit casting; explicit casting is useful when the required type should be clear and controlled.

  18. Q6. Write the difference between HTML, DHTML and XHTML in detail.202314m

    Module III: Basics of Web Programming

    Write the difference between HTML, DHTML and XHTML in detail.

    View this question on its own page →
    Worked Solution

    HTML vs DHTML vs XHTML

    HTML

    HTML (HyperText Markup Language) is the standard markup language used to structure web pages.

    Features:

    • Defines page structure using elements and attributes.
    • Works with CSS for presentation and JavaScript for behavior.
    • Modern HTML is standardized as HTML5.

    DHTML

    DHTML (Dynamic HTML) is not a separate markup language. It is a combination of HTML, CSS, JavaScript and the DOM used to create dynamically changing web pages without necessarily loading a new page.

    Examples include changing styles, content or visibility in response to user actions.

    XHTML

    XHTML (Extensible HyperText Markup Language) reformulates HTML using XML's stricter syntax rules.

    Typical rules include properly nesting elements, closing elements, quoting attribute values and using well-formed markup.

    Comparison

    HTML DHTML XHTML
    Markup language Collection of technologies/approach XML-based reformulation of HTML
    Structures content Adds dynamic behavior Uses stricter, well-formed syntax
    Flexible HTML syntax historically Uses JavaScript + DOM + CSS More strict than traditional HTML
    Focus: structure Focus: dynamic interaction Focus: XML-style correctness

    Conclusion: HTML provides structure, DHTML combines web technologies for dynamic behavior, and XHTML applies XML-style rules to HTML.

  19. Q7a. Write a JavaScript program to print this pattern: * ** *** **** *20237m

    Module III: Basics of Web Programming

    Write a JavaScript program to print this pattern:
    *
    **




    View this question on its own page →
    Worked Solution

    JavaScript Pattern Program

    Required pattern

    *
    **
    ***
    ****
    *****
    

    Program

    for (let i = 1; i <= 5; i++) {
        let row = "";
        for (let j = 1; j <= i; j++) {
            row += "*";
        }
        console.log(row);
    }
    

    Logic

    • The outer loop controls the 5 rows.
    • The inner loop adds i stars to each row.
    • console.log(row) prints each row on a new line.

    Output:

    *
    **
    ***
    ****
    *****
    
  20. Q7b. What is a search engine? Explain its working with an example.20237m

    Module I: Introduction to Web Technologies & Architectures

    What is a search engine? Explain its working with an example.

    View this question on its own page →
    Worked Solution

    Search Engine and Its Working

    A search engine is a software system that discovers, indexes and retrieves web pages or other online resources in response to a user's query.

    Working

    1. Crawling: Automated programs called crawlers/spiders visit web pages and follow links to discover content.
    2. Indexing: Information about discovered pages is processed and stored in a searchable index.
    3. Query processing: When a user enters a query, the engine analyzes the words and intent.
    4. Ranking: Matching results are ranked using many signals such as relevance, quality and freshness.
    5. Retrieval and display: The ranked results are shown on the search results page.

    Example

    If a user searches for "TCP/IP tutorial", the search engine finds indexed pages related to TCP/IP, ranks them by relevance, and displays the most useful matches.

    Flow: Crawl → Index → Query → Rank → Display

  21. Q8a. What is HTTP? Explain the steps that are involved for each request from a client to the server.20237m

    Module II: Browser & Apache Web Server Architecture; Common Protocols

    What is HTTP? Explain the steps that are involved for each request from a client to the server.

    View this question on its own page →
    Worked Solution

    HTTP and Client-to-Server Request Steps

    HTTP (HyperText Transfer Protocol) is an application-layer protocol used for communication between clients and web servers. It follows a request-response model.

    Steps

    1. Enter/request URL: The browser determines the target resource.
    2. DNS resolution: The domain name is resolved to an IP address when necessary.
    3. Connection: The client establishes a connection to the server (typically TCP; HTTPS also establishes TLS security).
    4. HTTP request: The browser sends a request containing a method such as GET or POST, URL/path, headers and possibly a body.
    5. Server processing: The web server/application processes the request, possibly accessing files, code or databases.
    6. HTTP response: The server returns a status code, headers and usually a response body.
    7. Browser processing: The browser interprets the response and renders the page; it may make additional requests for CSS, JavaScript, images, etc.
    8. Connection reuse/close: The connection may be reused or closed according to the protocol and headers.

    Example

    Browser → HTTP GET /index.html → Web Server
    Browser ← HTTP 200 + HTML ← Web Server
    

    Common status codes: 200 OK, 404 Not Found, 500 Internal Server Error.

  22. Q8b. AJAX (Asynchronous Javascript and XML) is used by web application client to communicate with server side scripts. What four XMLHttpRequest functions are required to make and handle an AJAX call? Write each step in detail.20237m

    Module III: Basics of Web Programming

    AJAX (Asynchronous Javascript and XML) is used by web application client to communicate with server side scripts. What four XMLHttpRequest functions are required to make and handle an AJAX call? Write each step in detail.

    View this question on its own page →
    Worked Solution

    AJAX and XMLHttpRequest

    AJAX (Asynchronous JavaScript and XML) is a technique that allows browser JavaScript to communicate with a server asynchronously and update part of a page without a full page reload. JSON is also commonly used today even though the name contains XML.

    Main XMLHttpRequest steps

    1. Create the request object

    const xhr = new XMLHttpRequest();
    

    2. Configure the request with open()

    xhr.open("GET", "data.php", true);
    

    open() specifies the HTTP method, URL and whether the request is asynchronous.

    3. Handle the response with onreadystatechange

    xhr.onreadystatechange = function () {
        if (xhr.readyState === 4 && xhr.status === 200) {
            document.getElementById("result").textContent = xhr.responseText;
        }
    };
    

    4. Send the request with send()

    xhr.send();
    

    For a POST request, data can be supplied to send(data).

    Complete example

    const xhr = new XMLHttpRequest();
    
    xhr.open("GET", "data.php", true);
    xhr.onreadystatechange = function () {
        if (xhr.readyState === 4 && xhr.status === 200) {
            document.getElementById("result").textContent = xhr.responseText;
        }
    };
    xhr.send();
    

    Important terms

    • open() → configures request
    • send() → sends request
    • onreadystatechange → reacts to state changes
    • responseText → contains text returned by the server

    Exam point: The core request flow is create → open → set handler → send → receive/process response.

  23. Q9a. Write a short note on Event-driven Programming.20237m

    Module III: Basics of Web Programming

    Write a short note on Event-driven Programming.

    View this question on its own page →
    Worked Solution

    Event-driven Programming

    Event-driven programming is a programming model in which program execution is controlled by events such as mouse clicks, keyboard input, network messages, timers or other system actions.

    Main components

    1. Event source: The object that generates an event, e.g. a button.
    2. Event: Represents an occurrence, e.g. a click.
    3. Event handler/listener: Code that responds to the event.
    4. Event loop/dispatcher: Detects events and dispatches them to appropriate handlers.

    Example

    button.addEventListener("click", function () {
        alert("Button clicked");
    });
    

    Here the button is the source, click is the event, and the function is the handler.

    Advantages

    • Natural for interactive applications.
    • Separates event detection from response logic.
    • Useful for GUIs and web applications.

    Conclusion: Instead of executing everything in one fixed sequence, an event-driven program waits for events and responds to them.

  24. Q9b. Write a short note on Data Binding.20237m

    Module III: Basics of Web Programming

    Write a short note on Data Binding.

    View this question on its own page →
    Worked Solution

    Data Binding

    Data binding is the mechanism that connects data from a data source/model with UI elements or another representation so that values can be displayed or updated automatically.

    Types

    • One-way binding: Data flows in one direction, such as model → view.
    • Two-way binding: Changes in the model can update the view, and user changes in the view can update the model.

    Example concept

    Suppose a model contains:

    name = "Ravi"
    

    A bound text field displays Ravi. If two-way binding is used and the user changes the field to Aman, the model can also be updated to Aman.

    Advantages

    1. Reduces repetitive UI update code.
    2. Keeps displayed data synchronized with application state.
    3. Improves maintainability of data-driven interfaces.

    Conclusion: Data binding establishes a relationship between application data and the user interface, with one-way or two-way synchronization depending on the framework/design.

  25. Q9c. Write a short note on Xlinks and Xpointer.20237m

    Module V: Web 3.0 — Semantic Web and Supporting Technologies

    Write a short note on Xlinks and Xpointer.

    View this question on its own page →
    Worked Solution

    XLink and XPointer

    XLink

    XLink (XML Linking Language) provides a framework for creating links between XML resources. It supports simple links as well as more complex linking relationships.

    It uses attributes such as xlink:href to identify a linked resource.

    <book xmlns:xlink="http://www.w3.org/1999/xlink"
          xlink:type="simple"
          xlink:href="chapter2.xml">
      Chapter 2
    </book>
    

    XPointer

    XPointer (XML Pointer Language) extends the idea of URI references by allowing a link to identify a particular part or fragment of an XML document rather than only the whole document.

    Difference

    XLink XPointer
    Defines linking relationships Identifies locations/fragments in XML resources
    Describes how resources are linked Describes where a link points within a resource

    In short: XLink handles XML linking; XPointer provides fine-grained addressing within XML content.

  26. Q9d. Write a short note on Dynamic HTML.20237m

    Module III: Basics of Web Programming

    Write a short note on Dynamic HTML.

    View this question on its own page →
    Worked Solution

    Dynamic HTML (DHTML)

    DHTML (Dynamic HTML) is a combination of technologies used to make web pages dynamic and interactive. It is not a separate programming language.

    Main technologies

    1. HTML — provides the page structure.
    2. CSS — controls presentation and styles.
    3. JavaScript — provides behavior and logic.
    4. DOM — represents the document and allows scripts to change its content and structure.

    Example

    <p id="msg">Old text</p>
    <button onclick="changeText()">Change</button>
    
    <script>
    function changeText() {
        document.getElementById("msg").textContent = "New text";
    }
    </script>
    

    When the button is clicked, JavaScript changes the paragraph without requiring the whole page to be reloaded.

    Advantages

    • Creates interactive pages.
    • Allows dynamic content and style changes.
    • Improves user experience.
    • Can update selected page elements efficiently.

    Conclusion: DHTML = HTML + CSS + JavaScript + DOM, working together to create dynamic web pages.