Note 4 for XML

Watch & Read:

IE use to act like a low level validate tool.

The old XML Notepad (not the 2007 version) validates your XML

DTD Provides:

  1. A way to specify (restricting) the type of data that needs to be in the XML document (Validating)

  2. A documentation of the XML document's structure

  3. A sharable description of an XML Document (something to design toward)

USE a DTD to specify content (only one DTD per document)

To identify a DTD you need to specify a

<!DOCTYPE

You can have an internal, external or mixed reference (both)

Syntax for DTD:

Internal Reference : <!DOCTYPE RootElement [

<!ELEMENT name category> ... ]>

External Reference : <!DOCTYPE RootElement SYSTEM "filelocation">

<!ELEMENT name category> for defining Elements

<!ATTLIST element-name attribute-name attribute-type default-value > for defining Attributes of Elements

Element will appear only once!
+ Element will appear one or more times!
<!ELEMENT element-name (child-name)>
<!ELEMENT element-name (child-name+)>
* Element will appear 0 or more times!
<!ELEMENT element-name (child-name*)>
, Elements must appear in the identified order
<!ELEMENT element-name (child-name1, child-name2, child-name3)>
| Elements can appear in any order
<!ELEMENT element-name (child-name1 | child-name2 | child-name3)>

 

<![CDATA[ reference a script or <img src='foo.gif'> ]]> Sample of Character data and including a reference to a link

Review the following:

Class XML will be used for this demonstration. Create a DTD for this example!

Check http://www.w3schools.com for more examples of DTD

Terms you need to Lookup:

XML, DTD & Validation

Homework:

You should have an XML & HTML version of your resume!

 

 

Final Step:

Review in your mind everything we covered in class and remember to cover it again before you go to bed so your mind to process this information while you sleep.