def replaceEntities(self, s):
    s = s.group(1)
    if (s[0] == '#'):
        return self.charref(s[1:])
    else:
        return self.entityref(s)
def replaceEntities(self, s):
    s = s.group(1)
    if (s[0] == '#'):
        return self.charref(s[1:])
    else:
        return self.entityref(s)