HTML and CSS Reference
7. Using the code in Tables 12-23, 12-24, and 12-28 on pages HTML 589 to HTML 592 as a guide,
create an XSL style sheet to display the e-mails as shown in Figure 12-47. For each of the defined
fields, use a <span> tag with an inline style setting the font-famiy to Arial, Helvetica, sans-serif; the
font-style to italic; the font-weight to bold; and the color to #000099. Use a <p> tag with an inline
style to set the label, Body, text-decoration to underline and the font-variant to small caps. Use
another <p> tag to place the body data on new line. Use a <span> tag with an inline style and set
the font-famiy to Times, Times New Roman, serif, and the font-weight to bold. After the body of
the e-mail, use a <p> tag and the <xsl:text> tag to insert a string of asterisks to separate the current
e-mail message from the next one.
8. If necessary, activate your browser. In the Address bar, type www.corefiling.com/opensource/
schemaValidate.html and then press the enter key to load the Web page as in Figure 12-21 on
page HTML 585. Click the Browse button next to the XML Schema input text field. Navigate to
your storage device and select the apply12-1email_schema_solution.xsd file.
9. Click the Browse button next to the XML Instance text field. Navigate to your storage device and
select the apply12-1email_solution.xml file.
10. Click the Validate button. When the “Your results are ready” page displays, click the “Click here”
link to see if your XML and XSD files are valid.
11. If an error occurs, check your code against the instructions in Steps 1 through 7 and then save and
test the XML and XSD document files again.
12. Submit the XSD, XML, and XSL files in the format specified by your instructor.
Extend Your Knowledge
Extend the skills you learned in this chapter and experiment with new skills. You will need to
search the Internet to complete the assignment.
Learning More about Displaying XML Data Islands
Instructions: Start Notepad++ and your browser. Open the file extend12-1menu.xml from the
Chapter12\Extend folder of the Data Files for Students. See the inside back cover of this topic for
instructions on downloading the Data Files for Students, or contact your instructor for information
about accessing the required files.
Two files are provided, extend12-1menu.xml, and extend12-1home.html, which is a simple Web
page with four links: list breakfast items, list lunch items, list supper items and list items under $4.
You are to create an XSL style sheet using the <xsl:if> tag to display the breakfast, lunch, and supper
items only and link with the menu XML file. You will also create an XSL style sheet that uses the
<xsl:choose> tag to display only items less than $4. Search the Internet for tutorials on the use of the
<xsl:if> and <xsl:choose> tags.