BSc (Hons) Software Engineering Web Service Development PDF

Document Details

RecordSettingCarnelian2276

Uploaded by RecordSettingCarnelian2276

University of Technology, Mauritius

2024

University of Technology, Mauritius

Tags

XML Web Service Development Software Engineering Programming

Summary

This document is a past paper from the University of Technology, Mauritius for the BSc (Hons) Software Engineering course, module Web Service Development, from November 2024. It contains a variety of topics, including XML and XML Schema, reading XML, validating XML, and more. It is a comprehensive examination of web service development using XML.

Full Transcript

BSc (Hons) Software Engineering Module Name: Web Service Development Module Code: WAT 2104C University of Technology, Mauritius NOVEMBER 2024 XML & XML Schema & XML Parsers Content to cover Reading XML XML Validation Parsing XML into Objects Modifying XML Advanced Filtering XML – Short intro...

BSc (Hons) Software Engineering Module Name: Web Service Development Module Code: WAT 2104C University of Technology, Mauritius NOVEMBER 2024 XML & XML Schema & XML Parsers Content to cover Reading XML XML Validation Parsing XML into Objects Modifying XML Advanced Filtering XML – Short intro XML stands for eXtensible Markup Language. XML was designed to store and transport data. XML was designed to be both human- and machine-readable. XML is self-descriptive: it describes data in a structured format using tags. XML is platform-independent and language-neutral, which makes it ideal for data exchange across systems. Commonly used in web services, configuration files, data storage, and more. X ML files start wit h an opti onal dec laration line Dholl Puri Rs 30.00 A popular Mauritian street food, served with a variety of curries and chutneys 350 Gateau Piment Rs 15.00 Spicy split pea fritters, a Mauritian snack served with chutneys 150 Roti Rs 30.00 Freshly made flatbread with curry and chutneys, a local favorite 300 XML – Rules Case-sensitive: and are different. Closing tags: Each opening tag must have a corresponding closing tag. Root element: XML files must have a single root element that encapsulates all other elements. Attribute values: Attributes must be quoted. A popular Mauritian street food, served with a variety of curries and chutneys Reading XML Exercise 1: Reading inline XML (double click in the below image to open). Make sure you print the values you read from the XML (in this case, food items and the details) Reading XML Exercise 2: Reading XML file Requirement 1: Read the file from a path E.g. ("path/to/yourfile.xml"); Requirement 2: Print only food items that contain less than 320 calories. Code snippets: XDocument doc = XDocument.Load("path/to/yourfile.xml"); Or XmlDocument doc = new XmlDocument(); doc.Load("path/to/yourfile.xml"); XML Validation Validate an Xml file using the below steps: 1. Use an XSD file to define rules for XML structure and data types. 2. Validate XML data against the XSD using XmlReader and XmlReaderSettings in C#. 3. Observe validation errors when the XML data does not conform to the XSD and understand how to fix them. XML Validation Step 1: Create & Save the XSD File

Use Quizgecko on...
Browser
Browser