Create an internal dtd for the xml document above write the


Exercise 1 - HTML and XML

ID

Name

Stars

Facilities

Address

Distance from

center (KM)

Available

1

Les Jardins du Marais

3

Internet

74 rue Amelot, Paris, 75011

2

True

2

Golden Tulip Little Palace

4

Internet Gym

Parking Restaurant

4 rue Salomon De Caus, Paris, 75003

0.1

False

3

Tilsitt Etoile

2

Restaurant

23 rue Brey, Paris, 75017

3

False

4

Hotel Saint Charles

3

Parking

6 rue de I'Esperance, Paris, 75013

1

True

Encode the hotel table in

(1) an HTML document

(2) a well-formed XML document

Exercise 2 - DTD

(1) Create an internal DTD for the XML document above, write the whole XML document

(2) Create an external DTD for the XML document above, write the whole XML document by linking the external DTD to the XML document

Exercise 3 - XML Schema

Create an XML Schema for the above XML document, write the valid instance xml file according to this XML Schema

For Exercise 2 and 3, please consider the following facts:
- Stars is ranging from 1 to 5

- Facilities can have at least one or more of the followings: Internet, Gym, Parking, Restaurant, Pick-up;

- Distance can be empty or have one value

- Available can be either true or false.

Exercise 4 - XPath/XQuery

For the above XML document, Please write the following queries in XPath or XQuery:

(1) Select all the elements in the document

(2) Select all the hotels

(3) Select the facilities of the first before last hotel of the document

(4) Select the ID of the hotel "Tilsitt Etoile"

(5) Select all the hotels for which the distance from center is given

(6) Select the name, address and stars of the last 3 hotels

(7) Select the name and ID of the hotels with a rating higher or equal than 3

(8) Select the name of the hotels that have in a range of 1.5 KM from the center

(9) Select all the hotel names

Exercise 5 - XSLT

Taking the XML document you generated for Exercise 1, provide XSLT style sheets that:

(1) One XLST style sheet which gene rates a HTML document listing the information on a tabular form.

(2) One XLST style sheet which generates a HTML document listing the same information on a tabular form with entries sorted by name.

(3) One XLST style sheet which generates a HTML document listing the same information not on a tabular form with the names and IDs displayed in bold

Bonus: The Word Guesser

You'll create a simple word guessing game where the user gets infinite tries to guess the word (like Hangman without the hangman, or like Wheel of Fortune without the wheel and fortune).

Create two global arrays: one to hold the letters of the word (e.g. 'F', 'O', 'X'), and one to hold the current guessed letters (e.g. it would start with '_', '_', '_' and end with 'F', 'O', 'X').

Write a function called guessLetter that will:

- Take one argument, the guessed letter.

- Iterate through the word letters and see if the guessed letter is in there.

- If the guessed letter matches a word letter, changed the guessed letters array to reflect that.

- When it's done iterating, it should log the current guessed letters ('F__')

- and congratulate the user if they found a new letter.

- It should also figure out if there are any more letters that need to be guessed,

- and if not, it should congratulate the user for winning the game.

Pretend you don't know the word, and call guessLetter multiple times with various letters to check that your program works.

Bonus: Make it more like Wheel of Fortune:

- Start with a reward amount of $0

- Every time a letter is guessed, generate a random amount and reward the user if they found a letter (multiplying the reward if multiple letters found), otherwise subtract from their reward.

- When they guess the word, log their final reward amount.

Bonus: Make it like Hangman:

- Keep track of all the guessed letters (right and wrong) and only let the user guess a letter once. If they guess a letter twice, do nothing.

- Keep track of the state of the hangman as a number (starting at 0), and subtract or add to that number every time they make a wrong guess.

- Once the number reaches 6 (a reasonable number of body parts for a hangman), inform the user that they lost and show a hangman on the log.

Request for Solution File

Ask an Expert for Answer!!
Database Management System: Create an internal dtd for the xml document above write the
Reference No:- TGS01735420

Expected delivery within 24 Hours