Add an output element to indicate to the xslt processor

Assignment Help Web Project
Reference no: EM131519841

XML Authoring Assignment

Rafael Garcia has worked with the stock report you generated and has made a few modi?cations to the source document. Rafael has added a few more elements providing information on each stock's high and low value over the previous year, the stock's P/E ratio, earnings per share (EPS), dividend, and yield. He's also included the URL to the company's website. Rafael wants to try a new design, in which these new stock values appear in a table alongside a description of the stock. He also wants to show the current stock value and whether it's rising, falling, or remaining level, which is to be prominently displayed below the company name. Figure 5-38 shows a preview of the revised content and layout of the report.

Rafael has already created the CSS style sheet for this web page, but he needs you to create the XSLT style sheet, which will generate the HTML code used in the report. Because creating a style sheet can be complicated, it is strongly recommended that you save your changes and generate the result document as you complete each step below to check on your progress and detect any problems early. Complete the following:

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

2. Go to the portfolio.xml file in your text editor. Take some time to review the content of the ?le and its structure. Add a processing instruction after the comment section that attaches the portfolio.xsl style sheet to this XML document. Close the file, saving your changes.

3. Go to the portfolio.xsl file in your text editor. Below the comment section, set up this document as an XSLT style sheet by adding a stylesheet root element and declaring the XSLT namespace using the namespace prefix xsl.

4. Add an output element to indicate to the XSLT processor that the transformed ?le should be in HTML5 format.

5. Create a root template and, within that template, enter the following HTML code:
<html>
<head>
<title>Portfolio Stocks</title>
<link href="portfolio.css" rel="stylesheet" type="text/css" />
</head>
<body>
</body>
</html>

6. Directly after the opening <body> tag in the root template, insert the following code:
<header>
<section>
Last Updated: date at time
</section>
<h1>Chesterton Financial</h1>
<h2>Portfolio Stocks</h2>
</header>
where date and time are the values of the date and time elements from the source document using the XSLT value-of elements.

7. Directly below the closing </header> tag, insert the following HTML code three times, one for each of three categories of stock (Industrials, Utilities, and Transportation):
<section>
<h1>Category</h1>
stock template
</section>
where Category is either Industrials, Utilities, or Transportation, and stock template applies the template for elements from the portfolio/stock location path for stocks of the speci?ed category. Sort the applied templates in alphabetical order by stock name.

8. Create a template for the today element, and then, within the template, enter the following HTML code:
<table>
<tr>
<th>Current</th>
<th>Open</th>
<th>High</th>
<th>Low</th>
<th>Volume</th>
</tr>
<tr>
<td>current</td>
<td>open</td>
<td>high</td>
<td>low</td>
<td>volume</td>
</tr>
</table>
where current , open , high , low , and volume are the values of the current, open, high, low, and vol attributes using the XSLT value-of element.

9. Create a template for the summary element, and then, within the template, enter the following HTML code:
<table>
<tr>
<th>Web Address</th>
<td><a href="link">link</a></td>
</tr>
<tr>
<th>52wk. Range</th>
<td>low - high</td>
</tr>
<tr>
<th>P/E</th>
<td>pe_ratio</td>
</tr>
<tr>
<th>EPS</th>
<td>eps</td>
</tr>
<tr>
<th>Div. and Yield</th>
<td>dividend (yield)</td>
</tr>
</table>

where link , low , high , pe_ratio , eps , dividend , and yield are the values of the corresponding elements from the source document using the XSLT value-of element.

10 Create a template for the stock element and, within the template, enter the following HTML code:

<article>
today
summary
<h1>stock name (symbol)</h1>
</article>

where today and summary apply the today and summary templates, stock name is the name of the stock, and symbol is the value of the symbol attribute using the XSLT value-of element.

11 Directly between the closing </h1> and closing </article> tags in the stock template, use a choose structure to insert the following h2 heading and paragraph:

<h2 class="change">
<img src="change.png" alt="change" />
current
</h2>
<p>description</p>

where change has the value "up", "down", or "same" depending on whether the value of the current attribute is less than, greater than, or equal to the open attribute; current is the value of the current attribute; and description is the value of the description element. Note that the current and open attributes must be referenced from within the today element. Be sure to replace the HTML code with the proper value of expressions.

12 Save your changes to the portfolio.xsl file

13 Generate your result document using either an XML editor or your web browser. Verify that the layout matches what is shown in Figure 5-38 and that each link in the summary table jumps the user to the corresponding stock's website.

Attachment:- Attachment.rar

Reference no: EM131519841

Questions Cloud

Compare job-based pay with skill-based pay : Compare job-based pay with skill-based pay and provide an example of each. Determine which pay you would prefer. Support your decision.
Important for organizational effectiveness : Describe at least four major things you have learned in this course. Explain why these are important for organizational effectiveness.
Determine the date for which the company recognizes revenue : American Airlines collects cash on June 12 from the sale of a ticket to a customer. The flight occurs on August 16.
Research the federal rules of evidence : Research the Federal Rules of Evidence, including the Federal Rule of Evidence 702, which addresses the admissibility of testimony and expert testimony.
Add an output element to indicate to the xslt processor : Add an output element to indicate to the XSLT processor that the transformed ?le should be in HTML5 format. Create a template for the today element.
Compare team and individual bonuses and incentives : Compare team and individual bonuses and incentives. Determine which type of bonuses and incentives you would prefer.
Explain the organization and purpose of chaebols : Identify the positive and negative characteristics of chaebols for both local and global economy. Also, explain the role they play in the South Korean economy.
Personal assistant to the company president : You've just been given a great assignment to serve as personal assistant to the company president of a mid-sized firm operating just outside a major city.
Recognizes the expense using cash-basis accounting : American Airlines operates a flight from Dallas to Los Angeles on August 16. The pilots' salaries associated with the flight are paid on September 2.

Reviews

Write a Review

Web Project Questions & Answers

  Evaluating an ecommerce website

Create a check list that contains key point for evaluating an ecommerce website - Write a short, reflective report about website

  Gpc and runtime magic quotes

Create a script that lets you know whether Zeus or Helios has the GPC and Runtime Magic Quotes turned on or off. The output should have appropriate labels that define what output signified and should display 'ON' or 'OFF' depending on the setting.

  Creating functions through conditional operator

Use the conditional operator and the cal_days_in_month function, determine the number of days in the current month and output to browser whether it is normal month or a leap month.

  Web development projects with database

Since the vast majority of web-development projects involve a database, do you think that computational activities should be performed there, or do you think they belong in the XML page or stylesheet?

  Comparing shelf software packages

Required assistance with comparing and contrasting two main off the shelf software packages that could be implemented in an organization.

  Web based scams

Web phishing, pharming and vishing are popular web based scams. Talk about currently used tools and recommended measures to defeat this kind of attacks efficiently?

  Explanation of contextual links

The most powerful hypertext capabilities is the the contextual link. Wikipedia . com is a great example of a site that utilizes contextual links.

  How architectural and protocol changes occur

Discuss how architectural and protocol changes happen, the administrative organization that oversees the technical development of the Internet,

  Traditional approaches for training professionals

Webinars and other web conferencing techniques have proved most beneficial for the provision of affordable quality corporate training.

  Internet for business

Discuss how can a business use the Internet and give at least three examples with web links demonstrating your answer.

  It influences the behavior of organizations

Information technology influences the behavior of organizations. Name one effect of Information technology implementation and long-term usage you suppose having a positive contribution and one having a negative consequence.

  Importance of a guided navigation system

Explain the use and importance of a guided navigation system and shopping cart for a website designed for e-commerce and business purpose.

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