Home
Description
Publications

Available Resources
Text Acknowledgements
Related links


Events


CLaRK System

CLaRK System Online Manual


Bulgarian dialects'
electronic archive




 

 

 

 

 

 

 

title.gif (18679 bytes)

CLaRK System Online User Manual



Menu DTD

Compile DTD

A shortcut Ctrl+L

By choosing this item, the user compiles a DTD (Document Type Definition). First a standard file chooser appears. The user is expected to point out to the file where the DTD is stored. The system supports three kinds of character encodings: ASCII, Unicode UTF-16BE, Unicode UTF-16LE (Microsoft version of UTF-16).

In case an input file has been chosen, the parsing begins. If the DOCTYPE element is not declared, the user has to choose the root element.

Doctypechoise.gif (5014 bytes)

If an error occurs during compiling (parsing) the DTD, a notifying error message appears.

Dtderror.gif (5049 bytes)

If everything is correct, there appears a message for a successful compilation. The name of the DTD is the name of the root elemen (the DOCTYPE). The DTD is added to the list of all DTDs known to the system. If in the system there already exists a compiled DTD with the same name, then an additional index is appended to the end of the new DTD name.

Remove DTD

By choosing this item, the user can remove a DTD from the list of all DTDs known to the system.

DTDremove.gif (5977 bytes)

If in the system there are not saved documents referring to this DTD, there comes a message for a successful removing. Otherwise, an error message appears. It warns the user that the removal operation cannot be done.

removeImposible.gif (4585 bytes)

Pressing the button Details the user can see the documents, which rely on the selected DTD. These documents do not allow the DTD removal. The two possible solutions to this problem are as follows: either the DTDs for all these documents are changed, or the documents themselves are removed.

DTDreference.gif (3781 bytes)

In this way no documents will refer to the DTD in question and hence, the removal will be successful.

View DTD

This is an information dialog, showing the content of a DTD (Document Type Declaration) already compiled in the system. (For more information about DTDs, see http://www.w3.org/TR/1998/REC-xml-19980210#dt-valid).

The information data is divided into 4 sections representing different parts of the DTDs(structure data, attributes data, entities data and processing-instructions data). These four parts are contained in a tabbed pane and, by clicking on each tab, the user can switch them.

The viewer is demonstrated by the following simple example of a DTD:

<!DOCTYPE books [
<!ELEMENT books (book)*>
<!ELEMENT authors (author)+>
<!ELEMENT book (#PCDATA, title, authors, publisher, (pages)?, isbn, (price)+)>
<!ELEMENT title (#PCDATA)>
<!ELEMENT author (#PCDATA)>
<!ELEMENT publisher (#PCDATA)>
<!ELEMENT pages (#PCDATA)>
<!ELEMENT isbn (#PCDATA)>
<!ELEMENT price (#PCDATA)>
<!ATTLIST price
  currency
CDATA #REQUIRED
  prev CDATA #IMPLIED
  id CDATA #IMPLIED
  n CDATA #IMPLIED
  lang CDATA #IMPLIED>
<?CLaRK member(Gram,AllAn,[;]) ?>
]>

Structure data section:

DTDView1.gif (546054 bytes)

The structure, defined by the DTD, is represented as a table (see above). Each table row contains structural data for one element. The name of the element is in the first cell. The second cell contains the definition of the element as a regular expression. The rows are sorted by lexicographical order of the element names.

Note: #PCDATA means a plain text string, excluding symbols like '<','>'.

In the picture above, the definition of author element says that it must contain only text data(not other elements). The book element structure must be: text data, title element, authors element, publisher element, pages element(not obligatory), isbn element, price element(one or more). The ordering is important.

When the declaration of an element is too long or rather complicated, sometimes it is helpful for the user to see the declaration separately from the other element declarations. It becomes possible by clicking with the right mouse button on the row of the desired element and then pressing the View button, when it appears.

Element attributes data section:

DTDView2.gif

In order to see the attributes of a given element, the user has to choose the element from the drop-down menu at the top of the window. This menu contains all elements declared in the DTD. If after choosing an element nothing appears in the table, it means that there are no attributes declared for this element. Each time an element is chosen, the content of the table is updated. In the picture above, the element price has been chosen and the table contains its attributes according to the DTD.

Each row represents one element's attribute only. The name of the attribute is in the first column. The type of the attribute's value is in the second one. The third one contains meta-information about the attribute (required, implied, fixed, ...).

 

Entities data section:

picture

This section gives information about the entities defined in the DTD. Entities can be used as escape alternatives for symbols, which are not allowed in the text. In the picture above, there is an entity lt which will substitute the symbol '<' in the text. Otherwise the XML parser will decide that a new tag is starting when it meets the symbol '<' in the text and if it is not the case then the further processing fails. Therefore, in this case the symbol '<' has to be substituted by &lt; being interpreted as the symbol '<' but not as a starting point of a tag. The format of an entity is: &xxx;, where xxx is the name of the entity. All entity names appear in the first column of the table above. Opposite each entity name stands its corresponding text string (the text which will be substituted by the entity).

Processing-instructions section:

DTDView4.gif

The processing-instructions contain more information about the text processor than about the text content itself. It is so, because the processors should know how to interpret the instructions.

Save DTD Database

It saves the system information about DTDs, DTD layout, constraints, features (Element and Attribute), tokenizers and filters. Thus when the user starts the system again, she/he has at disposal all the things, which have already been added within the system. It is recommended that this function was executed every time, when the DTDs or the related things are changed.

Edit DTD layout

By editing the DTD layout, the user can change the way, in which a document, loaded in the system, will appear on the screen. This facility includes the following: moving to a new line before/after opening/closing tag, hiding some tags and/or their con

After choosing a DTD, the following table appears:

The first column contains all tag names in the DTD. Each row represents the layout information for one tag. Here follows a description of the meaning of each column in the table:

  • Tags - All the tag names in the selected DTD;
  • Open tag start - whether the opening tag of the corresponding element to appear on a new line or not;
  • Open tag end - whether the first child node to appear on a new line(a new line after the opening tag) or not;
  • Close tag start - whether the closing tag of the corresponding element to appear on a new line or not;
  • Close tag end - whether a new line to be inserted after the closing tag or not;
  • Is tag visible - whether the tag to be visible on the screen or hidden;
  • Are children visible - whether the content of the tag to be visible or hidden;

The check box at the bottom of the window: "Use line offsets" supports more comprehensive visualization. It suggests an additional white space to be inserted in front of the tags. If chosen, this white space is assigned to each tag, wh

When a document is loaded, it obeys the layout, defined for its DTD. Note that later on this layout can be changed only for the current view.

Back to Contents