This is what the ODD system is for.

Your system should process the ODD declarations which define the TEI 
customization in question. This will contain a great deal of information 
about the classes concerned, the canonical names, etc. for all the 
elements in question. Not to mention internationalization!

ODD is an XML format (indeed, a TEI one: see the section of the 
Guidelines confusingly called "tag documentation"), so you can write 
your java classes to do this in the same way as they currently handle 
TEI documents.

  Sylvain Loiseau wrote:

> Hello,
> I write an application using TEI vocabularies. I would like to be able to handle
> any document written in TEI, and to allow the user, for instance, to tell the
> program that in his document "TEI" is renammed as "foo", as the customization
> mechanisms allow him, or to tell that the members of class x is extended whith
> elements y and z.
> A nice way to do it is perphaps to expect a TEI configuration file to be
> provided by the user. Whith this file, if I understand correctly, it is able to
> retreive the name used for the "TEI" element using this configuration file, the
> final code looking for instance (in java) :
>     String localName = customizationFile.getCustomizedNameOfElement("TEI");
> with the customizatonFile being an instance of a class able to scan the
> configuration file and retreive the definition.
> Does something like this already exists ? Or do you thing it may be done ?
> Best regards,
> Sylvain