ó \STc@sdZddlmZddlmZddlmZddlmZddlmZddlm Z ddl Z d „Z d d3d „ƒYZ d e fd „ƒYZ de fd„ƒYZde fd„ƒYZde fd„ƒYZde fd„ƒYZde fd„ƒYZde fd„ƒYZde fd„ƒYZde fd„ƒYZde fd„ƒYZd e fd!„ƒYZd"e fd#„ƒYZd$e fd%„ƒYZi e d&6ed'6ed(6ed)6ed*6ed+6ed,6ed-6ed.6ed/6ed06ed16ed26ZdS(4s A Parsed token that represents an acis specifier on the parsed tree. WWW: http://4suite.org/XPATH e-mail: support@4suite.org Copyright (c) 2000-2001 Fourthought Inc, USA. All Rights Reserved. See http://4suite.org/COPYRIGHT for license and copyright information iĸĸĸĸ(tNode(tg_xpathRecognizedNodes(tNAMESPACE_NODE(tUtil(t NamespaceNode(tGetAllNsNcCs:yt||ƒSWn!tk r5td|ƒ‚nXdS(NsInvalid axis: %s(t g_classMaptKeyErrort SyntaxError(taxis((sQ/opt/freeware/lib64/python2.7/site-packages/_xmlplus/xpath/ParsedAxisSpecifier.pytParsedAxisSpecifiers t AxisSpecifiercBsJeZejZd„Zd„Zd„Zdd„Zd„Z d„Z RS(cCs ||_dS(N(t_axis(tselfR ((sQ/opt/freeware/lib64/python2.7/site-packages/_xmlplus/xpath/ParsedAxisSpecifier.pyt__init__#scCs gdfS(sT Always returns a tuple of node-set and 0 if forward, 1 if reverse. i((R tcontexttnodeTest((sQ/opt/freeware/lib64/python2.7/site-packages/_xmlplus/xpath/ParsedAxisSpecifier.pytselect&scCsexX|jD]M}||||jƒr5|j|ƒn|jr |j||||ƒq q W|dfS(s3Select all of the descendants from the context nodei(t childNodest principalTypetappendt descendants(R RRtnodetnodeSettchild((sQ/opt/freeware/lib64/python2.7/site-packages/_xmlplus/xpath/ParsedAxisSpecifier.pyR,s  tcCs|t|ƒGHdS(N(tstr(R tindent((sQ/opt/freeware/lib64/python2.7/site-packages/_xmlplus/xpath/ParsedAxisSpecifier.pytpprint5scCsdt|ƒt|ƒfS(Ns(tidtrepr(R ((sQ/opt/freeware/lib64/python2.7/site-packages/_xmlplus/xpath/ParsedAxisSpecifier.pyt__str__8scCs|jS(s"Always displays verbose expression(R (R ((sQ/opt/freeware/lib64/python2.7/site-packages/_xmlplus/xpath/ParsedAxisSpecifier.pyt__repr__;s( t__name__t __module__Rt ELEMENT_NODERRRRRRR (((sQ/opt/freeware/lib64/python2.7/site-packages/_xmlplus/xpath/ParsedAxisSpecifier.pyR s     tParsedAncestorAxisSpecifiercBseZd„ZRS(cCs‚g}|jjtjkr'|jjp0|jj}x8|rm||||jƒra|j|ƒn|j}q6W|jƒ|dfS(s.Select all of the ancestors including the rooti( RtnodeTypeRtATTRIBUTE_NODEt ownerElementt parentNodeRRtreverse(R RRRtparent((sQ/opt/freeware/lib64/python2.7/site-packages/_xmlplus/xpath/ParsedAxisSpecifier.pyRAs   (R!R"R(((sQ/opt/freeware/lib64/python2.7/site-packages/_xmlplus/xpath/ParsedAxisSpecifier.pyR$@st!ParsedAncestorOrSelfAxisSpecifiercBseZd„ZRS(cCsĢ|j}||||jƒr*|g}ng}|jtjkrK|jpQ|j}x8|rŽ||||jƒr‚|j|ƒn|j}qWW|jƒ|dfS(s@Select all of the ancestors including ourselves through the rooti( RRR%RR&R'R(RR)(R RRRRR*((sQ/opt/freeware/lib64/python2.7/site-packages/_xmlplus/xpath/ParsedAxisSpecifier.pyROs     (R!R"R(((sQ/opt/freeware/lib64/python2.7/site-packages/_xmlplus/xpath/ParsedAxisSpecifier.pyR+NstParsedAttributeAxisSpecifiercBseZejZd„ZRS(cCsF|jj}t|||jd„|r3|jƒp6gƒ}|dfS(s2Select all of the attributes from the context nodecSs||||ƒS(N((tattrttestRtpt((sQ/opt/freeware/lib64/python2.7/site-packages/_xmlplus/xpath/ParsedAxisSpecifier.pytgsi(Rt attributestfilterRtvalues(R RRtattrstrt((sQ/opt/freeware/lib64/python2.7/site-packages/_xmlplus/xpath/ParsedAxisSpecifier.pyRds (R!R"RR&RR(((sQ/opt/freeware/lib64/python2.7/site-packages/_xmlplus/xpath/ParsedAxisSpecifier.pyR,`s tParsedChildAxisSpecifiercBseZd„ZRS(cCs4t|||jd„t|jjƒƒ}|dfS(s.Select all of the children of the context nodecSs||||ƒS(N((RR.RR/((sQ/opt/freeware/lib64/python2.7/site-packages/_xmlplus/xpath/ParsedAxisSpecifier.pyR0psi(R2RtlistRR(R RRR5((sQ/opt/freeware/lib64/python2.7/site-packages/_xmlplus/xpath/ParsedAxisSpecifier.pyRns(R!R"R(((sQ/opt/freeware/lib64/python2.7/site-packages/_xmlplus/xpath/ParsedAxisSpecifier.pyR6mst#ParsedDescendantOrSelfAxisSpecifiercBseZd„ZRS(cCsP|||j|jƒr'|jg}ng}|j|||j|ƒ|dfS(s2Select the context node and all of its descendantsi(RRR(R RRR((sQ/opt/freeware/lib64/python2.7/site-packages/_xmlplus/xpath/ParsedAxisSpecifier.pyRws (R!R"R(((sQ/opt/freeware/lib64/python2.7/site-packages/_xmlplus/xpath/ParsedAxisSpecifier.pyR8vstParsedDescendantAxisSpecifiercBseZd„ZRS(cCs)g}|j|||j|ƒ|dfS(Ni(RR(R RRR((sQ/opt/freeware/lib64/python2.7/site-packages/_xmlplus/xpath/ParsedAxisSpecifier.pyR‚s(R!R"R(((sQ/opt/freeware/lib64/python2.7/site-packages/_xmlplus/xpath/ParsedAxisSpecifier.pyR9st#ParsedFollowingSiblingAxisSpecifiercBseZd„ZRS(cCsWg}|jj}x8|rL||||jƒr@|j|ƒn|j}qW|dfS(s7Select all of the siblings that follow the context nodei(Rt nextSiblingRR(R RRtresulttsibling((sQ/opt/freeware/lib64/python2.7/site-packages/_xmlplus/xpath/ParsedAxisSpecifier.pyR‰s   (R!R"R(((sQ/opt/freeware/lib64/python2.7/site-packages/_xmlplus/xpath/ParsedAxisSpecifier.pyR:ˆstParsedFollowingAxisSpecifiercBseZd„ZRS(cCsđg}|j}x||jjp'|jkrŪ|j}xN|r†||||jƒrd|j|ƒn|j||||ƒ|j}q9W|jtjkrĒ|j pĻ|j }qW|dfS(si Select all of the nodes the follow the context node, not including descendants. i( Rt ownerDocumentR;RRRR%RR&R'R((R RRR<tcurrR=((sQ/opt/freeware/lib64/python2.7/site-packages/_xmlplus/xpath/ParsedAxisSpecifier.pyR•s    (R!R"R(((sQ/opt/freeware/lib64/python2.7/site-packages/_xmlplus/xpath/ParsedAxisSpecifier.pyR>”stParsedNamespaceAxisSpecifiercBseZeZd„ZRS(cCsĒ|jjtjkrgdfSg}t|jƒ}xa|jƒD]S}tj||||jjpi|jƒ}||||jƒrA|j |ƒqAqAW|dfS(s-Select all of the namespaces from the contexti( RR%RR#RtkeysRR?RR(R RRR<tnsstprefixtnsNode((sQ/opt/freeware/lib64/python2.7/site-packages/_xmlplus/xpath/ParsedAxisSpecifier.pyRŽs  (R!R"RRR(((sQ/opt/freeware/lib64/python2.7/site-packages/_xmlplus/xpath/ParsedAxisSpecifier.pyRAĻstParsedParentAxisSpecifiercBseZd„ZRS(cCsd|jjtjkr!|jjp*|jj}|rT||||jƒrT|g}ng}|dfS(s%Select the parent of the context nodei(RR%RR&R'R(R(R RRR*R<((sQ/opt/freeware/lib64/python2.7/site-packages/_xmlplus/xpath/ParsedAxisSpecifier.pyRūs  (R!R"R(((sQ/opt/freeware/lib64/python2.7/site-packages/_xmlplus/xpath/ParsedAxisSpecifier.pyRF―st#ParsedPrecedingSiblingAxisSpecifiercBseZd„ZRS(cCsag}|jj}x8|rL||||jƒr@|j|ƒn|j}qW|jƒ|dfS(s8Select all of the siblings that precede the context nodei(RtpreviousSiblingRRR)(R RRR<R=((sQ/opt/freeware/lib64/python2.7/site-packages/_xmlplus/xpath/ParsedAxisSpecifier.pyRĘs    (R!R"R(((sQ/opt/freeware/lib64/python2.7/site-packages/_xmlplus/xpath/ParsedAxisSpecifier.pyRGÉstParsedPrecedingAxisSpecifiercBseZd„ZRS(cCsïg}|j}x—|rĻ|j}x]|r€g}||||jƒrQ|g}n|j||||ƒ|j|ƒ|j}q$W|jtjkrœ|jpĒ|j }qWg}x3t dt |ƒdƒD]}|j || ƒqÉW|dfS(sMSelect all of the nodes the precede the context node, not including ancestorsi( RRHRRRR%RR&R'R(trangetlentextend(R RRtdoc_listR@tsibR<ti((sQ/opt/freeware/lib64/python2.7/site-packages/_xmlplus/xpath/ParsedAxisSpecifier.pyRØs        ( (R!R"R(((sQ/opt/freeware/lib64/python2.7/site-packages/_xmlplus/xpath/ParsedAxisSpecifier.pyRIŨstParsedSelfAxisSpecifiercBseZd„ZRS(cCs2|||j|jƒr(|jgdfSgdfS(sSelect the context nodei(RR(R RR((sQ/opt/freeware/lib64/python2.7/site-packages/_xmlplus/xpath/ParsedAxisSpecifier.pyRņs(R!R"R(((sQ/opt/freeware/lib64/python2.7/site-packages/_xmlplus/xpath/ParsedAxisSpecifier.pyRPðstancestorsancestor-or-selfRR*t descendantsdescendant-or-selft attributet followingsfollowing-siblingt precedingspreceding-siblingt namespaceR ((t__doc__txml.domRt xml.xpathRRRRt xml.dom.extRtstringR R R$R+R,R6R8R9R:R>RARFRGRIRPR(((sQ/opt/freeware/lib64/python2.7/site-packages/_xmlplus/xpath/ParsedAxisSpecifier.pyt sH  !