Ejemplo n.º 1
0
 def _add_element_attlist(self, element, xmlattribute, ident):
     try:
         attrmap = element.get_attribute("ATTRIBUTES")
         kwattrmap = element.get_attribute("KWATTRIBUTES")
     except KeyError:
         element.add_attribute("ATTRIBUTES", AttributeMap())
         element.add_attribute("KWATTRIBUTES", AttributeMap())
         attrmap = element.get_attribute("ATTRIBUTES")
         kwattrmap = element.get_attribute("KWATTRIBUTES")
     attrmap[xmlattribute.name] = ident
     keywordname = keyword_identifier(normalize_unicode(xmlattribute.name))
     kwattrmap[keywordname] = ident
Ejemplo n.º 2
0
 def _add_element_attlist(self, element, xmlattribute, ident):
     try:
         attrmap = element.get_attribute("ATTRIBUTES")
         kwattrmap = element.get_attribute("KWATTRIBUTES")
     except KeyError:
         element.add_attribute("ATTRIBUTES", AttributeMap())
         element.add_attribute("KWATTRIBUTES", AttributeMap())
         attrmap = element.get_attribute("ATTRIBUTES")
         kwattrmap = element.get_attribute("KWATTRIBUTES")
     attrmap[xmlattribute.name] = ident
     keywordname = keyword_identifier(normalize_unicode(xmlattribute.name))
     kwattrmap[keywordname] = ident
Ejemplo n.º 3
0
 def new_attribute(self, elem, a_name, a_type, a_decl, a_def):
     "Receives the declaration of a new attribute."
     attr = XMLAttribute(a_name, a_type, a_decl, a_def)
     ident = attr.get_identifier()
     self._allattributes[ident] = attr
     try:
         element = self.elements[elem]
     except KeyError:
         # Got a forward attribute definition (defined before element)
         try:
             fwdattribs, fwdkwattribs = self._forwardattributes[elem]
         except KeyError:
             fwdattribs = AttributeMap()
             fwdkwattribs = AttributeMap()
             self._forwardattributes[elem] = (fwdattribs, fwdkwattribs)
         fwdattribs[a_name] = ident
         keywordname = keyword_identifier(normalize_unicode(a_name))
         fwdkwattribs[keywordname] = ident
     else:
         self._add_element_attlist(element, attr, ident)
Ejemplo n.º 4
0
 def new_attribute(self, elem, a_name, a_type, a_decl, a_def):
     "Receives the declaration of a new attribute."
     attr = XMLAttribute(a_name, a_type, a_decl, a_def)
     ident = attr.get_identifier()
     self._allattributes[ident] = attr
     try:
         element = self.elements[elem]
     except KeyError:
         # Got a forward attribute definition (defined before element)
         try:
             fwdattribs, fwdkwattribs = self._forwardattributes[elem]
         except KeyError:
             fwdattribs = AttributeMap()
             fwdkwattribs = AttributeMap()
             self._forwardattributes[elem] = (fwdattribs, fwdkwattribs)
         fwdattribs[a_name] = ident
         keywordname = keyword_identifier(normalize_unicode(a_name))
         fwdkwattribs[keywordname] = ident
     else:
         self._add_element_attlist(element, attr, ident)
Ejemplo n.º 5
0
def get_identifier(uname):
    return identifier(normalize_unicode(uname))
Ejemplo n.º 6
0
 def new_general_entity(self, name, val):
     "Receives internal general entity declarations."
     self.general_entities[normalize_unicode(name)] = val
Ejemplo n.º 7
0
def get_identifier(uname):
    return identifier(normalize_unicode(uname))
Ejemplo n.º 8
0
 def new_general_entity(self, name, val):
     "Receives internal general entity declarations."
     self.general_entities[normalize_unicode(name)] = val