DTD: Difference between revisions
m (cat) |
m (Reverted edits by Rebecaddfgc (Talk) to last revision by Daniel K. Schneider) |
||
(6 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{Incomplete}} | |||
== Definiton == | |||
==Definiton== | |||
==Structure== | '''Document Type Definition (DTD)''' is an SGML and [[XML]] schema language. A DTD is used to define and describe the elements and groups thereof and the order in which they are allowed (or not) to appear within an SGML or XML document. A document must conform to the specifications of an associated DTD (i.e. be ''valid'') before it can be processed for output. | ||
See also: [[DTD tutorial]] | |||
== Structure == | |||
DTDs are made up of element and attribute-list declarations. | DTDs are made up of element and attribute-list declarations. | ||
*'''elements''' declare what types of data, how and whether or not they are allowed within other declared elements. | *'''elements''' declare what types of data, how and whether or not they are allowed within other declared elements. | ||
Line 37: | Line 40: | ||
</code> | </code> | ||
None of the above documents define the style of the documents. They describe the content and its syntactical expression (descriptive language), not its form or style ( | None of the above documents define the style of the documents. They describe the content and its syntactical expression (descriptive language), not its form or style (unlike [[Wikipedia:HTML | HTML]] or [[XHTML]] that provide built-in basic formatting). The style and form of the document is attributed during processing (e.g. through [[Wikipedia:Cascading Style Sheets | CSS]], [[Wikipedia:XSLT | XSLT]], ) | ||
Interpretive software can used to convert the "structured" document for multiple output formats including print and web pages containing HTML (hypertext markup language) or directly [[XML]] (extensible markup language). | |||
See the [[DTD tutorial]] for details. | |||
== Alternatives == | |||
* [[XML Schema]] - a W3C standard | * [[XML Schema]] - a W3C standard | ||
* [[Relax NG]] - an easier more XML-intuitive schema language | * [[Relax NG]] - an easier more XML-intuitive schema language | ||
== Use of DTDs in education == | |||
DTDs and other schema languages lend themselves to particular learning activities and pedagogical scenarios where either [[knowledge representation]]s and requirements, the creation of [[Ontology | ontologies]] or the definition of rubrics are individually or collaboratively constructed. | DTDs and other schema languages lend themselves to particular learning activities and pedagogical scenarios where either [[knowledge representation]]s and requirements, the creation of [[Ontology | ontologies]] or the definition of rubrics are individually or collaboratively constructed. | ||
Line 53: | Line 58: | ||
The English Department at the University of Georgia has composition students collaboratively create their own DTDs from templates, that describe the components and evaluation criteria for various writing [[Writing-to-learn#Genre debate | genres]] and such as narrative, expository or argumentative writing. | The English Department at the University of Georgia has composition students collaboratively create their own DTDs from templates, that describe the components and evaluation criteria for various writing [[Writing-to-learn#Genre debate | genres]] and such as narrative, expository or argumentative writing. | ||
{{comment| others needed}}[[User:Kalli| | [[Educational modelling language]]s rather tend to be specified with Relax NG or XML Schema ... | ||
{{comment| others needed}}[[User:Kalli|KBenetos]] | |||
==References== | ==References== |
Latest revision as of 11:02, 23 August 2010
Definiton
Document Type Definition (DTD) is an SGML and XML schema language. A DTD is used to define and describe the elements and groups thereof and the order in which they are allowed (or not) to appear within an SGML or XML document. A document must conform to the specifications of an associated DTD (i.e. be valid) before it can be processed for output.
See also: DTD tutorial
Structure
DTDs are made up of element and attribute-list declarations.
- elements declare what types of data, how and whether or not they are allowed within other declared elements.
- attribute-lists declare the attributes allowed for each element and their value type.
For example, the following XML document would be valid according to the DTD that follows.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE people_list SYSTEM "example.dtd">
<people>
<person gender="female">
<name>
<first>Jane</first>
<middle>Jean</middle>
<last>Doe</last>
<maidenName></maidenName>
</name>
</person>
<people>
Corresponding DTD:
<!ELEMENT people (person*)> //* one or more person must appear in the list
<!ELEMENT person (name)> // person element must have exactly one name element
<!ATTLIST person gender CDATA #REQUIRED> //the person element must have an attribute gender
<!ELEMENT name (first, middle?, last, maidenName?)> //middle and maidenName elements are optional
<!ELEMENT first (#PCDATA)>
<!ELEMENT middle (#PCDATA)>
<!ELEMENT last (#PCDATA)>
<!ELEMENT maidenName (#PCDATA)>
None of the above documents define the style of the documents. They describe the content and its syntactical expression (descriptive language), not its form or style (unlike HTML or XHTML that provide built-in basic formatting). The style and form of the document is attributed during processing (e.g. through CSS, XSLT, )
Interpretive software can used to convert the "structured" document for multiple output formats including print and web pages containing HTML (hypertext markup language) or directly XML (extensible markup language).
See the DTD tutorial for details.
Alternatives
- XML Schema - a W3C standard
- Relax NG - an easier more XML-intuitive schema language
Use of DTDs in education
DTDs and other schema languages lend themselves to particular learning activities and pedagogical scenarios where either knowledge representations and requirements, the creation of ontologies or the definition of rubrics are individually or collaboratively constructed.
- Examples
The English Department at the University of Georgia has composition students collaboratively create their own DTDs from templates, that describe the components and evaluation criteria for various writing genres and such as narrative, expository or argumentative writing.
Educational modelling languages rather tend to be specified with Relax NG or XML Schema ...
- others neededKBenetos
References
- Wikipedia: Document Type Definition
- Paille, G. Open School (A Division of the Open Learning Agency)British Columbia, Canada [1]