ó ¿œ^c@s‡dZddlZddlmZmZmZdejfd„ƒYZedkrƒeƒZ e j eƒƒe j ej dƒndS(ss A simple demo that reads in an XML document and spits out an equivalent, but not necessarily identical, document. iÿÿÿÿN(tsaxutilsthandlert make_parsertContentGeneratorcBsMeZejd„Zd„Zd„Zd„Zd„Zd„Z d„Z RS(cCstjj|ƒ||_dS(N(RtContentHandlert__init__t_out(tselftout((s*/usr/lib64/python2.7/Demo/xml/roundtrip.pyRscCs|jjdƒdS(Ns, (Rtwrite(R((s*/usr/lib64/python2.7/Demo/xml/roundtrip.pyt startDocumentscCsh|jjd|ƒx=|jƒD]/\}}|jjd|tj|ƒfƒq!W|jjdƒdS(Nt(RR titemsRtescape(Rtnametattrstvalue((s*/usr/lib64/python2.7/Demo/xml/roundtrip.pyt startElements'cCs|jjd|ƒdS(Ns(RR (RR((s*/usr/lib64/python2.7/Demo/xml/roundtrip.pyt endElementscCs|jjtj|ƒƒdS(N(RR RR(Rtcontent((s*/usr/lib64/python2.7/Demo/xml/roundtrip.pyt characters scCs|jj|ƒdS(N(RR (RR((s*/usr/lib64/python2.7/Demo/xml/roundtrip.pytignorableWhitespace#scCs|jjd||fƒdS(Ns (RR (Rttargettdata((s*/usr/lib64/python2.7/Demo/xml/roundtrip.pytprocessingInstruction&s( t__name__t __module__tsyststdoutRR RRRRR(((s*/usr/lib64/python2.7/Demo/xml/roundtrip.pyR s     t__main__i( t__doc__Rtxml.saxRRRRRRtparsertsetContentHandlertparsetargv(((s*/usr/lib64/python2.7/Demo/xml/roundtrip.pyts