Using XML for Document Structuring-ICT Fundamentals-Lab Assignment, Exercises of Information and Computer Technology

This is an introductory course on Information and Coomputer Technologies. Topics include ICT terminologies, hardware and software components, the internet and world wide web, and ICT based applications. It includes: Xml, Document, Structuring, Dtd, Extensible, Markup, Language, Technology, Schema, Definition, Extensible

Typology: Exercises

2011/2012

Uploaded on 07/30/2012

pariyat
pariyat 🇮🇳

3.9

(7)

97 documents

1 / 6

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
1-1
EC 420- E-Commerce
EC 420 E-Commerce
Lab # 1
Using XML for Document Structuring
Objectives
Creating XML Documents
DTD for XML Document Validation
docsity.com
pf3
pf4
pf5

Partial preview of the text

Download Using XML for Document Structuring-ICT Fundamentals-Lab Assignment and more Exercises Information and Computer Technology in PDF only on Docsity!

EC 420- E-Commerce

EC 420 – E-Commerce

Lab # 1

Using XML for Document Structuring

Objectives

 Creating XML Documents

 DTD for XML Document Validation

1-2 Creating XML Documents

EC 420- E-Commerce

Background

XML (Extensible Markup Language) is a dialect of SGML. XML is not a programming language. Rather it is a set of rules that allow you to represent data in a structured manner. Since the rules are standard, the XML documents can be automatically generated and processed.

Its use can be gauged from its name itself –

Markup – Is a collection of Tags XML Tags – Identify the content of data Extensible – User-defined tags

XML is a markup language much like HTML, but used for purposes different than what HTML is used for. It’s not a replacement for HTML.

XML Technology

XSD - XML Schema Definition DTD - Document Type Definition. XSL - Extensible Style sheet Language

1-4 Creating XML Documents

EC 420- E-Commerce

Example -1: Creating XML Document

In this example, we discuss markup used by a day planner application for scheduling appointments.

Note:You may use any text editor or Visual Studio for creating the xml file provided in this example.Please do not write line numbers. These are just for explanation purpose only.

XML Document (planner.xml)

When scheduling appointments and tasks, the date, time and appointment type are required. An XML document that marks up appointments is shown below.

Line 6 is the root element planner, which holds all of the appointments. Within element planner, we have a year element, which has attribute value for storing the year being planned. If we make appointments for the year 2001, a new year element with value of 2001 is created before the planner end tag.

Line 10 shows element date, which is used to store a specific date. Element date has two attributes, month and day, which store the month and day of the appointment, respectively.

Line 11

Doctor's appointment

marks up an appointment for July 15, 2000, at 1430 military time (i.e., 2:30 pm). A date element may contain many note elements, each for a specific time. A note element does not have to contain a time attribute, such as on line 16

Independence Day

which denotes an event for an entire day—July 4, Independence Day.

EC 420- E-Commerce

Exercise Problems

Problem 1: Rewrite the XML document above such that each note element has year , month , day and time attributes rather than child elements. The solution should contain only the root element and note child elements.

Problem 2: Online Banking – Statement Request and Transactions based on XML a. Create an XML document that marks up the statement request for a bank customer. You document should contain elements describing bank id, account id, account type and other required elements e.g. some root element. b. Create an XML document that marks up a bank to bank transaction. Think about the required tags for this type of document.