7.4. Declaring new entities

epcEdit allows you to create new entity declarations on the fly. Because the entity declaration must be stored in a markup declaration in the document prolog, this option is only available for valid XML and SGML documents. Well-formed XML documents do not contain a document prolog where a markup-declaration can be inserted, so no new entities can be declared in well-formed XML documents.

New entities are declared by using the entity wizard that guides you through the necessary steps.

7.4.1. The entity wizard

Declaring new entities with the entity wizard

  1. The introductionary screen of the entity wizard gives a short introduction and summarizes the purpose of the dialog.

  2. The second screen of the entity wizard allows you to enter the name of the new entity. epcEdit will verify that the entity name is not already in use before letting you proceed to the next screen of the entity wizard.

  3. After providing the name of the new entity, you will have to decide if you want to declare an internal or an external entity:

    Internal entities reside completely in your XML/SGML document while external entities are stored outside of your document.

    Tip: If you want to create a stand-alone XML document, you should not declare external entities.

  4. The following steps depend on the selection in the previous dialog. If you are declaring an internal entity, the following steps apply:

    1. If you declare a new internal entity for an XML document, you are restricted to text entities. CDATA, SDATA, and PI entities can only be declared in SGML documents.

      Please select the entity type by activating the appropriate option before clicking on the Next button.

    2. The following screen of the entity wizard lets you define the text of the internal entity. Please type the desired entity text into the entry field in the wizard dialog.

    This finishes the declaration of the internal entity. Clicking on the Next button will lead you to the final screen of the entity wizard in step 6.

  5. If you are declaring an external entity, the following steps apply:

    1. Because an external entity resides somewhere outside of your document, you have to provide a system and/or public identifier for the entity. The next screen of the entity wizard lets you enter a system identifier for the entity.

      If you are declaring a new entity in an XML document, you will have to provide the system identifier. If you are declaring a new entity in an SGML document, you can omit the system identifier and provide only the public identifier for the entity in the next screen of the entity wizard.

      Please refer to System identifiers for notes on using system identifiers of you decide to provide a system identifier for the new entity.

    2. The following screen lets you enter a public identifier for the external entity. If you have provided a system identifier for the external entity in the previous screen of the entity wizard, you can skip the public identifier and continue with the next screen of the entity wizard by clicking on the Next button.

      Instead of typing the name of the public identifier, you can click on the Browse button to display a list of all public identifiers that were found in your catalog files.

      Note: It is not possible to omit both public and system identifiers when declaring an external entity.

    3. In the next screen of the entity wizard, you have to decide on the type of the external entity.

      In XML documents, only NDATA or Text entities are allowed. In SGML documents, you may declare external CDATA and SDATA entities, too. Please select the appropriate entity type by choosing one of the options in this screen before clicking on the Next button.

      The next screen of the entity wizard depends on the type of the external entity. If you are declaring an external text entity, no additional information is required and the the Next button will lead you to the final screen of the entity wizard in step 6

    4. If you have declared an external entity that is not a text entity, it is required to provide the notation of the external entity. The available notations are defined in the DTD or in the prolog of your document.

      In this screen of the entity wizard, you will have to select the appropriate notation for your external entity by choosing one of the entries from the drop-down list.

      The notation of an external entity provides information about the type of content that is found in the external entity. XML/SGML applications use this information to decide how the content of the external entity is to be processed. For example, epcEdit uses the notation of an external entity to determine if a reference to the entity should be displayed as an embedded image (see Notations).

      After selecting the appropriate notation, please click on the Next button to go to the final screen of the entity wizard.

  6. The final screen of the entity wizard informs you that a new entity has been created and that a declaration for this new entity has been stored in the prolog of your document.

    Click on the Finish button to dismiss the entity wizard. The new entity is now available and references to this entity can be used in your document.