def getDTDEntity(self, v): v = v.replace('"', '"') ctx = Parser.Context('<!ENTITY foo "%s">' % v) return Entity(ctx, lambda s: s, '', (0, len(v) + 16), (), (), (9, 12), (14, len(v) + 14), ())
def getDTDEntity(self, v): if isinstance(v, six.binary_type): v = v.decode('utf-8') v = v.replace('"', '"') ctx = Parser.Context('<!ENTITY foo "%s">' % v) return DTDEntity(ctx, None, None, (0, len(v) + 16), (9, 12), (14, len(v) + 14))
def getNext(self, v): ctx = Parser.Context(v) return DTDEntity(ctx, '', (0, len(v)), (), (0, len(v)))
def getEntity(self, v): ctx = Parser.Context(v) return Entity(ctx, lambda s: s, '', (0, len(v)), (), (), (), (0, len(v)), ())