5
cs301 logo
rainbow animatio

CS301 F2007 Homework #6
XSLT, XPATH, and XML Schema


Goal:


Assignment Date: 11/7/2007
Due Day: 11/14/2007

Description:

Copy the xsl directory in ~cs301/public_html/xml/xsl to your ~<login>/public_html/xml directory. It contains the sample data/programs for this exercise.

1. Learn how to specify XPATH expressions for XML elements or attributes
You can use http://cs.uccs.edu/~cs301/xml/xsl/xpath.html to verify the results.

  1. For the cd records in http://cs.uccs.edu/~cs301/xml/xsl/cdcatalog.xml, specify the XPATH expression that will extract the cds with price > 9.00.
  2. For the cd records in http://cs.uccs.edu/~cs301/xml/xsl/cdcatalog.xml, specify the XPATH expression that will extract the cds between year 1980-1990.
  3. For the stock portfolio records in http://cs.uccs.edu/~cs301/xml/xsl/portfolio.xml, specify the XPATH expression that will extract the stock records with share > 1200.

2. Learn how to create XSLT files for conver XML documents

  1. Modify the gradev1.xsl so that it will only show the students with final grade < 60. Name your solution gradehw6p2a.xsl and include the full qualified url as your answers. Hint: You can add <xsl:if> right after <xsl:sort>
  2. Copy gradev1.xsl as grade hw6p2b.xsl. Modify it so that it shows the total point as the last column in the table. The total grade is calculated with final 30%, midterm 30%, and the average of homework grade 40%. Hint see how http://cs.uccs.edu/~cs301/xml/xsl/portfoliov1.xsl calcuate the subtotal.

3. Learn how to create/interpret an XML schema.

  1. Convert gradev1.dtd to gradev1.xsd using XML schema. See an example in http://cs.uccs.edu/~cs301/xml/xsl/portfolioX.xsd. You can use XMLspy for the specification and validation.

4. Drop your answers using the dropbox.