next up previous
Next: Parameters Conventions Up: API Conventions Previous: API Conventions

Naming Conventions

All API function names start with the string gdome_ (identifying the Gdome2 library namespace) followed by an abbreviated prefix indicating the DOM interface the method refers to. In figure 1 we give the complete correspondence between the DOM Interfaces and the Gdome2 prefixes.

Figure 1: DOM Interfaces and corresponding Gdome2 prefixes
DOM Interface Gdome2 Interface Prefix
DOMImplementation DOMImplementation_
DocumentFragment df_
Document doc_
Node n_
NodeList nl_
NamedNodeMap nnm_
CharacterData cd_
Attr a_
ELement el_
Text t_
Comment c_
CDATASection cds_
DocumentType dt_
Notation not_
Entity ent_
EntityReference er_
ProcessingInstruction pi_

Then, the syntax changes depending on the kind of method or attribute access implemented by the function. Explicit methods are provided for reading and writing attribute values (write access to read-only attributes is simply prevented by the lack of the corresponding writing method). The syntax of Gdome2 API functions is summarized in a more formal way in figure 2, where DOMMethodName and DOMAttrName are place-holders for the name of, respectively, interface methods and interface attributes in the DOM specification.

Figure 2: Gdome2 method naming conventions
Gdome2Method  ::=  gdome_  InterfacePrefix  DOMMethodName
Gdome2SetAttr  ::=  gdome_  InterfacePrefix  set_  DOMAttrName
Gdome2GetAttr  ::=  gdome_  InterfacePrefix  DOMAttrName



Paolo Casarini 2001-04-01