import xmlproc
class EntityParser def __init__(self) string __module__ = 'xmlproc' def feed(self,new_data) def find_reg(self,regexp) def get_current_sysid(self) def get_index(self,target) def get_match(self,regexp) def get_pos(self) def get_region(self) def get_wrapped_match(self,wraps) def now_at(self,test_str) def open_entity(self,sysID) def parseEnd(self) def parseStart(self) def parse_resource(self,sysID) def pop_entity(self) def push_entity(self,sysID,contents) def read_from(self,fileobj,bufsize=16384) def scan_to(self,target) def set_application(self,app) def set_entity_handler(self,ent) def set_error_handler(self,err) def set_start_point(self) def set_sysid(self,sysID) def skip_ws(self) def test_reg(self,regexp) def test_str(self,test_str) def update_pos(self)
A generalized parser for XML entities, whether DTD, documents or even catalog files.
Accepts more data from the data source. This method must set self.datasize and correctly update self.pos and self.data.
Moves self.pos to the first character that matches the regexp.
Returns the sysid of the file we are reading now.
Finds the position where target starts and returns it.
Returns the result of matching the regexp and advances self.pos.
Returns a tuple (line,col).
Returns the area from start_point to current position and remove start_point.
Returns a contained match. Useful for regexps inside quotes.
Checks if we are at this string now, and if so skips over it.
Starts parsing a new entity, pushing the old onto the stack. This method must not be used to start parsing, use parse_resource for that.
Called when there are no more data to notify subclasses.
Called before the parse starts to notify subclasses.
Begin parsing an XML entity with the specified public and system identifiers (the system identifier, a URI, is required). Only used to start parsing, not to handle subentities, which open_entity takes care of.
Skips out of the current entity and back to the previous one.
Parse some text and consider it a new entity, making it possible to return to the original entity later.
Reads data from a file-like object until EOF. Does not close it. WARNING: This method does not call the parseStart/parseEnd methods, since it does not know if it may be called several times. Use parse_resource if you just want to read a file.
Moves self.pos to beyond target and returns skipped text.
Sets the object to send data events to.
Sets the object that resolves entity references.
Sets the object to send error events to.
Stores the current position and tells the parser not to forget any of the data beyond this point until get_region is called.
Sets the current system identifier. Does not store the old one.
Skips over any whitespace at this point.
Checks if we match the regexp.
See if text at current position matches test_str, without moving.
Updates (line,col)-pos by checking processed blocks.