COAP:COAP-2180/week5: Difference between revisions

The educational technology and digital learning wiki
Jump to navigation Jump to search
Line 51: Line 51:
* [[XSLT Tutorial - Basics]] (wiki lecture notes)
* [[XSLT Tutorial - Basics]] (wiki lecture notes)
* [[DTD tutorial]] (wiki lecture notes)
* [[DTD tutorial]] (wiki lecture notes)
* [[XPath tutorial - basics]] (optional wiki lecture notes)
* [http://tecfa.unige.ch/guides/te/files/xml-xslt.pdf xml-xslt.pdf] (slides)
* [http://tecfa.unige.ch/guides/te/files/xml-xslt.pdf xml-xslt.pdf] (slides)


'''Examples files (same as before)'''
'''Examples files (also on the N: drive)'''


* [http://tecfa.unige.ch/guides/xml/examples/dtd-examples/ DTD and XML templates example directory]
* [http://tecfa.unige.ch/guides/xml/examples/dtd-examples/ DTD and XML templates example directory]
* [http://tecfa.unige.ch/guides/xml/examples/xsl-simple/ Simple XSLT examples


'''Textbook chapters'''
'''Textbook chapters'''

Revision as of 09:40, 24 November 2010

Week 5 COAP 2180

On week five you will continue learning how to transform XML content, e.g. use XSLT to render XML with HTML + CSS

  • Elementary XPath and XSLT value extraction
  • Some simple XML to HTML node transformation design patterns, e.g. how to deal with pictures
  • Use CSS styling for the HTML output

This homework can be part of your term project.

Midterm - preparation

For your mid-term exam (Wednesday) you will receive a task like the following one:


Please create a DTD that models the following type of Documents: __________________

  • Your model should "capture" the most important information blocks
  • Use at least ___ elements

Suggested procedure:

  • Sketch out the DTD structure on paper (or with an editor)
  • Create the DTD
  • Validate the DTD
  • Create an XML test file
  • Revise DTD if needed

Tips:

  • Save frequently
  • If you start making revisions to the DTD towards the end of the exam, create a new version of DTD and the XML.

Bonus points:

  • Use of attributes and/or DTD entities when appropriate
  • Use of some elements for styling longer text, e.g. bullets and paragraphs
  • Very complete test files
  • Comments in the DTD

Upload the following:

  • DTD file
  • XML test file

Teaching materials

Tour de XML (cancelled this week)

Demonstration

Using the editor (new)

  • Exchanger XML Editor (in particular, read the sections concerning XSLT)
  • In case you are using another XML editor that can't do XSLT transformations, you may install the XSL Results Firefox extension. It allows to display the transformation output and more. You also could use the debug tools of IE (hit F12).

XSLT and XPath texts

Examples files (also on the N: drive)

Textbook chapters

If you find that my lecture notes and slides are incomplete, too short or not good enough, reading either one or both texts is mandatory !

  • Ray, Learning XML, Second Edition, Transformation with XSLT chapter
  • Ray, Learning XML, Second Edition, XPath and XPointer chapter (pp. 205-213)
  • Harold, XML in a Nutshell, XSL Transformations (XSLT) chapter (optional)

These chapters are available through the world classroom.

For the adventurous
  • Follow up the links in the XSLT page.
  • XML Category (All XML-related articles in this wiki)
  • XML (on Wikipedia)

Homework 5 - Week 5

Task

  • Revise homework 4. If needed, improved the DTD
  • Create a CSS for the HTML generated, either use inline styles or better: an external CSS file)

Tips:

  • Use a rule for each of your elements
  • Elements that only include other elements and no text should just be made into <div> .... </div> blocks for styling
  • Use the XSLT processor to manually create an HTML file, then look at its structure. You also should validate the file


Deadline and submission:

  • Monday week 6 (before start of class)
  • Use the world classroom: https://webster.blackboard.edu/
  • Submit the *.dtd, the *.xml test files, the *.xslt file, the *.css file, an optional optional report file (see below)

Evaluation criteria (roughly)

Work considered as weak:

  • Incomplete rendering of elements

Work considered as minimalistic:

  • Minimal rendering of elements, e.g. no extra information inserted
  • Very minimal CSS

Good work and excellent work (B to A-) may include one or several of the following:22

  • Inserted comments in the XSLT that explain some (not all of the translation)
  • Using XSLT to add information, deal with pictures or links, etc.
  • Revised DTD (with respect to hw3, e.g. some elements for markup, other new elements, reordering, etc.)
  • A report (e.g. in HTML, word, PDF etc.)
  • Good styling (usability)
  • Good styling (coolness)
  • Almost valid HTML produced

Brilliant work (A)

  • Does most of the above, i.e. produces a result that could be used in real life.