def resolveEntity(self, publicId, systemId): self._logger.info("Method call: resolveEntity") print("resolveEntity: ", publicId, ", ", systemId) if systemId: resolver = EntityResolver() return resolver.resolveEntity(self, systemId) elif publicId: resolver = EntityResolver() return resolver.resolveEntity(self, publicId)
def resolveEntity(self, publicId, systemId): if systemId: name = os.path.join(self._path, systemId) if os.path.isfile(name): source = InputSource() source.setByteStream(open(name, "rb")) return source # Using default resolution return EntityResolver.resolveEntity(self, publicId, systemId)
def resolveEntity(self, publicId, systemId): "This will be called with None, None if it is an unknown entity" if systemId or publicId: return EntityResolver.resolveEntity(self,publicId,systemId) # return an empty stringio in which the parser can never find # the entities. This will make it skip the entity, which triggers # skippedEntity in the contenthandler. return StringIO.StringIO(" ") # if you delete that single space you will be sorry.
def resolveEntity(self, publicId, systemId): if systemId: name = os.path.join(self._path, systemId) if os.path.isfile(name): source = InputSource() source.setByteStream(open(name, "rb")) return source # Using default resolution return EntityResolver.resolveEntity(self, publicId, systemId)
def resolveEntity(self, publicId, systemId): "This will be called with None, None if it is an unknown entity" if systemId or publicId: return EntityResolver.resolveEntity( self, publicId, systemId) # return an empty stringio in which the parser can never find # the entities. This will make it skip the entity, which triggers # skippedEntity in the contenthandler. return StringIO.StringIO( " ") # if you delete that single space you will be sorry.
def resolveEntity(self, publicID, systemID): from os.path import join if self.localPath: systemID = join(self.localPath, self.pattern.sub('', systemID)) return EntityResolver.resolveEntity(self, publicID, systemID)