defining new character entities

Oxygen general issues.
mordenti
Posts: 1
Joined: Mon Oct 22, 2012 1:42 am

defining new character entities

Post by mordenti »

Hallo,
I'm encodying a manuscript transcription basing my docs on TEI DTD. I need to implement the list of character entities with new ones, so that the user could select one from the entities' panels (where signs like minus than <, etc., appear) avoiding to remember all entities' names.
Is it possible to do it? I cannot find any suggesion in help panels about this topic.

Otherwise I find in TEI P5 DTD a dedicated markup, <g ref="entity_name">caharcter</g>, but it seems again that it is not possibile to get help in inserting attribute "ref" values, although these names are defined like id values of another element over in the same documents.

Thanks for any help
Ilaria Bonincontro
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Re: defining new character entities

Post by sorin_ristache »

Hello Ilaria,

You can follow the example of the entities in the TEI DTD which comes with Oxygen, for example the entity definitions from the file:

Code: Select all

[Oxygen-install-dir]/frameworks/tei/xml/teip4/schema/dtd/iso-lat1.ent
Instead of creating new .ent files you could add your entity definitions to the existing .ent files. For example in the iso-lat1.ent file with the above path you add a new entity called ILARIA at the beginning of the file as follows:

Code: Select all

<!ENTITY ILARIA	"text_of_new_ILARIA_entity">
<!ENTITY aacute "&#x00E1;"> <!-- LATIN SMALL LETTER A WITH ACUTE -->
<!ENTITY Aacute "&#x00C1;"> <!-- LATIN CAPITAL LETTER A WITH ACUTE -->
<!ENTITY acirc "&#x00E2;"> <!-- LATIN SMALL LETTER A WITH CIRCUMFLEX -->
After you saved the edited file (in this example [Oxygen-install-dir]/frameworks/tei/xml/teip4/schema/dtd/iso-lat1.ent), you create a new TEI P4 document by going to menu File -> New (or pressing the first icon from the left on the toolbar, also called New), typing tei in the text box from the New dialog box and selecting TEI P4 Document from the filtered list of file templates. The new TEI P4 document starts with:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE TEI.2 PUBLIC "-//TEI P4//DTD Main Document Type//EN" "http://www.tei-c.org/Guidelines/DTD/tei2.dtd" [
<!ENTITY % TEI.prose 'INCLUDE'>
<!ENTITY % TEI.linking 'INCLUDE'>
<!ENTITY % TEI.figures 'INCLUDE'>
<!ENTITY % TEI.analysis 'INCLUDE'>
<!ENTITY % TEI.XML 'INCLUDE'>
<!ENTITY % ISOlat1 SYSTEM 'http://www.tei-c.org/Entity_Sets/Unicode/iso-lat1.ent'>
%ISOlat1;
<!ENTITY % ISOlat2 SYSTEM 'http://www.tei-c.org/Entity_Sets/Unicode/iso-lat2.ent'>
%ISOlat2;
<!ENTITY % ISOnum SYSTEM 'http://www.tei-c.org/Entity_Sets/Unicode/iso-num.ent'>
%ISOnum;
<!ENTITY % ISOpub SYSTEM 'http://www.tei-c.org/Entity_Sets/Unicode/iso-pub.ent'>
%ISOpub;
]>
If you look in the Entities view you can see the ILARIA entity in the Name column. You may need to sort the Entities table by clicking on the Name column header if you cannot locate the entity quickly in the long list of all TEI entities. If the Entities view is not visible you can make it visible by going to menu Window -> Show View -> Entities.

This is possible because Oxygen maps the URL of the original file that is declared in this XML file (that is http://www.tei-c.org/Entity_Sets/Unicode/iso-lat1.ent) to the local file that comes with Oxygen (that is the file modified earlier: [Oxygen-install-dir]/frameworks/tei/xml/teip4/schema/dtd/iso-lat1.ent), and uses the local file instead of the remote one through the TEI XML catalog for faster operation (that is the file [Oxygen-install-dir]/frameworks/tei/catalog.xml).

A quick method for opening the entities file: place the cursor inside the file path http://www.tei-c.org/Entity_Sets/Unicode/iso-lat1.ent inside the DOCTYPE declaration in the new TEI XML document that you just created, and press Ctrl+Enter (or right-click and select Open -> Open File at Caret from the contextual menu). Oxygen will open automatically the file that you just saved earlier, that is the file [Oxygen-install-dir]/frameworks/tei/xml/teip4/schema/dtd/iso-lat1.ent file. This is possible due to the mapping created by the XML catalog file [Oxygen-install-dir]/frameworks/tei/catalog.xml.


Regards,
Sorin
Post Reply