Next / Previous / Contents / Shipman's homepage

6.22. UniGroup.__init__()

Here are the relevant lines from charlist.rnc. Examples of group names: “"iso8879"”; “"xhtml1"”.

group = element group { attlist.group, set* }
attlist.group &= attribute name { text }
unidata.py
# - - -   U n i G r o u p . _ _ i n i t _ _

    def __init__(self, uniData, node):
        '''Constructor.
        '''
        #-- 1
        self.uniData = uniData
        self.name = node.attrib[NAME_A]

Next we call the constructor for Section 6.24, “class UniEntSet: One entity set” once for each child SET_N node, and store the results in self._setMap.

unidata.py
        #-- 2
        # [ self._setMap  :=  as invariant from SET_N children of node ]
        self._setMap = {}
        for setNode in node.findall(SET_N):
            uniEntSet = UniEntSet(setNode)
            self._setMap[uniEntSet.name] = uniEntSet