1) Open up the [url removed, login to view] file in your text editor. Closely examine the DTD. Review the lecture where we discussed DTDs.
TASK 2: Use the DTD to draw out the XML tree structure for the file. Create the XML tree structure using MS Word or Google Docs, etc. Don’t draw it out by hand.
2) Use XML tree structure to make correct XPath statements in XSLT stylesheets.
TASK 3: With the tree structure, create an XSLT stylesheet for [url removed, login to view] that will create a table with the following column labels:
Volume, Number, Title, Start Page, End Page, Page Length.
-Choose good value of "select" for-each select statement. Most of the columns in the table represent children of element “article”. Therefore element “article” might be one good suggestion. However, you can’t just enter select="article" with no further thought. This statement would imply that article is a child element of SigmodRecord. Instead, use a correct XPath from your template match (SigmodRecord) to the node you want to select in your for-each statement (article). Determine that XPath and place its value in the select field of the for-each statement.
-The value-of select statements for title, initPage and endPage should be easy.
-We will need to think a little harder about the value-of select statements for volume and number. Why? Is there any direct path between these elements and the element “article”? We typically use XPath to navigate DOWN an XML tree, but it is also possible to use it to navigate back UP. The XPath expression .. will move you one level back up the tree. The XPath expression ../.. will move you two levels back up the tree. What node is two levels back up the tree from “article”? How would you complete this XPath expression to get it to point to element “volume”? Element “number”? Place the correct XPath expressions in the select fields of the value-of select statements for volume and number.
-Now let’s turn to column Page Length. There is no data for that, but we do have the data necessary to calculate it. What should the formula for page length be? Basic math can be done in XPath as follows: However you formulate things, make sure that an article that starts and finishes on page 5 gets counted as being 1 page long rather than 0 pages. Note: obviously you will need to replace nodeX and nodeY with real elements from sigmod.xml.
-Finally, save [url removed, login to view] and put a reference to it in [url removed, login to view] after the DTD code. 3
-Open up [url removed, login to view] (not [url removed, login to view]!) in Firefox and you should see your new, working table. If not, fix the errors in your .xsl file.
DTD (Please ignore underlines "____" "____"
____ <!DOCTYPE SigmodRecord [ ____
____ <!ELEMENT issue (volume,number,articles) > ____
____ <!ELEMENT volume (#PCDATA)> ____
____ <!ELEMENT number (#PCDATA)> ____
____ <!ELEMENT articles (article)* > **
____ <!ELEMENT article (title,initPage,endPage,authors) > ____
____ <!ELEMENT title (#PCDATA)> ____
____ <!ELEMENT initPage (#PCDATA)> ____
____ <!ELEMENT endPage (#PCDATA)> ____
____ <!ELEMENT authors (author)* > ____
____ <!ELEMENT author (#PCDATA)> ____
____ <!ATTLIST author position CDATA #IMPLIED> ____
____ (contains text/#PCDATA) ____
9 freelancers are bidding on average $139 for this job
I can help in your project, please check PMB and our ratings/reviews to get idea of our experience. Please let me know if you have any queries.
Hello, I have over 8 years experience in advanced web programming. I can do this job. Please feel free to ask if you have any questions. Thank You