A parser for XML, using the derived class as static DTD.
|
|
version = '0.3'
|
|
|
_S = '[ \t\r\n]+'
|
|
|
_opS = '[ \t\r\n]*'
|
|
|
_Name = '[a-zA-Z_:][-a-zA-Z0-9._:]*'
|
|
|
_QStr = '(?:\'[^\']*\'|"[^"]*")'
|
|
|
illegal = re.compile(r'[^\t\r\n -~\xa0-\xff]')
|
|
|
interesting = re.compile(r'[\]&<]')
|
|
|
amp = re.compile(r'&')
|
|
|
ref = re.compile(r'&([a-zA-Z_:][-a-zA-Z0-9\._:]*|#[0-9]+|#x[0-...
|
|
|
entityref = re.compile(r'&(?P<name>[a-zA-Z_:][-a-zA-Z0-9\._:]*...
|
|
|
charref = re.compile(r'&#(?P<char>[0-9]+[^0-9]|x[0-9a-fA-F]+[^...
|
|
|
space = re.compile(r'[ \t\r\n]+$')
|
|
|
newline = re.compile(r'\n')
|
|
|
attrfind = re.compile(r'[ \t\r\n]+(?P<name>[a-zA-Z_:][-a-zA-Z0...
|
|
|
starttagopen = re.compile(r'<[a-zA-Z_:][-a-zA-Z0-9\._:]*')
|
|
|
starttagend = re.compile(r'[ \t\r\n]*(?P<slash>/?)>')
|
|
|
starttagmatch = re.compile(r'<(?P<tagname>[a-zA-Z_:][-a-zA-Z0-...
|
|
|
endtagopen = re.compile(r'</')
|
|
|
endbracket = re.compile(r'[ \t\r\n]*>')
|
|
|
endbracketfind = re.compile(r'(?:[^>\'"]|(?:\'[^\']*\'|"[^"]*"...
|
|
|
tagfind = re.compile(r'[a-zA-Z_:][-a-zA-Z0-9\._:]*')
|
|
|
cdataopen = re.compile(r'<!\[CDATA\[')
|
|
|
cdataclose = re.compile(r'\]\]>')
|
|
|
_SystemLiteral = '(?P<%s>(?:\'[^\']*\'|"[^"]*"))'
|
|
|
_PublicLiteral = '(?P<%s>"[-\'\\(\\)+,./:=?;!*#@$_%% \n\ra-zA-...
|
|
|
_ExternalId = '(?:SYSTEM|PUBLIC[ \t\r\n]+(?P<pubid>"[-\'\\(\\)...
|
|
|
doctype = re.compile(r'<!DOCTYPE[ \t\r\n]+(?P<name>[a-zA-Z_:][...
|
|
|
xmldecl = re.compile(r'<\?xml[ \t\r\n]+version[ \t\r\n]*=[ \t\...
|
|
|
procopen = re.compile(r'<\?(?P<proc>[a-zA-Z_:][-a-zA-Z0-9\._:]...
|
|
|
procclose = re.compile(r'[ \t\r\n]*\?>')
|
|
|
commentopen = re.compile(r'<!--')
|
|
|
commentclose = re.compile(r'-->')
|
|
|
doubledash = re.compile(r'--')
|
|
|
attrtrans = '\x00\x01\x02\x03\x04\x05\x06\x07\x08 \x0b\x0c \x...
|
|
|
_NCName = '[a-zA-Z_][-a-zA-Z0-9._]*'
|
|
|
ncname = re.compile(r'[a-zA-Z_][-a-zA-Z0-9\._]*$')
|
|
|
qname = re.compile(r'(?:(?P<prefix>[a-zA-Z_][-a-zA-Z0-9\._]*):...
|
|
|
xmlns = re.compile(r'xmlns(?::(?P<ncname>[a-zA-Z_][-a-zA-Z0-9\...
|
|
|
__warningregistry__ = {('The xmllib module is obsolete. Use x...
|