Chapter 1. Introduction

Xerlin (pronounced zer-lin) is an application for creating XML files. It runs on Java 2 virtual machines (JDK1.2.2 or JDK1.3). Xerlin simplifies how you interact with an XML file by hiding the raw text form of XML. It gives a user interface for adding, removing, and rearranging XML elements. It also gives a nice interface for editing the attributes of elements. Xerlin has been developed for end users who may not be familiar with XML, but it also provides a useful interface for people who know XML really well.

An example of what the Xerlin interface looks like is given in Figure 1.1

Figure 1.1. Xerlin Interface

A screenshot of the Xerlin XML interface

About XML

A full explanation of XML is beyond the scope of this document, however we will cover some of the basic XML concepts you will need to know in order to use Xerlin prodcutively. XML stands for eXtensible Markup Language. It is similar to HTML, HyperText Markup Language, except users can create their own tags to fit their application needs.

Elements, Attributes, and Content

The basic construct in XML is called an element. For people familiar with HTML, you might know this as a "tag". For example, HTML has an <img> element for putting graphics on a web page. Elements have a name, zero or more attributes, and possibly some content. In the raw text form of an XML document, elements start with a beginning tag of the element name enclosed within angle brackets (< >). XML elements must have a closing tag of angle brackets enclosing a slash and the element name. If the element has no content, this slash can be inserted at the end of the element's starting tag immediately preceeding the trailing angle bracket. An example of an element is given in Example 1.1

Example 1.1.

   <elementname attribute="value">content</elementname>
	  

Attributes are named values associated with an element. An example of an attribute is shown above in Example 1.1 The content of element can be other elements, text, or both. When an element has both text and other elements, it is known as "mixed content". Text content is also known as character data, PCDATA, or CDATA.

Xerlin supports most of these constructs of XML except CDATA. CDATA starts with <![CDATA[ and ends with ]]>. CDATA items are not currently supported as of Xerlin 1.2, but should be supported in a future release.

DTDs and Schemas

XML uses something called a Document Type Definition (DTD) to determine what elements are valid for an XML file, and what they can contain. A newer technology called XML Schema has been introduced to replace DTD's. However since this is such a new technology (it hasn't been finalized as of this writing), and the parser technologies Xerlin has been built on top of don't support it, Xerlin doesn't support Schemas in version 1.0.

To be able to add elements and create a valid XML document, Xerlin requires a DTD in order to work. There are many different DTDs available for different applications, and there are books and tutorials available on creating DTDs. Without a DTD, Xerlin cannot present it's menu of what elements can be added into the document. You can view and edit documents which don't have a DTD, but you will not be able to add anything new to them.

The DTD is specified in an XML document in a special element called the DOCTYPE. This document type declaration includes the name of the root element, an optional PUBLIC identifier, and a manditory SYSTEM identifier. Xerlin handles the DOCTYPE declaration and the identifiers behind the scenes for you. A future version may give you more access to edit these items directly.