Instruction
Exercise 1: XML, XSLT
Task 1: Creating an XML 1. Launch Microsoft Visual Studio. 2. Click File> New File. 3. Choose XML File, as follows and click Open.
4. Click File> Save XMLFile1.xml . 5. Add your name as a comment immediately beneath the XML declaration. 6. Add a root element named Restaurants. 7. Add a child element named Restaurant. Add the following attributes to the element you created
in Step 6:
Attribute Value
Name Little Cabin Inn
QualityRating 3
PriceRating 2
8. Add a child element named Location to the Restaurant element. 9. Add the following child elements to the Location element:
Element Value
Address 10 Main Street
City Chicago
State Illinois
Department of Computer Science Fall 2019
10. Add a child element named PhoneNumber to the Restaurant element. 11. Add a child element named Menu to the Restaurant element. 12. Add a child element named MenuItem to the Menu element. Set its value to Hamburger. 13. Add the following attributes to the Hamburger MenuItem:
Attribute Value
Price $4.95
Calories 450
IsVegetarian false
14. Add another MenuItem with a value of Fruit Salad. 15. Add the following attributes to the Fruit Salad MenuItem:
Attribute Value
Price $5.50
Calories <300
IsVegetarian true
16. Save the file.
Task 2: Editing the XML 1. Open browser. 2. Right-click nnRestaurants.xml and choose Open With> Chrome. 3. Verify that the results look like the following document. If they do not, correct any problems.