Explanation to solutions by Tor Jarle Sagen Part 1 - ItuBlog.dtd My solution: The DTD was pretty straightforward without too many difficulties. The only unclear points where the date and the author elements. Date is defined as an empty element with attributes and as an element with a child-element date (without the namespace prefix). I have solved this by defining that the blog:date element can contain the date element one or zero times and by making the attributes #IMPLIED (not mandatory). The author-element contains the child-elements name and email, but in the reply section the author-element contains only text. I have solved this by defining blog:author as a mixed content model with text (PCDATA) and that the elements name and email can be shown zero or several times. Part 2 - ItuBlog.xsd My solution: An XML Schema can use different design methods. I have in my solution used "named types". I have done this by naming the complexTypes, and then point to them through the type attribute of the elements. I think this design gives a better overview, particular with large xml documents. The definition of the blog:date element is done by using both for element and attribute. This way the definition works for all versions of the blog:date element, both the empty version and the version with a child element. Gives less control over the input, but solves the problem. Interesting differences to the DTD version: - In XML Schema we use XML syntax opposed to the DTD - The support for namespaces in XML Schema - In the XML Schema I use named types, which enables the reuse of element definitions. - In the XML Schema I use "any", something you can't do in DTD. Part 3 - ItuBlog.xpath Nothing to say about the XPath expressions. No difficulties or unclear points. Part 4 - ItuBlog.xquery The second query in the assignment where rather confusing. I have solved this by assuming that each entry-element should have an author child-element, while there actually is only one author-element for the complete blog and one for each reply.I have chosen to output the title of the entry written by authors that have also written replies. Part 5 - BlogGrep.java The program BlogGrep searches for occurrences of text strings (or parts of text strings) inside a text-element. If a search is successful the program outputs the element, including child-elements and text, where the string exists. I have solved these using two recursive methods. The first method (listChildren) finds the text-elements. As soon as a text element is found a call is made to the second method (process). The process-method compares the input text string with the text inside the text-element, and any child-element of the text-element. This process continues until all text-elements and descendants of the element are processed. Part 6 - Blog2XHTML.java The program Blog2XHTML outputs a XHTML version of the ItuBlog document. The program consists of two classes, Blog2XHTML and XHTMLConverter. Blog2XHTML contains the main-method and also takes care of the parsing of the document. XHTMLConverter responds to events (callbacks) from the parser and puts out Valid XHTML syntax to the screen. I have not put in the mandatory DOCTYPE declaration in the XHTML output. This could have been done easy by printing the declaration to the screen through the startDocument method.