Create the given global parameters and variables

Assignment Help Web Project
Reference no: EM131529022

XML Authoring Assignment

Sean has a new project for you to work on. In addition to digital games, the Harpe Gaming Store also sells board games. Sean is working on a page describing a few sample board games. He has created an XML document named games.xml that contains the description of two games, as well as scores the store has given the games on a 1 to 10 scale in seven categories. Sean also has an XML document named game_reviews.xml containing reviews written up in other gaming websites and an XML document named reviewers.xml that describes those websites.

Sean wants all of this information collected and displayed using a customized style sheet. He would like the style sheet to calculate the average score given to the selected board game and wants all numeric values and dates to be nicely formatted. Figure 6-46 shows a preview of the completed project.

1. Using your editor, open the gamestxt.xml and gamestxt.xsl .Enter your name and the date in the comment section of each ?le and save them as games.xml and games.xsl , respectively.

2. Go the games.xml ?le in your editor. Take some time to review the contents of the ?le and then link the games.xsl style sheet file to the file. Close the games.xml file, saving your changes.

3. View the contents of the game_reviews.xml and reviewers.xml ?le in your editor, taking note of the structure and content of each document. Close the files. You do not have to save any changes to these documents.

4. Sean also has created a library of functions you'll use in this project. Open the hgfunctions.xsl ?le in your editor and study the contents. The document has two templates. One template matching the releaseDate element is used to convert date values from the mm/dd/yyyy format to the Month Day, Year format. The second template, named imageRow, is used to create a row of inline images. The imageRow template has two parameters: the imgFile parameter speci?es the name of the image ?le, and the imgCount parameter speci?es the number of images to be displayed.

5. Go to the games.xsl ?le in your editor. Directly after the opening tag, use the include element to include the contents of the hgfunctions.xsl style sheet.

6. Directly after the include element, create the following global parameters and variables:

a. The gameID parameter with a default value of ‘bg210'. This parameter will be used to select different board games to display in the web page.

b. The currentGame variable containing the /games/game[@gid=$gameID] node set. This variable will be used to select the game to display in the report.

c. The externalReviews variable containing the /reviews/review[@gid=$gameID] node set from the game_reviews.xml ?le. ( Hint : Use the document() function.) This variable will be used to access customer reviews for the current game.

d. The externalReviewers variable containing the /reviewers node set from the reviewers.xml ?le. This variable will be used to access the list of reviewers for the report.

7. Go to the root template and make the following style changes so that the report displays information for the current game selected by the user:

a. Go to the <title> tag within the head section of the HTML ?le and change the node set for the value-of element to $currentGame/title in order to display the title of the current game.

b. Go to the gameSummary section and change the select attribute of the apply-templates element so that it applies the template for the currentGame variable.

8. Go to the game template and make the following style changes:

a. Locate the table cell in the List Price row that displays the value of the price element and format the price value so that it appears in the $#,##0.00 format.

b. Change the table cell in the Release Date row that displays the value of the releaseDate element so that it applies the template for the releaseDate element found in the hgfunctions.xsl ?le.

