Sean has a new project for you to work on directly after


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 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.</p> <p style="text-align: justify;">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.</p> <p style="text-align: justify;">8. Go to the game template and make the following style changes:</p> <p style="text-align: justify;">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.</p> <p style="text-align: justify;">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.</p> <p style="text-align: justify;">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.</p> <p style="text-align: justify;">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.)</p> <p style="text-align: justify;">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:</p> <p style="text-align: justify;"><table id="scoreTable"><br /> score template<br /><tr><br /> <th>OVERALL<br /> (avgScore / 10)<br /> </th><br /> <td><br /> row of token images<br /> </td><br /></tr><br /></table></p> <p style="text-align: justify;">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.</p> <p style="text-align: justify;">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:</p> <p style="text-align: justify;"><tr><br /> <th><br /> category (current score/10)<br /> </th><br /> <td><br /> row of token images<br /> </td><br /></tr></p> <p style="text-align: justify;">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.</p> <p style="text-align: justify;">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.</p> <p style="text-align: justify;">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:</p> <p style="text-align: justify;"><section class="review"><br /> summary nodes<br /> <p><br /> reviewerTitle<br /> <br /><br /> (<a href="reviewerURL">reviewerURL</a>)<br /> </p><br /></section></p> <p style="text-align: justify;">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.</p> <p style="text-align: justify;">15. Save your changes to the style sheet.</p> <p style="text-align: justify;">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.</p> <p><strong>Attachment:-</strong> <a href="https://secure.tutorsglobe.com/Atten_files/568_Attachments.rar" target="_blank">Attachments.rar</a></p></p> </div> <div id="viewreadmore" class="link"> <a id="readmore" href="javascript:void(0);" class="read-more-trigger mar_top10" onclick="changeheight(this)">View Complete Question</a> </div> <div id="DivRequest"> <h4> Request for Solution File </h4> <div class="seprator"> </div> <div class="downloadfiles"> <h5> Ask an Expert for Answer!!</h5> <h6> : Sean has a new project for you to work on directly after</h6> <h5> Reference No:- TGS02324576</h5> <input type="submit" name="btnGetQuote" value="Request for Solution File" id="btnGetQuote" class="btn btnexperts btn-lg btn-block-sm mar_btm20" /> <p> Expected delivery within 24 Hours</p> </div> </div> </div> <div class="row"> <div class="col-sm-12 reviewbox"> <div class="row "> <div class="panel-group review" id="accordion" role="tablist" aria-multiselectable="true"> <div class="panel-heading" role="tab" id="headingTwo"> <h4 class="panel-title"> <a class="collapsed" role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseTwo" aria-expanded="false" aria-controls="collapseTwo"> Have a Question? (oR Write a Review) </a> </h4> </div> <div id="collapseTwo" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingTwo"> <div class="panel-body"> <div class="col-sm-12"> <div class="row search searchbg message"> <span id="RequiredFieldValidator1" style="visibility:hidden;">Write atleast 100 words!!</span> <textarea name="txtcomments" id="txtcomments" maxlength="1000" ValidationGroup="Review" placeholder="Write your review" class="form-control" rows="6"></textarea> <div class="pull-right mar_top20"> <input type="submit" name="btnReviewSubmit" value="Submit" onclick="javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("btnReviewSubmit", "", true, "Review", "", false, false))" id="btnReviewSubmit" class="btn btn-primary pull-right" /> </div> </div> </div> </div> </div> </div> </div> </div> </div> <div class="user-comments-area hidden-xs"> <h4 class="text-uppercase mar_btm20"> <i class="fa fa-question-circle"></i>   Recent Questions Asked </h4> <ul class="user-comments-list"> <table id="dlMaterials" cellspacing="0" style="width:100%;border-collapse:collapse;"> <tr> <td> <li> <div class="comment-box"> <h5> <span class="mar_lft5">Q :</span> <a id="dlMaterials_hypermaterial_0" class="studenthdname" href="https://www.tutorsglobe.com/question/what-are-the-types-of-interviews-in-the-human-services-52324572.aspx">What are the types of interviews in the human services</a></h5> <p class="answer"> <span id="dlMaterials_lblQuestion_0">interview paperthe following topics in a 350- to 525-word paper1 what is the purpose and function of interviews in</span></p> </div> <!-- /comment-box --> </li> </td> </tr><tr> <td> <li> <div class="comment-box"> <h5> <span class="mar_lft5">Q :</span> <a id="dlMaterials_hypermaterial_1" class="studenthdname" href="https://www.tutorsglobe.com/question/describe-the-relationships-identify-the-business-rules-52324573.aspx">Describe the relationships identify the business rules</a></h5> <p class="answer"> <span id="dlMaterials_lblQuestion_1">question describe the relationships identify the business rules depicted in the crows foot erd shown in</span></p> </div> <!-- /comment-box --> </li> </td> </tr><tr> <td> <li> <div class="comment-box"> <h5> <span class="mar_lft5">Q :</span> <a id="dlMaterials_hypermaterial_2" class="studenthdname" href="https://www.tutorsglobe.com/question/define-organizational-behaviorselect-2-companies-that-play-52324574.aspx">Define organizational behaviorselect 2 companies that play</a></h5> <p class="answer"> <span id="dlMaterials_lblQuestion_2">organizational behavior matrixpart 1define organizational behaviorpart 2complete the matrixcomponents of organizational</span></p> </div> <!-- /comment-box --> </li> </td> </tr><tr> <td> <li> <div class="comment-box"> <h5> <span class="mar_lft5">Q :</span> <a id="dlMaterials_hypermaterial_3" class="studenthdname" href="https://www.tutorsglobe.com/question/united-broke-artists-uba-is-a-broker-for-not-so-famous-52324575.aspx">United broke artists uba is a broker for not-so-famous</a></h5> <p class="answer"> <span id="dlMaterials_lblQuestion_3">question convert the erd from problem into a corresponding uml class diagramproblem united broke artists uba is a</span></p> </div> <!-- /comment-box --> </li> </td> </tr><tr> <td> <li> <div class="comment-box"> <h5> <span class="mar_lft5">Q :</span> <a id="dlMaterials_hypermaterial_4" class="studenthdname" href="https://www.tutorsglobe.com/question/sean-has-a-new-project-for-you-to-work-on-directly-after-52324576.aspx">Sean has a new project for you to work on directly after</a></h5> <p class="answer"> <span id="dlMaterials_lblQuestion_4">xml authoring assignmentsean has a new project for you to work on in addition to digital games the harpe gaming store</span></p> </div> <!-- /comment-box --> </li> </td> </tr><tr> <td> <li> <div class="comment-box"> <h5> <span class="mar_lft5">Q :</span> <a id="dlMaterials_hypermaterial_5" class="studenthdname" href="https://www.tutorsglobe.com/question/typically-a-hospital-patient-receives-medications-that-have-52324577.aspx">Typically a hospital patient receives medications that have</a></h5> <p class="answer"> <span id="dlMaterials_lblQuestion_5">question typically a hospital patient receives medications that have been ordered by a particular doctor because the</span></p> </div> <!-- /comment-box --> </li> </td> </tr><tr> <td> <li> <div class="comment-box"> <h5> <span class="mar_lft5">Q :</span> <a id="dlMaterials_hypermaterial_6" class="studenthdname" href="https://www.tutorsglobe.com/question/explain-what-norms-and-values-you-internalized-and-how-52324578.aspx">Explain what norms and values you internalized and how</a></h5> <p class="answer"> <span id="dlMaterials_lblQuestion_6">discuss your own socialization process as regards either gender socialization or professional socializationexplain what</span></p> </div> <!-- /comment-box --> </li> </td> </tr><tr> <td> <li> <div class="comment-box"> <h5> <span class="mar_lft5">Q :</span> <a id="dlMaterials_hypermaterial_7" class="studenthdname" href="https://www.tutorsglobe.com/question/analyze-the-different-iss-policies-associated-with-the-it-52324579.aspx">Analyze the different iss policies associated with the it</a></h5> <p class="answer"> <span id="dlMaterials_lblQuestion_7">assignment scrty strgy amp plcy exami have exam and it would comprise on these topicsbullidentify the role of an</span></p> </div> <!-- /comment-box --> </li> </td> </tr><tr> <td> <li> <div class="comment-box"> <h5> <span class="mar_lft5">Q :</span> <a id="dlMaterials_hypermaterial_8" class="studenthdname" href="https://www.tutorsglobe.com/question/consider-how-you-deal-with-conflict-in-relationships-with-52324580.aspx">Consider how you deal with conflict in relationships with</a></h5> <p class="answer"> <span id="dlMaterials_lblQuestion_8">consider how you deal with conflict in relationships with people at work is it similar to how you handle conflict in</span></p> </div> <!-- /comment-box --> </li> </td> </tr> </table> </ul> <!-- /user-comments-list --> </div> </div> <div class="col-md-4 col-xs-12 login-area innerpage"> <div class="row"> <div class="details col-md-12"> <div class="col-md-4"> <div class="circle orange"> <i class="fa fa-question"></i> </div> <p> 1933742 </p> <p> Questions<br /> Asked</p> </div> <div class="col-md-4"> <div class="circle yellow"> <i class="fa fa-user-secret"></i> </div> <p> 3,689</p> <p> Active Tutors</p> </div> <div class="col-md-4"> <div class="circle green"> <i class="fa fa-thumbs-o-up"></i> </div> <p> 1421619</p> <p> Questions<br /> Answered</p> </div> <p><b> Start Excelling in your courses, Ask a tutor for help and get answers for your problems !! </b></p> <a href="https://www.tutorsglobe.com/post-your-job-for-free.aspx" class="btn btn-primary btn-lg mar_top10">ask Question</a> </div> </div> <div class="row"> <div class="user-comments-area hidden-xs"> <hr /> <h4 class="text-uppercase mar_btm20"> <i class="fa fa-question-circle"></i> Asked Questions</h4> <hr /> <ul class="user-comments-list"> <table id="dlNewReviews" cellspacing="0" style="width:100%;border-collapse:collapse;"> <tr> <td> <li> <div class="comment-box"> <h5> <a id="dlNewReviews_hyperQues_0" class="studenthdname" href="https://www.tutorsglobe.com/question/are-there-any-of-the-objections-to-the-teaching-of-catholic-53424348.aspx">Are there any of the objections to the teaching of catholic</a></h5> <p> <span id="dlNewReviews_lblReviews_0">Are there any of the objections to the teaching of the Catholic Church that Austriaco describes and rebuts on pp. 108-113?</span></p> </div> <!-- /comment-box --> </li> </td> </tr><tr> <td> <li> <div class="comment-box"> <h5> <a id="dlNewReviews_hyperQues_1" class="studenthdname" href="https://www.tutorsglobe.com/question/application-of-your-passage-following-ibs-principles-53424350.aspx">Application of your passage following ibs principles</a></h5> <p> <span id="dlNewReviews_lblReviews_1">After you complete the evaluation, now is the time for the application of your passage following IBS principles. </span></p> </div> <!-- /comment-box --> </li> </td> </tr><tr> <td> <li> <div class="comment-box"> <h5> <a id="dlNewReviews_hyperQues_2" class="studenthdname" href="https://www.tutorsglobe.com/question/describe-the-mehfil-e-sama-in-india-53424347.aspx">Describe the mehfil-e-sama in india</a></h5> <p> <span id="dlNewReviews_lblReviews_2">Briefly describe the mehfil-e-sama in India. In your view, how do these spiritual gatherings both reflect the historical expansion of Islam from </span></p> </div> <!-- /comment-box --> </li> </td> </tr><tr> <td> <li> <div class="comment-box"> <h5> <a id="dlNewReviews_hyperQues_3" class="studenthdname" href="https://www.tutorsglobe.com/question/explain-ropkes-thought-53424352.aspx">Explain ropkes thought</a></h5> <p> <span id="dlNewReviews_lblReviews_3">In depth, Explain Ropke's thought, and evaluate it including the readings from earlier in the course. Compare and contrast his ideals. </span></p> </div> <!-- /comment-box --> </li> </td> </tr><tr> <td> <li> <div class="comment-box"> <h5> <a id="dlNewReviews_hyperQues_4" class="studenthdname" href="https://www.tutorsglobe.com/question/how-does-the-image-of-women-in-the-afterlife-change-53424337.aspx">How does the image of women in the afterlife change</a></h5> <p> <span id="dlNewReviews_lblReviews_4">Question: How does the image of women in the afterlife change between the Meccan and Madinan periods of revelation?</span></p> </div> <!-- /comment-box --> </li> </td> </tr><tr> <td> <li> <div class="comment-box"> <h5> <a id="dlNewReviews_hyperQues_5" class="studenthdname" href="https://www.tutorsglobe.com/question/how-would-you-define-altruism-53424341.aspx">How would you define altruism</a></h5> <p> <span id="dlNewReviews_lblReviews_5">Question 1: How would you define Altruism? Question 2: Summarize the important concepts presented in your reading.</span></p> </div> <!-- /comment-box --> </li> </td> </tr><tr> <td> <li> <div class="comment-box"> <h5> <a id="dlNewReviews_hyperQues_6" class="studenthdname" href="https://www.tutorsglobe.com/question/what-is-it-about-tendency-to-individualize-christian-faith-53424351.aspx">What is it about tendency to individualize christian faith</a></h5> <p> <span id="dlNewReviews_lblReviews_6"> Using scripture refereneces give your insight into the following prompt: "What is it about our tendency to individualize the Christian faith</span></p> </div> <!-- /comment-box --> </li> </td> </tr> </table> </ul> </div> </div> </div> </div> </div> </div> </div> <script> var url = 'https://www.tutorsglobe.com/include/javascript/watiWidget.js'; var s = document.createElement('script'); s.type = 'text/javascript'; s.async = true; s.src = url; var options = { "enabled":true, "chatButtonSetting":{ "backgroundColor":"#00e785", "ctaText":"Whatsapp Support!!", "borderRadius":"25", "marginLeft": "0", "marginRight": "20", "marginBottom": "20", "ctaIconWATI":false, "position":"left" }, "brandSetting":{ "brandName":"Tutorsglobe", "brandSubTitle":"Trusted Since 2005", "brandImg":"https://www.tutorsglobe.com/include/images/chat-logo.svg", "welcomeText":"Hi there!\nDo you Need help?", "messageText":"Hello, Tutorsglobe !! I have a question!", "backgroundColor":"#00e785", "ctaText":"Chat with Whatsapp", "borderRadius":"25", "autoShow":false, "phoneNumber":"441416286080" } }; s.onload = function() { CreateWhatsappChatWidget(options); }; var x = document.getElementsByTagName('script')[0]; x.parentNode.insertBefore(s, x); </script> <footer class="site-footer"> <div class="container"> <div class="footerlinks"> <a href="https://www.tutorsglobe.com/">Home</a> | <a href="https://www.tutorsglobe.com/about-us.aspx">Company Overview</a> | <a href="https://www.tutorsglobe.com/services.aspx">Services</a> | <a href="https://www.tutorsglobe.com/library/">Discover Q&A</a> | <a href="https://www.tutorsglobe.com/sitemap.aspx">Sitemap</a> | <a href="https://www.tutorsglobe.com/contact-us.aspx">Contact Us</a> | <a href="https://www.tutorsglobe.com/terms-and-conditions.aspx">T & C</a> | <a href="https://www.tutorsglobe.com/refundcancelpolicy.aspx">Refund Policy</a> | <a href="https://www.tutorsglobe.com/copyright-infringement-policy.aspx">Copyright Policy</a> | <a href="https://www.tutorsglobe.com/blog/archive/">Blog</a> | <a href="https://www.tutorsglobe.com/library/archive.aspx">Q&A</a> | <a href="https://www.tutorsglobe.com/education-directory.aspx">Directory</a> </div> <p>©TutorsGlobe</a> All rights reserved 2022-2023. </p> <script type="application/ld+json"> { "@context": "http://schema.org/", "@type": "product", "name": "Tutorsglobe", "image": "https://www.tutorsglobe.com/IncludeLib/Images/logo.png", "description": "elearning Platform - Tutor Service", "brand": { "@type": "elearning", "name": "Tutorsglobe" }, "aggregateRating": { "@type": "AggregateRating", "ratingValue": "4.9", "ratingCount": "37128" } } </script> <a href="#" class="settings"><i class="fa fa-angle-up"></i></a> <ul class="social-icons"> <li><a href="https://www.facebook.com/TutorsGlobe" rel="nofollow" target="_blank"><i class="fa fa-facebook-square"></i></a></li> <li><a href="https://twitter.com/Tutorsglobe" rel="nofollow" target="_blank"><i class="fa fa-twitter-square"></i></a></li> <li><a href="#" rel="nofollow"><i class="fa fa-youtube-square"></i></a></li> <li><a href="https://www.linkedin.com/company/tutorsglobe" target="_blank" rel="nofollow"><i class="fa fa-linkedin-square"></i></a></li> </ul> </div> <script type="text/javascript"> var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-32333066-1']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.tutorsglobe.com/IncludeLib/js/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); </script> <script async src="https://www.googletagmanager.com/gtag/js?id=G-5E9QFMFDJR"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'G-5E9QFMFDJR'); </script> </footer> </div> <!-- /pageWrap --> <div class="overlay"> </div> <!-- JavaScript Files ================================================== --> <script type="text/javascript" src="../IncludeLib/js/jquery-1.11.2.min.js"></script> <script type="text/javascript" src="../IncludeLib/js/bootstrap.min.js"></script> <script type="text/javascript" src="../IncludeLib/js/jquery.mCustomScrollbar.concat.min.js"></script> <script type="text/javascript" src="../IncludeLib/js/script.js"></script> <script type="text/javascript" src="../IncludeLib/js/ie10-viewport-bug-workaround.js"></script> <script type="text/javascript"> //<![CDATA[ var Page_Validators = new Array(document.getElementById("RequiredFieldValidator1")); //]]> </script> <script type="text/javascript"> //<![CDATA[ var RequiredFieldValidator1 = document.all ? document.all["RequiredFieldValidator1"] : document.getElementById("RequiredFieldValidator1"); RequiredFieldValidator1.controltovalidate = "txtcomments"; RequiredFieldValidator1.errormessage = "Write atleast 100 words!!"; RequiredFieldValidator1.validationGroup = "Review"; RequiredFieldValidator1.evaluationfunction = "RequiredFieldValidatorEvaluateIsValid"; RequiredFieldValidator1.initialvalue = ""; //]]> </script> <script type="text/javascript"> //<![CDATA[ var Page_ValidationActive = false; if (typeof(ValidatorOnLoad) == "function") { ValidatorOnLoad(); } function ValidatorOnSubmit() { if (Page_ValidationActive) { return ValidatorCommonOnSubmit(); } else { return true; } } //]]> </script> </form> </body> </html>