Assignments XML.1

Handing In Assignments

You must hand in by using git

Hand In by git

  • Create an empty repo on bitbucket.org, gitlab.com, or github.com,
  • git push your local repo to the above remote repo.
  • For node assignments please put the line(s)

    node_modules/

    into your .gitignore file.

Send a mail to with:

  • The word 'handin <subjectname>' in the subject line of your mail
  • The url of your repo(s).

Assignment XML.1.0

Download and study http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd , the XHTML DTD.

Answer the following questions:

  1. Must input elements be inside forms?
  2. Find and name the EMPTY elements.
  3. May a table be empty? May a tr?
  4. What are the possible attributes of a h2?

Assignment XML.1.1

Study the following xml-document

Example 40.13. booksCanon.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE booksCanon SYSTEM "booksCanon1.dtd">
<booksCanon>
  <book ref="Llo08" mycanon="mdu,all">
    <title>Learn How to Build Web Sites the Right Way from Scratch</title>
    <edition>2</edition>
    <authors>
      <author>
        <firstname>Ian</firstname>
        <lastname>Lloyd</lastname>
      </author>
    </authors>
    <publisher>
      <name>SitePoint</name>
      <year>2008</year>
      <place>Collingwood, VIC, Australia</place>
    </publisher>
    <pages>300</pages>
    <isbn></isbn>
    <price>9.73</price>
    <currency>EU&#8364;</currency>
    <comments>
      <comment>1. sem: Chapters 1-7</comment>
    </comments>
  </book>
  
  <book ref="Shu08" mycanon="mdu">
    <title>Learning ActionScript 3.0</title>
    <edition>2</edition>
    <authors>
      <author>
        <firstname>Rich</firstname>
        <lastname>Shupe</lastname>
      </author>
      <author>
        <firstname>Zevan</firstname>
        <lastname>Rosser</lastname>
      </author>
    </authors>
    <publisher>
      <name>O'Reilly</name>
      <year>2008</year>
      <place>Sebastopol, CA, USA</place>
    </publisher>
    <pages>384</pages>
    <isbn>978-0596527877</isbn>
    <price>8.73</price>
    <currency>US$</currency>
    <comments>
      <comment>1. sem: Chapters 1-7</comment>
    </comments>
  </book>
  
  <book ref="Nix09" mycanon="mdu">
    <title>Learning PHP, MySQL, and JavaScript</title>
    <edition>2</edition>
    <authors>
      <author>
        <firstname>Robin</firstname>
        <lastname>Nixon</lastname>
      </author>
    </authors>
    <publisher>
      <name>O'Reilly</name>
      <year>2009</year>
      <place>Sebastopol, CA, USA</place>
    </publisher>
    <pages>120</pages>
    <isbn></isbn>
    <price></price>
    <currency></currency>
    <comments>
      <comment>2. sem: Chapters 1-7, 11, 14-17</comment>
      <comment>3. sem: Chapters 8-10</comment>
    </comments>
  </book>

  <book ref="For04" mycanon="mdu,all">
    <title>SQL in 10 Minutes</title>
    <edition>3</edition>
    <authors>
      <author>
        <firstname>Ben</firstname>
        <lastname>Forta</lastname>
      </author>
    </authors>
    <publisher>
      <name>Sams Publishing</name>
      <year>2004</year>
      <place>Indianapolis, IN, USA</place>
    </publisher>
    <pages></pages>
    <isbn></isbn>
    <price>120</price>
    <currency></currency>
    <comments>
      <comment>3. sem: Chapters 1-17</comment>
    </comments>
  </book>
  
</booksCanon>

Create a DTD for the booksCanon.xml, Name it booksCanon.dtd. Validate booksCanon.xml against the dtd.

Assignment XML.1.2

Create an XML Schema for the booksCanon.xml, Name it booksCanon.xsd. Validate booksCanon.xml against the schema.

Assignment XML.1.3

In Example 40.1 you have a number of DTD examples. Write a corresponding number of (small) XML files that conform to these rules. Validate all of them.