COAP:COAP-2180/week3: Difference between revisions

The educational technology and digital learning wiki
Jump to navigation Jump to search
m (Created page with "=== Week 3 COAP 2180 === On week three we will learn how to create our own DTDs * Editing XML should be a prerequisite, i.e. you should be familiar now with a...")
 
 
(28 intermediate revisions by the same user not shown)
Line 1: Line 1:
=== Week 3 [[Help:COAP-2180|COAP 2180]] ===
== Week 3 Summary [[Help:COAP-2180|COAP 2180]] ==


On week three we will learn how to create our own DTDs
On week three you will finish learning how to create your own simple DTD:
* Editing XML should be a prerequisite, i.e. you should be familiar now with a simple DTD's structure
* Defining an '''information architecture''' (sketching out elements and attributes)
* Defining an information architecture (sketching out elements and attributes)
* Defining DTD '''rules for elements and attributes'''
* Defining DTD rules and attributes


==== Teaching materials ====
This homework can be a prototype for a part of your term project.


; [[Tour de XML]] (This week: E-books and X3D)
== Teaching materials ==


; Defining a DTD
''' [[Tour de XML]]'''
* [[DTD tutorial]]
(This week: [[BPMN_1.2_tutorial|BPMN]])
 
'''Defining a DTD'''
 
