-ķ
x=c       s¢     d  Z   	 d k Z d k Z d k Z d k Z  e i Z  e i Z  d k	 T d k
 T d k T d k T d Z  d Z  d e f d     YZ d S(   sµ   
The main module of the parser. All other modules will be imported into this
one, so this module is the only one one needs to import. For validating
parsing, import xmlval instead.
N(   s   *s   0.70s   $Revision: 1.25 $s   XMLProcessorc      sp   d  Z    d   Z ' d   Z , d   Z 0 d d  Z 7 d   Z < e d  Z A d   Z N d	   Z	 R d
   Z
  d   Z  d   Z  d   Z Ķ d   Z d   Z Jd   Z gd   Z d   Z ¢d   Z Ŗd   Z Śd   Z 
d   Z %d   Z 6d   Z Fd   Z Jd   Z Nd   Z Sd   Z Xd   Z \d   Z RS(   s8   A parser that performs a complete well-formedness check.c    s_     t  i |   ! t   |  _ " t |   |  _ # |  i |  _ $ t |  _	 % d |  _
 d  S(   Ni   (   s   EntityParsers   __init__s   selfs   Applications   apps   WFCDTDs   dtds   ents   Nones   dtd_listeners
   stop_on_wf(   s   self(    (    sN   /usr/local/twc/lib/python2.2/site-packages/_xmlplus/parsers/xmlproc/xmlproc.pys   __init__ s   c    s&   ' ( ) | |  _  * | i |   d S(   s'   Sets the object to send data events to.N(   s   apps   selfs   set_locator(   s   selfs   app(    (    sN   /usr/local/twc/lib/python2.2/site-packages/_xmlplus/parsers/xmlproc/xmlproc.pys   set_application' s   c    s   , - . | |  _ d S(   s6   Registers an object that listens for DTD parse events.N(   s   listeners   selfs   dtd_listener(   s   selfs   listener(    (    sN   /usr/local/twc/lib/python2.2/site-packages/_xmlplus/parsers/xmlproc/xmlproc.pys   set_dtd_listener, s   i    c    s   0 4 5 | |  _  d S(   sč   Sets the parser policy on well-formedness errors. If this is set to
        0 data events are still delivered, even after well-formedness errors.
        Otherwise no more data events reach the application after such erors.
        N(   s
   stop_on_wfs   self(   s   selfs
   stop_on_wf(    (    sN   /usr/local/twc/lib/python2.2/site-packages/_xmlplus/parsers/xmlproc/xmlproc.pys   set_data_after_wf_error0 s   c    s   7 9 : | |  _ d S(   sQ   Tells the parser whether to read the external subset of documents
        or not.N(   s   read_its   selfs   read_external_subset(   s   selfs   read_it(    (    sN   /usr/local/twc/lib/python2.2/site-packages/_xmlplus/parsers/xmlproc/xmlproc.pys   set_read_external_subset7 s   c    sJ   < = |  i o
 | d j o > t   |  _ n ? t i |  | |  d  S(   Ni·  (   s   selfs
   stop_on_wfs   numbers   Applications   apps   EntityParsers   report_errors   args(   s   selfs   numbers   args(    (    sN   /usr/local/twc/lib/python2.2/site-packages/_xmlplus/parsers/xmlproc/xmlproc.pys   report_error< s   c    s   A B t  i |   C t |  d  o D |  i i   n G g  |  _ H d |  _ I d |  _ J d |  _ K d |  _	 L d |  _
 d  S(   Ns   dtdi    i   (   s   EntityParsers   resets   selfs   hasattrs   dtds   stacks	   seen_roots   seen_doctypes   seen_xmldecls
   stop_on_wfs   read_external_subset(   s   self(    (    sN   /usr/local/twc/lib/python2.2/site-packages/_xmlplus/parsers/xmlproc/xmlproc.pys   resetA s   c    s2   N O P t  |  _ |  _ |  _ |  _ |  _ d S(   s   Deletes circular references.N(   s   Nones   selfs   dtds   ents   errs   apps   pubres(   s   self(    (    sN   /usr/local/twc/lib/python2.2/site-packages/_xmlplus/parsers/xmlproc/xmlproc.pys   derefN s   c    sz  R S T yęU xÜU |  i |  i j  oÅV |  i |  _ X |  i |  i d j o)Y |  i |  i d } Z | d j o [ |  i   nī \ | d j o
 | d j o ] |  i   nĄ ^ |  i d  o _ |  i	 |  i
  n ` |  i d  o a |  i |  i
 d  ni b |  i d  o c |  i   nE d |  i d	  o e |  i   n! g |  i d
  h |  i d  np i |  i |  i d j oH j |  i d  o k |  i   n! m |  i d |  _ n |  i   n p |  i   q WWn r t j
 o5 } z |  i o { t    n } |  i |  _ nB ~ t j
 o2 }  |  i o  |  n  |  i |  _ n Xd S(   s   Does the actual parsing.s   <i   s   /s   !s   ?s   <!--s   <?s	   <![CDATA[s	   <!DOCTYPEiÅ  s   >s   &s   &#N(   s   selfs   poss   datasizes   preposs   datas   ts   parse_end_tags   parse_start_tags   now_ats   parse_comments   apps   parse_pis   parse_cdatas   parse_doctypes   report_errors   scan_tos   parse_charrefs   parse_ent_refs
   parse_datas
   IndexErrors   es   finals   OutOfDataException(   s   selfs   es   t(    (    sN   /usr/local/twc/lib/python2.2/site-packages/_xmlplus/parsers/xmlproc/xmlproc.pys   do_parseR sF    c    s      |  i i   d S(   s=   Must be called before parsing starts. (Notifies application.)N(   s   selfs   apps	   doc_start(   s   self(    (    sN   /usr/local/twc/lib/python2.2/site-packages/_xmlplus/parsers/xmlproc/xmlproc.pys
   parseStart s   c    s}      |  i g  j o |  i g  j o  |  i d |  i d  n#  |  i o  |  i d  n  |  i i   d S(   sd   Must be called when parsing is finished. (Does some checks and "
        "notifies the application.)iĘ  i’’’’iĒ  N(   s   selfs   stacks	   ent_stacks   report_errors	   seen_roots   apps   doc_end(   s   self(    (    sN   /usr/local/twc/lib/python2.2/site-packages/_xmlplus/parsers/xmlproc/xmlproc.pys   parseEnd s   #c    sC     |  i d |  _  |  i   }  |  i    y,  |  i i | \ } }  | i	   } Wn(  t
 j
 o  h  }  h  } n X |  i |  i d j o |  i |  i d j o©  h  } ” x” |  i d  o |  i d  op¢ |  i   } £ |  i   ¤ |  i d  o4 „ |  i d d  ¦ |  i d  § d } Ø Pn © |  i   « |  i   } ¬ | d j oP ® |  i d |  _ Æ |  i |  i d d j o ° |  i d |  _ n ± Pn ³ | i |  o “ |  i d	 |  n ¶ d | | <ø | | | <¹ | i |  o | | | j o ŗ |  i d
 |  n » |  i   qĻ Wn æ |  i g  j o |  i o Ą |  i d  n Ā d |  _ Ä |  i d  o- Å |  i i | |  Ę |  i i |  nZ Ē |  i d  o- Č |  i i | |  É |  i i |  n Ė |  i d d d f  d S(   s   Parses the start tag.i   s   >s   /s   />s   =i½  s    i’’’’iČ  iŠ  iÉ  i¼  s   '>'N(   s   selfs   poss	   _get_names   names   skip_wss   dtds   attrinfos   attrss   fixedss   copys   KeyErrors   datas   seens   test_strs   a_names   now_ats   report_errors   scan_tos   a_vals   parse_att_vals   has_keys   stacks	   seen_roots   apps   handle_start_tags   appends   handle_end_tag(   s   selfs   a_names   names   a_vals   seens   attrss   fixeds(    (    sN   /usr/local/twc/lib/python2.2/site-packages/_xmlplus/parsers/xmlproc/xmlproc.pys   parse_start_tag sZ   	1	 %	$c    sõ  Ķ Ī Š d } Ń |  i d  o Ņ d } Ó t } nZ Ō |  i d  o Õ d } Ö t } n1 Ų |  i d d d f  Ł |  i d  Ś d SÜ xSÜ d oHŻ |  i	 |  } Ž | t |  } ą |  i |  o į Pn ć |  i d  o ä | |  i   } n°å |  i d	  oFę |  i   } č | |  i j o é |  i d
  ź d Sn ģ |  i i |  ī y¶ ļ |  i i |  } š | i   o} ņ |  i |  i   ó | i |  õ d |  _ ÷ | |  i   } ų |  i |  i j o ł |  i d  n ū |  i   n ż |  i d  Wn) ž t j
 o ’ |  i d |  n X|  i d =nW |  i d  o |  i d  q n* |  i d  |  i d |  _ 	q |  i d  o |  i d d  n q W| Sd S(   sC   Parses an attribute value and resolves all entity references in it.s    s   "s   'i¼  s   >i’’’’i   s   &#s   &iĖ  Ni¹  iĢ  iĶ  s   <iĪ  i”  s   ;i½  (   s   vals   selfs   now_ats   delims   reg_attval_stop_quotes   reg_attval_stops   reg_attval_stop_sings   report_errors   scan_tos   find_regs   pieces   ws_transs   _read_char_refs	   _get_names   names	   open_entss   appends   ents
   resolve_ges   is_internals   push_entitys   get_current_sysids   values   finals   parse_literal_entvals   poss   datasizes
   pop_entitys   KeyError(   s   selfs   reg_attval_stops   names   vals   delims   ents   piece(    (    sN   /usr/local/twc/lib/python2.2/site-packages/_xmlplus/parsers/xmlproc/xmlproc.pys   parse_att_valĶ s`   			 

c    s  d } t i d  } xRd oGy |  i |  } WnF t j
 o7 | t |  i	 |  i
  } |  i |  _
 Pn X| t |  } !|  i d  o "| |  i   } nj#|  i d  oF$|  i   } &| |  i j o '|  i d  (d Sn *|  i i |  ,y¶ -|  i i |  } .| i   o} 0|  i |  i   1| i |  3d |  _ 5| |  i   } 6|  i
 |  i j o 7|  i d  n 9|  i   n ;|  i d  Wn) <t j
 o =|  i d |  n X?|  i d	 =n B|  i d
  D|  i d  o' E|  i d d  F|  i d  n q' WH| Sd S(   sB   Parses a literal entity value for insertion in an attribute value.s    s   &i   s   &#iĖ  i¹  iĢ  iĶ  i’’’’i”  s   ;i½  s   >N(   s   vals   res   compiles   reg_stops   selfs   find_regs   pieces   OutOfDataExceptions   ws_transs   datas   poss   datasizes   now_ats   _read_char_refs	   _get_names   names	   open_entss   report_errors   appends   ents
   resolve_ges   is_internals   push_entitys   get_current_sysids   values   finals   parse_literal_entvals
   pop_entitys   KeyErrors   scan_to(   s   selfs   ents   reg_stops   vals   pieces   name(    (    sN   /usr/local/twc/lib/python2.2/site-packages/_xmlplus/parsers/xmlproc/xmlproc.pys   parse_literal_entvalsN   	 
	c    sv  JKL|  i d |  _ M|  i   } O|  i |  i d j o< P|  i   Q|  i d  o Q|  i d d  n n S|  i d |  _ Uy V|  i d } W| | j on X|  i d | | f  [t
 |  i  d j o |  i d | j o \|  i d =n ^|  i i |  n `|  i d =Wn) bt j
 o c|  i d |  n Xe|  i i |  d	 S(
   s6   Parses the end tag from after the '</' and beyond '>'.i   s   >i½  i   i’’’’iĻ  i    iŠ  N(   s   selfs   poss	   _get_names   names   datas   skip_wss   now_ats   report_errors   stacks   elems   lens   appends
   IndexErrors   apps   handle_end_tag(   s   selfs   names   elem(    (    sN   /usr/local/twc/lib/python2.2/site-packages/_xmlplus/parsers/xmlproc/xmlproc.pys   parse_end_tagJs&    -c    sŃ  ghi|  i } jt |  i d |  i  } k| d j o] lt |  i d |  i  } n| d j o. o|  i o pt    n r|  i } n n< tt |  i d |  i |  } u| d j o v| } n x| |  _ zt |  i d | |  d j oE {t |  i d | |  |  _ ||  i
 d  }|  i d |  _ n |  i g  j oV t i |  i |  } | t j p | i d  | j o |  i
 d  n n |  i i |  i | |  d	 S(
   s   Parses character data.s   <i’’’’s   &s   ]]>iŃ  i   i    iÕ  N(   s   selfs   poss   starts   string_finds   datas   ends   finals   OutOfDataExceptions   datasizes   ampends   report_errors   stacks   reg_wss   matchs   ress   Nones   apps   handle_data(   s   selfs   starts   ends   ress   ampend(    (    sN   /usr/local/twc/lib/python2.2/site-packages/_xmlplus/parsers/xmlproc/xmlproc.pys
   parse_datags,   "&c    sÓ  |  i d  o t |  i t   } nR y t |  i t   } Wn/ t j
 o  |  i	 d  t
 } n X|  i d  o |  i	 d d  n | t
 j o d Sn | d j p1 | d j p$ | d j p | d	 j o
 | d
 j ox | d
 j oQ t o
 | d j  o# |  i i t |  d d  n |  i	 d |  n |  i	 d |  nG |  i g  j o |  i	 d  n  |  i i t |  d d  d S(   s   Parses a character reference.s   xiÓ  s   ;i½  Ni	   i
   i   i    i’   i   i    i   iķ  iŹ  iŌ  (   s   selfs   now_ats   unhexs	   get_matchs   reg_hex_digitss   digss   ints
   reg_digitss
   ValueErrors   report_errors   Nones   using_unicodes   apps   handle_datas   xml_chrs   stack(   s   selfs   digs(    (    sN   /usr/local/twc/lib/python2.2/site-packages/_xmlplus/parsers/xmlproc/xmlproc.pys   parse_charrefs*     E#c    sr   ¢£¤|  i d  } „|  i g  j o ¦|  i d  n §|  i i |  i |  i |  Ø| d |  _ d S(   s9   Parses a CDATA marked section from after the '<![CDATA['.s   ]]>iÕ  i   N(	   s   selfs	   get_indexs   new_poss   stacks   report_errors   apps   handle_datas   datas   pos(   s   selfs   new_pos(    (    sN   /usr/local/twc/lib/python2.2/site-packages/_xmlplus/parsers/xmlproc/xmlproc.pys   parse_cdata¢s   c    sJ  Ŗ«¬|  i   } ­|  i d  o ­|  i d d  n Æy °|  i i |  } Wn0 ±t j
 o! ²|  i d |  ³d Sn Xµ| i |  i j o ¶|  i d  ·d Sn ¹|  i i	 | i  »|  i
 g  j o ¼|  i d  n æt |  i
  } Į| i   oz Ā|  i |  i   | i |  Ćy Ä|  i   Wn& Åt j
 o Ę|  i d  n XČ|  i   É|  i   nt Ė| i t j o Ģ|  i d  nM Īd	 |  _ Ļ|  i |  i i | i   Š| i    Ń|  Ņd
 |  _ Õ| t |  i
  j o Ö|  i d  n Ų|  i d =d S(   s5   Parses a general entity reference from after the '&'.s   ;i½  iĶ  NiĖ  iÖ  i¹  i×  i    i   iā  i’’’’(   s   selfs	   _get_names   names   now_ats   report_errors   ents
   resolve_ges   KeyErrors	   open_entss   appends   stacks   lens
   stack_sizes   is_internals   push_entitys   get_current_sysids   values   do_parses   OutOfDataExceptions   flushs
   pop_entitys   notations   Nones	   seen_roots   open_entitys   pubress   resolve_entity_pubids	   get_pubids	   get_sysid(   s   selfs
   stack_sizes   ents   name(    (    sN   /usr/local/twc/lib/python2.2/site-packages/_xmlplus/parsers/xmlproc/xmlproc.pys   parse_ent_refŖsD    
c    sW  ŚŪŻ|  i o Ž|  i d  n ß|  i o ą|  i d  n ā|  i d  ć|  i   } ä|  i d  ę|  i   \ } } ē|  i   é|  i
 i | | |  ź|  i i   ģ|  i d  o ķ|  i   n, ī|  i d  o ļ|  i d d  n ņ| t j p
 | t j oŻ ó|  i   o t i |  d d j o õ|  i d	 |  n ÷|  i o ų|  i d  } łzJ ś|  i i | |  } ūd | _ ü| i t |  i   ż|   Wd
 ž’| i    |  i i |   Xn n | t j o
 | t j p |  i o |  i i   n d |  _ d
 S(   s%   Parses the document type declaration.iŲ  iŁ  i   s   [s   >i½  i    s    ič  N(   s   selfs   seen_doctypes   report_errors	   seen_roots   skip_wss	   _get_names   rootnames   parse_external_ids   pub_ids   sys_ids   apps   handle_doctypes   dtds	   dtd_starts   now_ats   parse_internal_dtds   Nones   get_current_sysids   urlparses   read_external_subsets   _setup_dtd_parsers   ps   pubress   resolve_doctype_pubids   dtd_start_calleds   parse_resources   join_sysidss   derefs   errs   set_locators   dtd_end(   s   selfs   rootnames   sys_ids   pub_ids   p(    (    sN   /usr/local/twc/lib/python2.2/site-packages/_xmlplus/parsers/xmlproc/xmlproc.pys   parse_doctypeŚs@   +(c    s­  
|  i   |  i   |  i } |  i } d } xAd o6|  i t  |  i	 d  o |  i
 d  nü |  i	 d  o |  i
 d  nÕ |  i	 d  o |  i
 d  n® |  i	 d  o |  i
 d  n |  i	 d	  o |  i
 d
  n` |  i	 d  oL |  i } |  i   |  i	 d  o |  i | d }  Pn n qG W#|  i | | |  i   |   d S(   s&   Parse the internal DTD beyond the '['.i    i   s   "s   's   <?s   ?>s   <!--s   -->s   <![s   ]]>s   ]s   >N(   s   selfs   set_start_points
   update_poss   lines
   last_breaks   lbs   last_part_sizes   find_regs   reg_int_dtds   now_ats   scan_tos   poss   ps   skip_wss   handle_internal_dtds
   get_region(   s   selfs   ps   lbs   last_part_sizes   line(    (    sN   /usr/local/twc/lib/python2.2/site-packages/_xmlplus/parsers/xmlproc/xmlproc.pys   parse_internal_dtd
s4   	 
     c    sŹ   %&'z (|  i d  } )yT *| | _ +| | _ -| i |  i    .d | _	 /| i
 | d d Wn& 0t j
 o 1|  i d  n XWd 23| i   4|  i i |   Xd S(   s   Handles the internal DTD.i   s   decodediŚ  N(   s   selfs   _setup_dtd_parsers   ps   doctype_lines   lines
   doctype_lbs
   last_breaks	   set_sysids   get_current_sysids   finals   feeds   int_dtds   OutOfDataExceptions   report_errors   derefs   errs   set_locator(   s   selfs   doctype_lines
   doctype_lbs   int_dtds   p(    (    sN   /usr/local/twc/lib/python2.2/site-packages/_xmlplus/parsers/xmlproc/xmlproc.pys   handle_internal_dtd%s   c    sÜ   67t    } 8| i |  i  9| i |  i  :| i |  i  ;| i	 |  i
  <| i |  i  =| i |  i  >|  i t j o ?|  i i |  i  n @| i |  A|  i i |  B| Sd  S(   N(   s	   DTDParsers   ps   set_error_handlers   selfs   errs   set_dtd_consumers   dtds   set_error_languages   err_langs   set_inputsource_factorys   isfs   set_pubid_resolvers   pubress   set_dtd_objects   dtd_listeners   Nones   set_dtd_listeners   set_internals   internal_subsets   set_locator(   s   selfs   internal_subsets   p(    (    sN   /usr/local/twc/lib/python2.2/site-packages/_xmlplus/parsers/xmlproc/xmlproc.pys   _setup_dtd_parser6s   c    s   FGH|  i Sd S(   s>   Returns the internal element stack. Note: this is a live list!N(   s   selfs   stack(   s   self(    (    sN   /usr/local/twc/lib/python2.2/site-packages/_xmlplus/parsers/xmlproc/xmlproc.pys   get_elem_stackFs   c    s   JKL|  i Sd S(   s    Returns the current data buffer.N(   s   selfs   data(   s   self(    (    sN   /usr/local/twc/lib/python2.2/site-packages/_xmlplus/parsers/xmlproc/xmlproc.pys   get_data_bufferJs   c    s   NPQ|  i Sd S(   sP   Returns the start position of the current construct (tag, comment,
        etc).N(   s   selfs   prepos(   s   self(    (    sN   /usr/local/twc/lib/python2.2/site-packages/_xmlplus/parsers/xmlproc/xmlproc.pys   get_construct_startNs   c    s   SUV|  i Sd S(   sN   Returns the end position of the current construct (tag, comment,
        etc).N(   s   selfs   pos(   s   self(    (    sN   /usr/local/twc/lib/python2.2/site-packages/_xmlplus/parsers/xmlproc/xmlproc.pys   get_construct_endSs   c    s!   XYZ|  i |  i |  i !Sd S(   s.   Returns the raw form of the current construct.N(   s   selfs   datas   preposs   pos(   s   self(    (    sN   /usr/local/twc/lib/python2.2/site-packages/_xmlplus/parsers/xmlproc/xmlproc.pys   get_raw_constructXs   c    s    \^_t  d   |  i  Sd S(   ss   Returns a snapshot of the entity stack. A list of the system
        identifier of the entity and its name, if any.c    s   _|  d |  d f S(   Ni    i	   (   s   ent(   s   ent(    (    sN   /usr/local/twc/lib/python2.2/site-packages/_xmlplus/parsers/xmlproc/xmlproc.pys   <lambda>_s    N(   s   maps   selfs	   ent_stack(   s   self(    (    sN   /usr/local/twc/lib/python2.2/site-packages/_xmlplus/parsers/xmlproc/xmlproc.pys   get_current_ent_stack\s   (   s   __doc__s   __init__s   set_applications   set_dtd_listeners   set_data_after_wf_errors   set_read_external_subsets   Nones   report_errors   resets   derefs   do_parses
   parseStarts   parseEnds   parse_start_tags   parse_att_vals   parse_literal_entvals   parse_end_tags
   parse_datas   parse_charrefs   parse_cdatas   parse_ent_refs   parse_doctypes   parse_internal_dtds   handle_internal_dtds   _setup_dtd_parsers   get_elem_stacks   get_data_buffers   get_construct_starts   get_construct_ends   get_raw_constructs   get_current_ent_stack(    (    (    sN   /usr/local/twc/lib/python2.2/site-packages/_xmlplus/parsers/xmlproc/xmlproc.pys   XMLProcessor s<   	
2
;C:00(   s   __doc__s   res   strings   syss   urlparses	   translates   string_translates   finds   string_finds	   dtdparsers   xmlutilss   xmlapps   xmldtds   versions   revisions   XMLCommonParsers   XMLProcessor(	   s   syss   res   XMLProcessors   versions   urlparses   revisions   string_finds   string_translates   string(    (    sN   /usr/local/twc/lib/python2.2/site-packages/_xmlplus/parsers/xmlproc/xmlproc.pys   ? s   '



		