ó °‚¸tdtd_start_called(R((sO/opt/freeware/lib/python2.7/site-packages/_xmlplus/parsers/xmlproc/dtdparser.pyR?Æs       cCs|js|jjƒndS(N(RAR;t dtd_start(R((sO/opt/freeware/lib/python2.7/site-packages/_xmlplus/parsers/xmlproc/dtdparser.pyt parseStartÔs cCs|jjƒdS(N(R;tdtd_end(R((sO/opt/freeware/lib/python2.7/site-packages/_xmlplus/parsers/xmlproc/dtdparser.pytparseEndØscCs ||_dS(s/Tells the parser where to send DTD information.N(R;(RR%((sO/opt/freeware/lib/python2.7/site-packages/_xmlplus/parsers/xmlproc/dtdparser.pytset_dtd_consumerÛscCs ||_dS(s†Tells the parser where to mirror PE information (in addition to what goes to the DTD consumer and where to get PE information.N(R%(RR%((sO/opt/freeware/lib/python2.7/site-packages/_xmlplus/parsers/xmlproc/dtdparser.pytset_dtd_objectßscCs ||_dS(s9Tells the parser whether the DTD is internal or external.N(R#(Rtyesno((sO/opt/freeware/lib/python2.7/site-packages/_xmlplus/parsers/xmlproc/dtdparser.pyt set_internaläscCs)d|_|_|_|_|_dS(sRemoves circular references.N(RR.R;R%tappterr(R((sO/opt/freeware/lib/python2.7/site-packages/_xmlplus/parsers/xmlproc/dtdparser.pytderefèscCs#y¾|j}|jdkr(|jƒn|jƒx`|j|jkr”|jdƒrc|jƒn|jdƒr|jƒnÿ|jdƒr›|jƒnã|jdƒr·|j ƒnÇ|j t ƒrÓ|j ƒn«|jdƒrõ|j |jƒn‰|jdƒr|j|jƒng|jdƒr3|jƒnK|jd ƒrd|jdkrd|jd |_n|jd ƒ|jd ƒ|j}|jƒq5W|jr½|jdkr½|jd ƒnWn^tk rî}|jrâ|‚q||_n1tk r}|jrtƒ‚q||_nXdS(sDoes the actual parsing.is iiÅ t>iã N(RR<tparse_ignored_dataR RRtparse_elem_typet parse_entityt parse_attlisttparse_notationR/t reg_pe_reft parse_pe_reftparse_piR;t parse_commenttparse_conditionalR=RRRR R (Rtpreposte((sO/opt/freeware/lib/python2.7/site-packages/_xmlplus/parsers/xmlproc/dtdparser.pytdo_parseìsL                 cCsHtj|dƒ|jdƒr8d}tj|dƒnd}|jƒ}|jdƒ|jdƒ\}}|d krd}|jƒ}nTd}|jƒ rÌtj|ƒddkrÌ|j d|ƒnt |jƒ|ƒ}|jdƒr|j dƒn |jƒ| rY|jdƒrY|r6|j dƒn|jƒ|jƒ}|jƒnd }|jd ƒs|j d d ƒn|r|rË|j j ||ƒ|j |j kr |j j ||ƒq qD|j j|||ƒ|j |j krD|j j|||ƒqDn5|r+|j j||ƒn|j j||||ƒd S( sParses an entity declaration.iRiR1iètNDATAiº iÛ RMi½ N(R7R,RR$tparse_external_idRtparse_ent_repltextR*turlparseRt join_sysidsR;tnew_parameter_entityR%tnew_external_petnew_general_entitytnew_external_entity(Rtpedecltent_nametpub_idtsys_idR#tent_valtndata((sO/opt/freeware/lib/python2.7/site-packages/_xmlplus/parsers/xmlproc/dtdparser.pyRPsN        cCsg|jdƒrd}n9|jdƒr0d}n!|jddƒ|jdƒdS|j|j|ƒƒS(srParses an entity replacement text and resolves all character entity and parameter entity references in it.t"t'i¼ RMN(RkRj(RRRtparse_ent_litval(Rtdelim((sO/opt/freeware/lib/python2.7/site-packages/_xmlplus/parsers/xmlproc/dtdparser.pyR]Zs   c Csd}d}xftj||ƒ}|dkr1Pn||||jdƒ!}|jdƒ}|||d!dkr˜t|d|ƒ}|dkr£|jddƒPn||ddkrÑt||d |!ƒ}nt||d|!ƒ}|d kp!|d kp!|d kp!|d ko!|dks{|dkrhtrU|dkrU|t |ƒ}qx|jd|ƒq‹|jd|ƒn|t |ƒ}|d}q||dkrdt|d|ƒ}|dkrÚ|jddƒPn||d|!}yH|j j |ƒ}|j ƒr%||j |jƒ}n |jdƒWn!tk rV|jd|ƒnX|d}q|jdƒPq|||S(NiR1is&#R"iÿÿÿÿi½ txii i i i iÿiiíiÊ iRiÝ iÞ i¡(treg_litval_stopRRR RRtunhextintt using_unicodetxml_chrR%R&R(RlR+R'( RtlitvalRtvalRtendpostdigsR-R.((sO/opt/freeware/lib/python2.7/site-packages/_xmlplus/parsers/xmlproc/dtdparser.pyRlisT  $       cCs„|jdƒ|jƒ}|jdƒ|jddƒ\}}|jƒ|jdƒsj|jddƒn|jj|||ƒdS(sParses a notation declaration.iiRMi½ N(R,R$R\RRR;t new_notation(RR-tpubidtsysid((sO/opt/freeware/lib/python2.7/site-packages/_xmlplus/parsers/xmlproc/dtdparser.pyRR¥s    cCsê|jtƒdd!}y|jj|ƒ}Wn"tk rP|jd|ƒdSX|jƒr|j|jƒ|j ƒ|j ƒ|j ƒnY|j j |jƒ|jƒƒ}|j}|jdƒz|j|ƒWd|j|ƒXdS(s)Parses a reference to a parameter entity.iiÿÿÿÿiÞ Ni(R2RSR%R&R'RR(R)R*R+RZR tpubrestresolve_pe_pubidt get_pubidt get_sysidR#RIt open_entity(RR-R.RzRq((sO/opt/freeware/lib/python2.7/site-packages/_xmlplus/parsers/xmlproc/dtdparser.pyRT²s"      cCsE|jdƒ|jƒ}|jdƒx|jdƒs0|jƒ}|jdƒ|jtƒrr|jtƒ}nÏ|jdƒr©|jdƒd|jtdƒf}n˜|jdƒr#|j d|_ |jt dƒ}i}x^|D]5}|j |ƒr|j d|fƒqçd||d}nL|jdƒrVd}n4|jdƒrt|jƒ}n|jdd ƒd}|jƒ|jdƒs¶|jddƒn|jj||ƒd S( s#Parses an element type declaration.itEMPTYtANYR‚i¼ s EMPTY, ANYRMi½ N(s EMPTY, ANYR‚(R,R$Rt_parse_content_modelRR;tnew_element_type(Rt elem_namet elem_cont((sO/opt/freeware/lib/python2.7/site-packages/_xmlplus/parsers/xmlproc/dtdparser.pyROs      cCs|jƒg}d}|jdƒr;|dkr;|jƒSxn|jƒ|jdƒri|jdƒ}n |jƒ}|jdƒs¢|jdƒs¢|jdƒrÅ|j|j}|jd|_nd}t|ƒt kró|j ||fƒn |j |ƒ|jƒ|jd ƒrPn|dkr}|jd ƒsG|jd ƒrZ|j|j}n|j d dƒ|jd|_q>|j|ƒs>|j dƒ|j d ƒq>q>|jdƒsÙ|jdƒsÙ|jdƒrü|j|j}|jd|_nd}|||fS(saParses the content model of an element type declaration. Level tells the function if we are on the top level (=0) or not (=1). The '(' has just been passed over, we read past the ')'. Returns a tuple (separator, contents, modifier), where content consists of (cp, modifier) tuples and cp can be a new content model tuple.R1s#PCDATAiR‚it?Rt+t)Rt,i¼ s'|'ià (s'|'R™( R,Rtparse_mixed_content_modelR’R$RRRttypet StringTypestappendRR(Rtlevelt cont_listtseptcptmod((sO/opt/freeware/lib/python2.7/site-packages/_xmlplus/parsers/xmlproc/dtdparser.pyR’sB    -    -cCs÷dg}d}d}x›y|jƒWntk rA}|‚nX|jdƒrZd}n0|jdƒrmPn|jddƒ|jdƒ|jƒ|j|jtƒdfƒq|jdƒrËd}n|dkrê|jddƒn|||fS( s9Parses mixed content models. Ie: ones containing #PCDATA.s#PCDATAR1RR˜i½ RMR(s#PCDATAR1(R,R RRRRR2R…(RRŸR R¢RY((sO/opt/freeware/lib/python2.7/site-packages/_xmlplus/parsers/xmlproc/dtdparser.pyRšTs*       cCs |jr&|jdƒ|jdƒná|jƒ|jdƒr‚d|_|jƒ|jdƒst|jddƒn|jƒdS|jdƒsÁ|jd d ƒ|jdƒ|jd|_n|jƒ|jdƒsí|jddƒn|jƒ|jd|_dS( sParses a conditional section.iá s]]>tIGNOREit[i½ NtINCLUDEi¼ s'IGNORE'(s'IGNORE'R¥(R#RRR,RR<RNR=(R((sO/opt/freeware/lib/python2.7/site-packages/_xmlplus/parsers/xmlproc/dtdparser.pyRWss(         cCsÃy]|j}xM|r[|jtƒ|jdƒr>|d}q|d}|jd|_qWWnVtk rµ}|jrˆ|jdƒn||_d|_d|_d|_ |‚nXd|_dS(Ns]]>iiiã R1i( R<R t reg_cond_sectRRR RRRR(RtcounterRY((sO/opt/freeware/lib/python2.7/site-packages/_xmlplus/parsers/xmlproc/dtdparser.pyRN’s"           cCs¢g}|jƒ|jdƒs2|jddƒnxi|jƒ|j|j|ƒƒ|jƒ|jdƒrrPq5|j|ƒs5|jdd|fƒPq5q5|S(sBParses a '(' S? elem_regexp S? separator ... ')' list. (Internal.)R‚i½ R˜i¼ s')'(R,RRRR2(Rt elem_regexpt separatortlist((sO/opt/freeware/lib/python2.7/site-packages/_xmlplus/parsers/xmlproc/dtdparser.pyt __parse_list©s   cCs|j S(N(R#(R((sO/opt/freeware/lib/python2.7/site-packages/_xmlplus/parsers/xmlproc/dtdparser.pyt is_external½sRcCs0tj||ƒ|jj|jƒd|_dS(Ni(R7t_push_ent_stackR>RR=(RR-((sO/opt/freeware/lib/python2.7/site-packages/_xmlplus/parsers/xmlproc/dtdparser.pyR­ÂscCs+tj|ƒ|jd|_|jd=dS(Niÿÿÿÿ(R7t_pop_ent_stackR>R=(R((sO/opt/freeware/lib/python2.7/site-packages/_xmlplus/parsers/xmlproc/dtdparser.pyR®Çs ($t__name__t __module__t__doc__R RRRRR R,R/R2R8R?RCRERFRGRIRLRZRPR]RlRRRTRQROR’RšRWRNR„R¬R­R®(((sO/opt/freeware/lib/python2.7/site-packages/_xmlplus/parsers/xmlproc/dtdparser.pyRsD    !         2 <  <  8  9      R:cBs5eZd„Zd„Zd„Zd„Zd„ZRS(cCs&tj|dƒi|_i|_dS(N(t DTDConsumerR8Rt param_entstused_notations(R((sO/opt/freeware/lib/python2.7/site-packages/_xmlplus/parsers/xmlproc/dtdparser.pyR8Ðs cCs/|jj|ƒs+t||ƒ|j|s    ÿÿ½