* [[DTD tutorial]] (wiki lecture notes)
* [http://tecfa.unige.ch/guides/te/files/xml-dtd.pdf xml-dtd.pdf] (slides)
 
'''Using XML Exchanger'''
* After each DTD changer close/reopen the XML file.
* Read [[Exchanger XML Editor]], if needed.
 
'''Examples files (same as before)'''


; Examples files (same as before)
* [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]


; 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''' !
* ''Learning XML'', Chapter 4 Quality Control with Schemas
* ''XML in a Nutshell'', Chapter 3 Document Type Definitions (start here)
* ''XML in a Nutshell'', Chapter 3 Document Type Definitions
* ''Learning XML'', Chapter 4 Quality Control with Schemas (additional reading)


These chapters are available through the world classroom.
These chapters are available through the world classroom.
Line 26: Line 36:
* [[: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)
* Mix in some XHTML: See [http://tecfa.unige.ch/guides/xml/examples/composites/xml_plus_xhtml.xml this example]. You then must declare these tags in your DTD using the same prefix as in the XML file.
<source lang="XML">
<!ELEMENT xhtml:img EMPTY>
<!ATTLIST xhtml:img src CDATA #REQUIRED>
</source>


==== Homework 1 - Weeks 1/2 ====
== Homework 3 - Week 3 ==
 
'''Deadline and submission:'''
* '''Monday week 3''' (before start of class)
* Use the worldclassroom: https://webster.blackboard.edu/
* Submit the *.xml, the *.dtd and an optional report file (see below)


'''Task'''
'''Task'''


Edit an XML document with the suggested DTDs below
Create a DTD and create an associated XML test file.
* Respect the semantics of the elements and the attributes
* Your DTD should be somewhat text-centric (i.e. be meant for creating documents that can be displayed in some way)
* Validate your document
* You can define the purpose of the DTD you wish to model, but it's best to discuss your plans in class.
* Try to use as many different elements as you can (if appropriate)
: I strongly suggest to consider a study area you are interested in, and to model for example a process, a document genre, a description of a class of artifacts, etc. Avoid lists of CDs, cars, etc.
* Follow additional directions for each suggested DTD
: If you reuse elements from an other DTD, please tell so (in the comments of the DTD). '''Plagiarism will be punished''', but '''documented reuse''' of elements from an existing DTD or even inclusion of a whole DTD (e.g. for formatting) is just fine !
* Bonus: add longer comments in the DTD or the XML file that explain the XML structure and that express your opinions


Do '''not worry too much''' about rendering (display). It is more important that your get the XML editing right, i.e. be able to fill in a dynamic information structure with data. Producing a really good looking CSS will give you a bonus.
Tips:
* Take into account that you may reuse this DTD in most follow-up projects, including the term project !!
* Do not attempt to define a too simple DTD (lists) or a very complex one. Make it both interesting and reasonable.
* Do '''not worry''' about rendering (display). It will be done in homework 4. In week 4/5 you will learn how to add information to a text, e.g. if you have an element like:
<nowiki><adress>Mr. X., 1 Cool st., Geneva</address></nowiki>
you will be able to make the result look like: ''Private Address''': Mr X. ,......''. In other words: '''Think about data''', not display !


You can choose among the DTDs available at http://tecfa.unige.ch/guides/xml/examples/dtd-examples/
'''Use of the xngr editor'''
* Make sure to get both the *-template.xml and the corresponding *.dtd file. If available, you also should take the *.css.
* The editor reads the DTD when you load the XML file. This implies that you will have to define a skeleton before you can actually use/test the DTD. E.g.
<source lang="XML">
<?xml version="1.0"?>
<!DOCTYPE cd-list SYSTEM "cd-list.dtd">


Some of the DTDs are described in the following table.
<cd-list>
{| class="prettytable"
| <center>'''DTD (difficulty)'''</center>
</cd-list>
| <center>'''Purpose'''</center>
</source>
| <center>'''file name'''</center>
This also implies, that you will have to close the XML file and to reload it after making changes to the DTD.
| <center>'''Additional directions'''</center>


|-
'''Deadline and submission:'''
| Recipe DTD
* '''<span style="color:red">Monday week 4</span>''' (<span style="color:green">before 9h</span>)
 
* Use the world classroom
(easy)
* Submit the *.dtd plus the *.xml test files and an optional report file (see below)
| Write simple recipes
| recipe.dtd
| Use all tags. Write at least one recipe. Make sure that there is enough information to really use it.
 
|-
| Recipe Markup Language
 
(medium)
| Write complex recipes
| recipeml.dtd
| As above, but only use appropriate tags. Hint: find the website of its creator
 
|-
| RSS 0.92
 
(medium)
| News syndication (usually machine generated)
| rss-0-92.dtd
| Use enough tags to display this in an aggregator. Enter at least 4 URLs. Hint: look at a RSS news feed first !
 
|-
| Simple Docbook
 
(hard)
| Write "real" articles
| sdocbook.dtd
| Do not use all tags, only the needed ones. Copy/paste from a text you already have.
 
|-
| Instructions
 
(medium)
| Write "how-to" instructions
| instructions.dtd
| Come up with a good "how-to problem". Only use tags you need..
 
|-
| StepbyStep
 
(medium hard)
| Write "how-to" instructions
| stepbystep03.dtd
| Make up a good "how-to problem". Only use tags you need..
 
|-
| Story grammar
 
(medium)
| Write simple fairy tales
| story-grammar.dtd
| Write a nice fairy tale. Doesn’t need to be your own.


|}
'''Evaluation criteria'''


'''Evaluation criteria (roughly)'''
Consult the evaluation grid in the world classroom for details !


''Work considered as weak:''
''Work considered as weak:''
* Well-formed (but not valid) document using the DTD’s elements
* Correct DTD that contains at least 5 elements that you invented yourself and a somewhat valid XML example file


''Work considered as minimalistic:''
''Work considered as minimalist:''
* Valid document that includes very minimal content.
* A correct small DTD that fits a purpose (including a valid XML example file)


''Good work includes:''
''Good work may include one or several of the following
* Valid document with an interesting content
* Inserted comments <!-- ... --> in the DTD and that explains the purpose of the DTD, the purpose of each element, authorship, date, etc.
* Some CSS
* A DTD that is "interesting" and useful for a given domain, e.g. it should include more than just 5 elements
* Use of attributes
* Use of entities
* A DTD that is more complex than a simple table (e.g. one that contains recursive elements or links)
* A good XML example that uses all elements more than once (i.e. you do information architecture testing)


''Excellent work (A-) includes:''
''Excellent work (A-) includes in addition''
* Inserted useful comments <nowiki><!-- ... --></nowiki> in the XML and/or the DTD
* A 1-2 page report that discusses your information architecture (the DTD structure) and results (what do you think of it, how could you improve it, etc.). You may include this report as "comment" in the DTD.
* Respect of the DTD's semantics
* Good enough CSS for easy reading


''Brilliant work (A) includes either one of:''
''Brilliant work (A)
* A 1 page report that discusses the architecture of the DTD and your opinion of it, e.g. you can describe architecture of the DTD (without going into detailed description of every element !), discuss what you would like to improve, what you liked/disliked, your difficulties, etc. You simply can include this report into the DTD that you resubmit or as word/PDF/HTML file. As you like, presentation doesn't matter.
* Does most of the above, i.e. produces a DTD that could be used for real plus a decent documentation.
* Outstanding styling

Latest revision as of 08:40, 5 April 2017

Week 3 Summary COAP 2180

On week three you will finish learning how to create your own simple DTD:

  • Defining an information architecture (sketching out elements and attributes)
  • Defining DTD rules for elements and attributes

This homework can be a prototype for a part of your term project.

Teaching materials

Tour de XML (This week: BPMN)

Defining a DTD

Using XML Exchanger

Examples files (same as before)

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 !

  • XML in a Nutshell, Chapter 3 Document Type Definitions (start here)
  • Learning XML, Chapter 4 Quality Control with Schemas (additional reading)

These chapters are available through the world classroom.

For the adventurous
  • XML Category (All XML-related articles in this wiki)
  • XML (on Wikipedia)
  • Mix in some XHTML: See this example. You then must declare these tags in your DTD using the same prefix as in the XML file.
<!ELEMENT xhtml:img EMPTY>
<!ATTLIST xhtml:img src CDATA #REQUIRED>

Homework 3 - Week 3

Task

Create a DTD and create an associated XML test file.

  • Your DTD should be somewhat text-centric (i.e. be meant for creating documents that can be displayed in some way)
  • You can define the purpose of the DTD you wish to model, but it's best to discuss your plans in class.
I strongly suggest to consider a study area you are interested in, and to model for example a process, a document genre, a description of a class of artifacts, etc. Avoid lists of CDs, cars, etc.
If you reuse elements from an other DTD, please tell so (in the comments of the DTD). Plagiarism will be punished, but documented reuse of elements from an existing DTD or even inclusion of a whole DTD (e.g. for formatting) is just fine !

Tips:

  • Take into account that you may reuse this DTD in most follow-up projects, including the term project !!
  • Do not attempt to define a too simple DTD (lists) or a very complex one. Make it both interesting and reasonable.
  • Do not worry about rendering (display). It will be done in homework 4. In week 4/5 you will learn how to add information to a text, e.g. if you have an element like:
<adress>Mr. X., 1 Cool st., Geneva</address>

you will be able to make the result look like: Private Address: Mr X. ,....... In other words: Think about data, not display !

Use of the xngr editor

  • The editor reads the DTD when you load the XML file. This implies that you will have to define a skeleton before you can actually use/test the DTD. E.g.
<?xml version="1.0"?>
<!DOCTYPE cd-list SYSTEM "cd-list.dtd">

<cd-list>
	
</cd-list>

This also implies, that you will have to close the XML file and to reload it after making changes to the DTD.

Deadline and submission:

  • Monday week 4 (before 9h)
  • Use the world classroom
  • Submit the *.dtd plus the *.xml test files and an optional report file (see below)

Evaluation criteria

Consult the evaluation grid in the world classroom for details !

Work considered as weak:

  • Correct DTD that contains at least 5 elements that you invented yourself and a somewhat valid XML example file

Work considered as minimalist:

  • A correct small DTD that fits a purpose (including a valid XML example file)

Good work may include one or several of the following

  • Inserted comments in the DTD and that explains the purpose of the DTD, the purpose of each element, authorship, date, etc.
  • A DTD that is "interesting" and useful for a given domain, e.g. it should include more than just 5 elements
  • Use of attributes
  • Use of entities
  • A DTD that is more complex than a simple table (e.g. one that contains recursive elements or links)
  • A good XML example that uses all elements more than once (i.e. you do information architecture testing)

Excellent work (A-) includes in addition

  • A 1-2 page report that discusses your information architecture (the DTD structure) and results (what do you think of it, how could you improve it, etc.). You may include this report as "comment" in the DTD.

Brilliant work (A)

  • Does most of the above, i.e. produces a DTD that could be used for real plus a decent documentation.