COAP:COAP-2180/week4: Difference between revisions
m (Created page with "=== Week 4 COAP 2180 === (''' under construction ''') On week four you will learn how to transform XML content, e.g. for rendering with HTML * Creating a sim...") |
|||
(24 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
== Week 4 [[Help:COAP-2180|COAP 2180]] == | |||
On week four you will learn how to '''transform XML content''', e.g. for rendering with HTML: | |||
* Simple XML to HTML node transformation with XSLT templates and node selection | |||
On week four you will learn how to transform XML content, e.g. for rendering with HTML | |||
* Simple XML to HTML node transformation with | |||
* XSLT value extraction | * XSLT value extraction | ||
This homework can be part of your term project. | This homework can be part of your term project. | ||
==== Teaching materials | == Midterm - week 5 preparation == | ||
We shall briefly discuss the kind and structure of the exam which will take place on Wednesday week 5 | |||
* [[COAP:COAP-2180/week5#Midterm_-_preparation|week 5 program]] | |||
== Teaching materials == | |||
''' [[Tour de XML]]''' | ''' [[Tour de XML]]''' | ||
(This week: | (This week: ASX playlists and X3D) | ||
''' | '''Demonstration''' | ||
* [http://tecfa.unige.ch/guides/xml/examples/dtd-examples/cuisine.xml cuisine.xml] - [http://tecfa.unige.ch/guides/xml/examples/dtd-examples/cuisine.xsl cuisine.xsl] - [http://tecfa.unige.ch/guides/xml/examples/dtd-examples/cuisine.css cuisine.css] | |||
* [[ | '''Using the editor''' | ||
* [ | * [[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 [https://addons.mozilla.org/en-US/firefox/addon/xml-developer-toolbar/ XML developer toolbar] Firefox extension. It allows to display the transformation output and more... | |||
''' | '''XSLT and XPath texts''' | ||
* [[XSLT Tutorial - Basics]] (wiki lecture notes) | |||
* [[DTD tutorial]] (wiki lecture notes, reminder) | |||
* [http://tecfa.unige.ch/guides/te/files/xml-xslt.pdf xml-xslt.pdf] (slides) | |||
* [[XSLT to generate SVG tutorial]] (optional) | |||
* [http://tecfa.unige.ch/guides/xml/examples/ | '''Live demo''' | ||
... using a student-made XML file for homework 3 ? | |||
'''Examples files''' | |||
* [http://tecfa.unige.ch/guides/xml/examples/xsl-simple/ DTD, XML and XSLT example directory] | |||
'''Textbook chapters''' | '''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''' ! | 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''' ! | ||
* ''XML in a Nutshell'' | * 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. | These chapters are available through the world classroom. | ||
; For the adventurous | ; For the adventurous | ||
* Follow up the links in the [[XSLT]] page. | |||
* [[:Category:XML|XML Category]] (All XML-related articles in this wiki) | * [[:Category:XML|XML Category]] (All XML-related articles in this wiki) | ||
* [http://en.wikipedia.org/wiki/Xml XML] (on Wikipedia) | * [http://en.wikipedia.org/wiki/Xml XML] (on Wikipedia) | ||
== Homework 4 - Week 4 == | |||
'''Task''' | '''Task''' | ||
* Translate the example XML file of Homework 3 into HTML | * Translate the example XML file of Homework 3 into HTML. If you didn't do homework 3 or if you want to work with different contents then you can use another XML file. | ||
* Make sure that a potential user | * Make sure that a potential user will be happy with the rendering in terms of readability, usability and style. | ||
* | * For styling the HTML output, you either can use inline styles or an attached CSS stylesheet. | ||
Tips: | Tips: | ||
* | * Define a template for each of your elements | ||
* Elements that only include other elements and no text should just be made into <nowiki><div> .... </div></nowiki> blocks | * Elements that only include other elements and no text should just be made into <nowiki><div> .... </div></nowiki> blocks | ||
'''Note:''' | |||
* Homework 5 will require adding of pictures and links. Advanced students can anticipate this in hw4 and skip hw5 in favour of hw6 and hw7... | |||
'''Deadline and submission:''' | '''Deadline and submission:''' | ||
* ''' | * '''Wednesday week 5''' (before start of class) | ||
* Use the world classroom | * Use the world classroom | ||
* Submit the *.dtd, the *.xml test files, the *.xslt file, an optional | * Submit the *.dtd, the *.xml test files, the *.xslt file, an optional optional report file (see below), any other file used (CSS, pictures, etc.) | ||
'''Evaluation criteria (roughly)''' | '''Evaluation criteria (roughly)''' | ||
Line 60: | Line 76: | ||
* Incomplete rendering of elements | * Incomplete rendering of elements | ||
''Work considered as | ''Work considered as minimalist:'' | ||
* Minimal rendering of elements, e.g. no extra information inserted | * Minimal rendering of elements, e.g. no extra information inserted. Validation errors. | ||
''Good work may include '''one''' or several of the following | ''Good work and excellent work (B to A-) may include '''one''' or several of the following: | ||
* Valid XML | |||
* Inserted comments <!-- ... --> in the XSLT that explain some (not all of the translation) | * Inserted comments <!-- ... --> in the XSLT that explain some (not all of the translation) | ||
* Adding extra information | * Adding extra information or (if relevant) filtering information | ||
* Good usability of the result | * Good usability of the result | ||
* Some CSS styling of the HTML output | |||
* Revised DTD (with respect to hw3, e.g. some elements for inline markup, other new elements, reordering, etc.) | |||
* A report (e.g. in HTML, word, PDF etc.) | |||
* | |||
''Brilliant work (A) | ''Brilliant work (A) | ||
* Does most of the above, i.e. produces a result that could be used in real life. | * Does most of the above, i.e. produces a result that could be used in real life. |
Latest revision as of 23:38, 9 April 2017
Week 4 COAP 2180
On week four you will learn how to transform XML content, e.g. for rendering with HTML:
- Simple XML to HTML node transformation with XSLT templates and node selection
- XSLT value extraction
This homework can be part of your term project.
Midterm - week 5 preparation
We shall briefly discuss the kind and structure of the exam which will take place on Wednesday week 5
Teaching materials
Tour de XML (This week: ASX playlists and X3D)
Demonstration
Using the editor
- 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 XML developer toolbar Firefox extension. It allows to display the transformation output and more...
XSLT and XPath texts
- XSLT Tutorial - Basics (wiki lecture notes)
- DTD tutorial (wiki lecture notes, reminder)
- xml-xslt.pdf (slides)
- XSLT to generate SVG tutorial (optional)
Live demo ... using a student-made XML file for homework 3 ?
Examples files
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 4 - Week 4
Task
- Translate the example XML file of Homework 3 into HTML. If you didn't do homework 3 or if you want to work with different contents then you can use another XML file.
- Make sure that a potential user will be happy with the rendering in terms of readability, usability and style.
- For styling the HTML output, you either can use inline styles or an attached CSS stylesheet.
Tips:
- Define a template for each of your elements
- Elements that only include other elements and no text should just be made into <div> .... </div> blocks
Note:
- Homework 5 will require adding of pictures and links. Advanced students can anticipate this in hw4 and skip hw5 in favour of hw6 and hw7...
Deadline and submission:
- Wednesday week 5 (before start of class)
- Use the world classroom
- Submit the *.dtd, the *.xml test files, the *.xslt file, an optional optional report file (see below), any other file used (CSS, pictures, etc.)
Evaluation criteria (roughly)
Work considered as weak:
- Incomplete rendering of elements
Work considered as minimalist:
- Minimal rendering of elements, e.g. no extra information inserted. Validation errors.
Good work and excellent work (B to A-) may include one or several of the following:
- Valid XML
- Inserted comments in the XSLT that explain some (not all of the translation)
- Adding extra information or (if relevant) filtering information
- Good usability of the result
- Some CSS styling of the HTML output
- Revised DTD (with respect to hw3, e.g. some elements for inline markup, other new elements, reordering, etc.)
- A report (e.g. in HTML, word, PDF etc.)
Brilliant work (A)
- Does most of the above, i.e. produces a result that could be used in real life.