Yliopiston etusivulle In English
Helsingin yliopisto
clt236: XML - lukuvuosi 2009-2010

Yhteystiedot

Yleisen kielitieteen laitos

14.8.2009 saakka:
PL 9 (Siltavuorenpenger 20 A)
00014 HELSINGIN YLIOPISTO

17.8.2009 alkaen:
PL 24 (Unioninkatu 40)
00014 HELSINGIN YLIOPISTO

Puhelin +358 (09) 1911 (vaihde)
Faksi +358 (09) 191 29307

2. Introduction to XML.

  • Lecture notes
  • Further reading
  • Practical work: installing Xerces XML plugin
    • We'll use jEdit to edit XML files and we'll use jEdit's XML plugin to parse and validate XML files. The XML plugin runs the Apache Software Foundation's open source Xerces-Java XML parser inside jEdit.
    • To install the XML plugin: Start jEdit and open Plugins -> Plugin Manager. In the Plugin Manager window, select the Install tab. In the Install tab, tick SideKick, XercesPlugin and XML, then click the Install button to install them.
    • Use jEdit's menus to open SideKick, XMLInsert and ErrorList. Using the docking options, dock SideKick and XMLInsert on the right, and ErrorList at the bottom.
  • Practical work: parsing XML
    • Copy the example XML file memory.xml to your Windows folder. Open it in jEdit. Use SideKick to view the document structure. Use SideKick's Parse button to check that it is syntactically well-formed.
    • Deliberate mistake 1.
      Edit memory.xml in jEdit by changing the first <memory> to <memoir>.
      Parse it again to check that it is now syntactically ill-formed.
    • Deliberate mistake 2.
      Edit the file further by also changing the first </memory> to </memoir>.
      Parse it again. Is it now well-formed or ill-formed?
  • Practical work: validating XML with a DTD
    • Copy memory.dtd and memory1.xml to your Windows folder.
      Open memory1.xml in jEdit and view the document structure in SideKick.
      Validate the file against the DTD by clicking the Parse button.
    • Edit memory1.xml to make deliberate mistake 1 (by changing the first <memory> to <memoir>) and validate it again.
    • Edit it further to make deliberate mistake 2 (by also changing the first </memory> to </memoir>). Is it now valid or invalid?
© 2001-2009 Graham Wilcock