Assignment 2 - due on 02/01 [xhtml]

Download this netbeans project for this assignment.

This assignment requires knowledge from both the 01/25 and 01/27 lectures on infosets and XPath. Download this Netbeans project and fill in your answers in the answers.xhtml file. When you create addtional content, please link to that file via the XHTML anchor element ('a'). Turn in a zip-file of the assignment with your answers.

All your documents must be well-formed! Use Netbeans to check that they are well-formed by double-clicking on them and clicking on the 'downward triangle' button for a well-formed check.

In this project there is an XSLT stylesheet called 'mydump.xsl'. This will dumb the infoset items for an XPath--essentially the results of the XPath. You can test your XPaths with this XSLT stylesheet. Using it is simple:

  1. Edit the mydump.xsl file and just follow the directions in mydump.xsl on how to change the XPath you want to evaluate.

  2. Open the document you want to test it on (e.g. mouse-annotation.xml).

  3. Click on the right arrow on the edit toolbar.

  4. Type in 'mydump.xsl' in the XSLT Script prompt if it isn't already there.

  5. Hit 'OK'. The transformation should run and open the results in your browser.

There is another stylesheet called 'view-infoset.xsl' that may be helpful. It produces a browser-view of the basic properties of an infoset for a particular document. The procedure for use is the same as above but choose 'view-infoset.xsl' instead. Not all of the infoset properties are listed as XSLT does not provide access to all of them. The properties that are listed should be very useful in this assignment.

Please solve the following problems:

  1. Construct a well-formed, "structured", and tagged instance of this syllabus. For example, this assignment might be contained in an 'assignment' element as a descendant of the root 'syllabus' element. Use the formatting structure of this document to "guess" at the information structure. For simplicity, only do the first two class days and for each paragraph of text remember that cut-and-paste is your friend!

    You document must be well-formed!

  2. Find and insert the following unicode characters into the unicode.xhtml document using character references and data from the Unicode website:

    • Greek letter beta.

    • "There Exists" symbol from math (backwards E). (Hint: code page 0x2200 "Mathematical Operators").

    • A right pointing arrow. There is a whole code page for arrows.

  3. The file mouse-annotation.xml contains annotations of the mouse genome in XML. It was obtained from http://fantom.gsc.riken.go.jp/db/maxml/. For this document, write an XPath expression from the root (document element) of the document that expresses the following:

    1. Each alternate identifier ('altid') element for each sequence.

    2. Each 'annotation' that is contained in the document.

    3. The attribute xlink:href of each annotation's data source.

    4. The value of each sequence's accession number ('accession' element). That is, the character children and not the element.

  4. For the XML document namespace.xml, what is the in-scope namespaces property at:

    1. m:doc/title : The only 'title' element that is a child of element 'doc' (local name).

    2. m:doc/m:section/m:body/h:p : All occurrences of 'p' elements from the XHTML namespace (what the 'h' prefixed is bound to) within the two 'm:body' elements. Hint: There are three of these elements but one of the does not occur in the same context with the same set of in-scope namespaces.

[syllabus]