Version 0.7
Home
Help


Character Entities

SDValidator provides mechanisms for users to manage a collection of user-defined character entities, insert selected entities into a document, and view glyphs associated with character entities in a document.

Managing and Inserting Character Entities

Before an entity can be inserted into a document, it must be loaded from a character entity definition file and added to the list of character entities to insert. All of these tasks are handled in the Character Entity Manager which is accessed from the Edit menu: Edit | Manage Character Entities.... When the Character Entity Manager is first invoked, the user will see three empty list boxes: Files Loaded, Character Entities, and CharEnts to Insert. The Files Loaded box contains a list of the character entity definition files that have been loaded. The Character Entities box contains a list of the character entities that were defined in the character entity definition files. the CharEnts to Insert box contains a list of character entities that are available for insertion into a document.

Click the Load button to see a list of the character entity definition files available for loading. These files are located in two places: <app-dir>/SDValidator/charents or <home-dir>/SDValidator/charents. After selecting one or more files, press the Select button to load the character entities defined in the respective files. The Files Loaded and Character Entities boxes will now be populated. There are two buttons between the Character Entites box and the CharEnts to Insert box. The button adds one or more selected items from the Character Entities box to the CharEnts to Insert box. The button adds all of the items in the Character Entities box to the CharEnts to Insert box. After character entities have been added to the CharEnts to Insert list, they are available for inserting into documents.

The lower toolbar contains three controls (two drop-down lists and a button) associated with character entity insertion. The first drop-down box contains a list of SDDTypes that have defined a character entity renderer. The renderer formats the character entity when it is inserted into a document. For example, the XML entity renderer will wrap the character entity with an ampersand and a semi-colon. The second drop-down box contains a list of character entities that are available for insertion. The button inserts the selected character entity into the document at the cursor position. The second drop-down box and the insert button are only active when the user is editting a text document.

Creating Character Entity Definition Files

Character entities are defined in xml files that are placed in either <app-dir>/SDValidator/charents or <home-dir>/SDValidator/charents. Each character entity can have up to three attributes. These are defined in the table below.

Character Entity Attributes
Attribute Required/Optional Description
value Required The value for the character entity that will be passed to the renderer for insertion.
displayName Optional The label to display in the Character Entities and CharEnts To Insert list boxes. If this attribute is not explicitly defined, it defaults to the value attribute.
graphicalDisplay Optional The hexadecimal unicode value for the glyph associated with the character entity. If defined, a graphical representation of the character entity will precede its label in the Character Entities and CharEnts To Insert list boxes. (See www.unicode.org for information on the Unicode standard.

SDValidator comes with two character entity definition files: latindiacrits.xml and greekdiacrits.xml. An sdd for validating character entity definition files is located in <app-dir>/SDValidator/sdds. An excerpt from the latindiacrits.xml file appears below:

<?xml version="1.0"?>
<!-- Selection of Latin diacrits and Symbols -->
<diacrits>
<diacritdef value="amp" graphicalDisplay="0026"/>

<diacritdef value="lt" graphicalDisplay="003C"/>
<diacritdef value="gt" graphicalDisplay="003E"/>

<diacritdef value="iexcl" graphicalDisplay="00A1"/>
<diacritdef value="cent" graphicalDisplay="00A2"/>
<diacritdef value="pound" graphicalDisplay="00A3"/>
<diacritdef value="curren" graphicalDisplay="00A4"/>
<diacritdef value="yen" graphicalDisplay="00A5"/>
...

</diacrits>

Viewing Character Entity Glyphs

To view the glyph associated with a character entity, position the mouse cursor over the character entity and hold down the control key when clicking the left mouse button. A pop-up window will appear near the character entity. The duration of the tip display is one second by default. Users can configure the duration by going to Preferences | Settings... and selecting Help and Tips. There is a combo box for changing the tip duration. The pop-up will display one of three messages.

Message Description
Unable to find character entity. The application was unable to locate a character entity at the position the mouse was clicked in the document. In the case of XML, SGML, and HTML, make sure the cursor is somewhere between the leading ampersand (&) and trailing semi-colon (;).
Not listed among loaded character entities. A character entity was located but the application did not find it among the loaded character entities. See Managing and Inserting Character Entities for information on loading character entities.
¢ &cent; (sample) If the character entity is successfully discovered and is among the loaded character entities, the glyph for the character entity and its name will be displayed.