Next / Previous / Contents / Shipman's homepage

6.31. UniEntity.__init__()

The constructor operates directly on the node of the unicode.xml file defined by these productions from charlist.rnc:

entity = element entity
{ attribute id { text },
  attribute set { text },
  desc?, comment?, xref? 
}

Here is an example.

         <entity id="Aacute" set="xhtml1-lat1">
            <desc>latin capital letter A with acute</desc>
         </entity>
unidata.py
# - - -   U n i E n t i t y . _ _ i n i t _ _

    def __init__(self, uniChar, node):
        '''Constructor.
        '''
        self.uniChar = uniChar
        self.id = node.attrib[ID_A]
        self.setName = node.attrib[SET_A]