Available Resources
Text Acknowledgements
Related links


CLaRK System

CLaRK System Online Manual

Bulgarian dialects'
electronic archive

eXTReMe Tracker








Menu Document

Change DTD

It changes the DTD of the current document. One can choose between all DTDs, that have already been compiled into the system. When a new DTD is selected, it is assigned to the current document. Now the document is validated with respect to this new DTD and its layout is updated according to the DTD's layout. If the document contains default attributes, whose default values are unchanged, i.e. still obey the old DTD, then these attributes are removed.


It changes the DOCTYPE (root element) of the current document. One can choose between all elements from the current document's DTD. The document is validated after the change.


An icon on the toolbar

An XML document is valid if it has an associated document type declaration and if the document compiles with the constraints expressed in it.

The DTD consists of

  • element definitions
    • name declaration
    • regular expression that defines the content of the element (constraints)
  • attribute definitions

For more information see http://www.w3.org/TR/REC-xml

Validation Error Messages

These are various messages, which appear after applying the validation procedure to a document. All of them mean that the document is not valid and at the same time each of them gives a prompt about the error source.

  • Misplaced Element Error Messages
    • Element "element" not allowed as a child at that position for element "parent

      This error message is given when some element cannot be placed in a certain position among the child nodes of another element.
      Example :

      In the DTD:
      <!ELEMENT books book+>
      In the document:

  • Undefined Element Error Messages
    • #REQUIRED attributes missing! (list_of_REQUIRED_attr) or Required attribute "attr_name" for element "element" is missing!

      The message is given when an element does not contain a #REQUIRED attribute.

    • Element "element" has no attribute named "attr_name" !

      The message is given when an element is assigned an attribute, which was not declared for the element's type in the DTD.

    • Element "element" not found! or Element "element" is not declared!

      The element is not declared in the DTD.

  • Other Element Error Messages
    • Content not finished checking type "element" !

      This message is given when the element requires more children to complete its content.

      In the DTD:
      <!ELEMENT book title, author+, publisher>
      In the document:
      <title>Alice in Wonderland</title>
      <author>Luis Carol</author>

    • Element "element" must be EMPTY!

      The element is declared in the DTD as an element with empty content, but in the document it is used with non-empty content.

    • Root must be "root_name" !

      This message is shown when the document element is different from the DOCTYPE of the DTD (or the DOCTYPE, which was selected after the DTD compilation)

      Example :

      In the DTD:
      <!DOCTYPE books [ ….

      In the beginning of the document:
      <library> ….

  • ID & IDRef Attribute Error Messages
    • Bad ID reference - "id_ref" - for attribute "attr_name" !

      The attribute is of type IDREF, but contains a value that cannot be an ID.

    • Bad ID - "id" - for attribute "attr_name" !

      The attribute is of type ID, but contains a value that cannot be an ID.
      Example :

      …<book id=”123 456”>…

    • Duplicate ID for attribute "attr_name" !

      There are two or more elements which have attributes of type ID with the same value.

    • ID "attr_val" for attribute "attr_name" not found !

      There is an attribute of type IDREF (or IDREFS), but the id (ids), which it refers to, is (are) not found in the document.

  • Others Attribute Error Messages
    • Attribute "attr_name" has a FIXed default value - "def_value", not "wrong_value !

      The message is given when an attribute tries to change its FIXED value in the DTD.

    • Attribute "attr_name" must contain only one token - "attr_value" !

      The attribute is of type NMTOKEN, but contains more than one token.

    • Entity "entity" not declared (in attribute "attr_name") !

      The attribute is of type ENTITY or ENTITIES, but it contains value (values) that is (are) not declared in the DTD.

    • Value "attr_value" of attribute "attr_name" must be among (list_of_values)!

      The attribute has a value, which is not possible for it.
      Example :

      In the DTD:
      <!ATTLIST author 
      title ( Mr. | Ms. | Miss. ) #IMPLIED >
      In the document
      …<author title = ”Dr.”>…

  • All Children Constraint Messages

Apply All Children

This option applies all active Value constraints of type All Children on the current document in the system editor. For more details about the definition and usage of the Value Constraints see the following link.

Having selected this option, the user is shown information about the number of nodes in the current document which do not satisfy the constraints. The user is given the possibility to navigate through all invalid nodes one by one, by using the Next/Previous buttons on the toolbar in the same way as if an XPath search is performed.

Because of the arbitrary complexity of the constraints the information about the invalid nodes is not updated dynamically, which means that some of the nodes might have changed their validity status. Therefore, the Apply operation must be performed manually in order the node information to be updated.

New View

It opens a new view for the current document. This new view is presented in a new window with the text layout. The new view is synchronized with the other views of the same document. For example, when a node is selected in one view, it is automatically selected in the others. All changes made in one of the views are immediately updated in the others. The only thing which remains independent for each view is the layout. When a view is opened, it takes its initial text layout from the DTD and color Scheme - if there is a selected one. This layout can be modified later. For more details about editing view's layout see Edit Current Text Layout.

Edit Current Text Layout

An icon on the toolbar

Edit current text layout item allows for editing of the layout for each element in a DTD. For each tag (opening or closing) additional new lines can be attached before and after the tag. In this way the text view gets improved. The tag and its children can be visible or invisible. It means that the user can hide the information he/she is not interested in. The layout is set only for the current view of the document. After closing the view, all the information about the layout is lost. If the user wants to save the layout, this can be done in two ways :

For more information about the layout table, see Edit Text Layout in menu DTD.

Save Current Layout for DTD

Sets the text layout of the current document view as a Text Layout for the current document's DTD.

Reload DTD Text Layout

Restores the text layout of the current document view according to the Text Layout for the corresponding DTD.

Add Default Attributes

This item adds default attributes(if defined) to every element in the current document. The default attributes of each element in the document, which were defined in the DTD, are stored in a list. If the element has an attribute, which is not a member of this list, then this attribute is added to the list together with its default value. After applying this operation, the system shows how many new attributes have been added to the current document.

Remove Default Attributes

This item removes all default attributes, which possess unchanged default values in the current document. The procedure is as follows: First, all default attributes, which have been defined for the element, are taken from the DTD. Then, it is checked for the element in the document whether it has each of the attributes or not. If the answer is positive, then the attribute's value is compared with the default value for this attribute in the DTD. And if they are the same, the attribute is removed from the element in the document.
After applying this operation, the system shows how many attributes have been removed from the current document.

Load Index Data

This item is related with the document indexing feature for fast data searching. For details see menu item Definitions/Document Index.

Using this item requires a document opened in the system editor. If the current document has been indexed, the relevant index data is loaded. If errors occur, the user is notified by an error message. The main purpose of this option is to check in advance if the index data can be loaded successfully for ceratin document(s) before index search is used in any processing procedures. If a document is not indexed yet, or reindexing it is needed, the user has to use the Document Index manager - function Apply on document.

Synchronize with ...

This option enables establishing connections between the current document and referent documents selected in corresponding Sync Rules. For details how to define Sync Rules see menu item Definitions/Sync Rules.

Having selected this item, the following dialog window appears:

It contains a list of all Sync Rules defined in the system. Here the user selects the rules which will be used for establishing connections between the current document and the documents chosen in the corresponing rules. The rules selection can be done by selecting rows in column Assign followed by pressing button Assign Rules. A requirement here is all referent documents in the selected Sync Rules to be opened in the editor. If a required referent document is not loaded, the system shows warning messages. If a rule is assigned but its referent document is not loaded yet, the rule will start working immediately after the document is loaded.

Switch to Document

This option becomes relevant when more than one documents are opened in the system. There appears a window with the list of all the documents, that are currently opened.

By selecting an item from this list, the user can change the active document in the system. If the opened document in the system is exactly one, this operation is not applicable.