import xmlproc
class DTDParser(AbstractXML) def __init__(self) string __module__ = 'xmlproc' def do_parse(self,final=0) def parse_attlist(self) def parse_comment(self) def parse_content_model(self) def parse_elem_type(self) def parse_entity(self) def parse_mixed_content_model(self) def parse_notation(self) def parse_pe_ref(self) def parse_pi(self) def set_dtd_consumer(self,dtd) def set_internal(self,yesno) # Methods inherited by DTDParser from AbstractXML def parse_string(self,org_val,allow_ext_ges,allow_pes) # Methods inherited by DTDParser from EntityParser 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)
Does the actual parsing.
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.
Parses an attribute list declaration.
Parses comments.
Parses the content model of an element type declaration.
Parses an element type declaration.
Parses an entity declaration.
Parses mixed content models. Ie: ones containing #PCDATA.
Parses a notation declaration.
Parses a reference to a parameter entity.
Parses a processing instruction from after the <? and beyond the ?>.
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.
Parses a string (attribute value, entity value) and resolves all entity references in it. allow_ext_ges specifies whether external general entity references are allowed. allow_pes specifies whether parameter entities are allowed at all.
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.
Tells the parser where to send DTD information.
Sets the object that resolves entity references.
Sets the object to send error events to.
Tells the parser whether the DTD is internal or external.
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.