9. Next, within the game template, you need to display the summary information on the game taken from the summary element in the games.xml file. Below the summaryTable web table </table> tag in the game template, use the copy-of element to copy the node-set summary/* into the result document.

10. Sean wants the report to display the score for each game. Directly after the copy-of element you just created within the game template, create a variable named avgScore that returns the average scores contained in the scores/score node set. ( Hint : Divide the sum of the values in the scores/score node set by the count of values in that node set.)

11. Finally, within the game template, insert the following web table structure for a web table that displays the scores from each gaming category and a ?nal row that displays the average score from all gaming categories:

<table id="scoreTable">
score template
<tr>
<th>OVERALL
(avgScore / 10)
</th>
<td>
row of token images
</td>
</tr>
</table>

where score template applies the template for the scores/score node set to display scores from each gaming category and avgScore is the value of the avgScore variable displayed with the 0.00 number format. Create the row of token images by calling the imageRow template from the hgfunctions.xsl ?le using the ‘token.png' ?le for the imgFile parameter and the value of the avgScore variable rounded to the nearest integer for the imgCount parameter.

12. Directly below the game template, create a template for the score element. The template will display a table row for each category of gaming score by writing the following HTML code:

<tr>
<th>
category (current score/10)
</th>
<td>
row of token images
</td>
</tr>

where category is the value of category attribute, current score is the value returned by the current() function, and row of token images is created by calling the imageRow template using ‘token.png' for the imgFile parameter and the value returned by the current() function for the imgCount parameter.

13. Scroll up to the game template and, directly below the tag, insert a command to apply the template to the externalReviews variable you created in Step 6.

14. Go back to the bottom of the style sheet to the review template used to display external reviews of the current game. This template has two local variables: the reviewerTitle variable contains the title of the review, and the reviewerURL variable contains the URL of the reviewer's website. Add the following HTML code to the template:

<section class="review">
summary nodes
<p>
reviewerTitle
<br />
(<a href="reviewerURL">reviewerURL</a>)
</p>
</section>

where summary nodes is a copy of the summary/* node set using the copy-of element, reviewerTitle is the value of the reviewerTitle variable, and reviewerURL is the value of the reviewerURL variable.

15. Save your changes to the style sheet.

16. Generate a result document using bg210 and bg211 for the values of the gameID parameter, storing the results in ?les named bg210.html and bg211.html , respectively.

Attachment:- Attachments.rar

Reference no: EM131529022

Questions Cloud

Discuss your conflict style and how this style has affected : Consider how you deal with conflict in relationships with people at work. Is it similar to how you handle conflict in non-work relationships?
The different iss policies associated with risk management : Analyze the different ISS policies associated with the IT infrastructure. Describe the different ISS policies associated with risk management.
Explain what norms and values you internalized : Explain what norms and values you internalized, and how these were taught to you. Were the norms and value
Identify the business rules for patient and order : Typically, a hospital patient receives medications that have been ordered by a particular doctor. Because the patient often receives several medications.
Create the given global parameters and variables : Sean has a new project for you to work on. Directly after the include element, create the following global parameters and variables:
How might the tables be related to one another : United Broke Artists (UBA) is a broker for not-so-famous artists. UBA maintains a small database to track painters, paintings, and galleries.
Define organizational behavior : Define organizational behavior.Select 2 companies that play a role in the health care industry and review their websites.
Describe the relationships depicted in the given erd : Describe the relationships (identify the business rules) depicted in the Crow's Foot ERD shown in Figure.
What are the types of interviews in human services setting : What are the types of interviews in the human services setting? How does the type of interview direct the selected format

Reviews

Write a Review

Web Project Questions & Answers

  Describe the structure of the world wide web

Describe the structure of the World Wide Web as interconnected hypertext documents - create and validate HTML documents.

  Create a customer experience map that illustrates the path

Create a customer experience map that illustrates the path a customer will take to complete the same task you identified for the user journey component of Milestone Five.

  Establish and maintain payroll system prepared manually

Establish and Maintain Payroll system prepared on a computer programme and prepared manually. How much Holiday leave would you tell her she has?

  Summarize the insights you gained about cro

Summarize the insights you gained about CRO and LPO on the basis of the article you selected. Summarize the information presented in each of the articles you selected

  Description of the website''s perceived goal

Name of the website and URL where digital media project can be posted, Description of the website's perceived goal

  Create a front page that uses valid html and css

Create a front page that uses valid HTML and CSS to show users a set of current auctions. (For now, the "auctions" can be some static I-ITML content, perhaps added to your page using a simple PHP include directive).

  About project specification

E-R diagram: adherence to our standard, assumptions made, inclusion of correct primary

  Analyze the common threats to data systems

Analyze the common threats to data systems such as Web applications and data servers. Next, speculate on the greatest area of vulnerability and potential for damage and / or data loss of such data systems (e.g., SQL injection, Web-based password crac..

  Explain how a soa would improve patient care

What are some examples of how a SOA would improve patient care

  Design and develop the dynamic website

DWDP2v15-Website Development Project - Design and Develop the Dynamic Website and Shopping Cart and To achieve a Competent result, each student is required to achieve a Satisfactory outcome in each marking criteria of this assessment - Determine and..

  To enter commands insert an image clickable

To enter commands insert an image clickable and Submit nearly equal to the function

  Create a web site to provide information about modern design

Create a Web site to provide information about Modern Design for customers shopping for modern furniture, contemporary accessories, and interior design services.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd