|
home—lects—hws
D2L—breeze (snow day)
Due: 2015.Apr.20 (Wed) 16:00
We will work with an XML-encoded database of information about movies, movies.xml [be sure to View Source!]. (And, here is a sample/starter movies.xsl.) Submit your files on D2L, with the names “movies.xml” and “movies.xsl”.
Have your review-summary-score be a link to a page whose URL is (say) full-reviews.xml#Metropolis. This link does not need to lead to an actual, existing page; I just want you to demonstrate that you know how to add attributes to a tag.
For full credit,
use
hint:Recall the example of usingposition() , near the end of xpath-functions/. If you like, include the word “and” before the last item.
If you want,
you can use nested
Tips:
For XSLT 1.0, one solution is to use variables and concatenation, to create a string with both types of quotes in it:
<xsl:variable name="apos">'</xsl:variable> <xsl:value-of select="…concat('abc',$apos,'def',$quot,'ghi')…"/> |
But this digression is further than I want to go in this course —
I want to focus on the ideas of XPATH,
understanding the need for sanitizing,
and reinforcing the notion of calling functions (in new languages).
And if you were really using XSLT,
hopefully you'd be finding support for XSLT 2.0,
and you could just call its function
home—lects—hws
D2L—breeze (snow day)
©2016, Ian Barland, Radford University Last modified 2016.Nov.28 (Mon) |
Please mail any suggestions (incl. typos, broken links) to ibarlandradford.edu |