mò .á¸Ec@s´dZdkZdklZdklZdklZdZdZ dZ dZ d Z d Z d Zd Zd ZdZdZdZdZdZdZdZd Zd Zd Zd Zd ZdZdefd„ƒYZdefd„ƒYZ defd„ƒYZ!defd„ƒYZ"defd„ƒYZ#defd„ƒYZ$defd„ƒYZ%defd „ƒYZ&d!efd"„ƒYZ'd#efd$„ƒYZ(d%efd&„ƒYZ)d'fd(„ƒYZ*ee*ƒd)ei+e*fd*„ƒYZ,ee,ƒd+fd,„ƒYZ-ee-ƒd-e*fd.„ƒYZ.ee.ƒd/e.fd0„ƒYZ/d1e.fd2„ƒYZ0d3e/fd4„ƒYZ1d5fd6„ƒYZ2d7fd8„ƒYZ3d9ei4e*fd:„ƒYZ5dS(;sl DOM implementation in ZOPE : Read-Only methods All standard Zope objects support DOM to a limited extent. N(sInitializeClass(sClassSecurityInfo(saccess_contents_informationiiiiiiiii i i i t DOMExceptioncBstZRS(N(t__name__t __module__(((t'/data/zmath/zope/lib/python/OFS/ZDOM.pyR9stIndexSizeExceptioncBstZeZRS(N(RRtINDEX_SIZE_ERRtcode(((RR;stDOMStringSizeExceptioncBstZeZRS(N(RRtDOMSTRING_SIZE_ERRR(((RR=stHierarchyRequestExceptioncBstZeZRS(N(RRtHIERARCHY_REQUEST_ERRR(((RR ?stWrongDocumentExceptioncBstZeZRS(N(RRtWRONG_DOCUMENT_ERRR(((RR AstInvalidCharacterExceptioncBstZeZRS(N(RRtINVALID_CHARACTER_ERRR(((RR CstNoDataAllowedExceptioncBstZeZRS(N(RRtNO_DATA_ALLOWED_ERRR(((RREstNoModificationAllowedExceptioncBstZeZRS(N(RRtNO_MODIFICATION_ALLOWED_ERRR(((RRGstNotFoundExceptioncBstZeZRS(N(RRt NOT_FOUND_ERRR(((RRIstNotSupportedExceptioncBstZeZRS(N(RRtNOT_SUPPORTED_ERRR(((RRKstInUseAttributeExceptioncBstZeZRS(N(RRtINUSE_ATTRIBUTE_ERRR(((RRMstNodecBs*tZdZeƒZeiedƒd„Zeiedƒd„Zeiedƒd„Z eiedƒd„Z eied ƒd „Z eied ƒd „Z eied ƒd„Z eiedƒd„Zeiedƒd„Zeiedƒd„Zeiedƒd„ZRS(s Node Interface t getNodeNamecCsdS(s,The name of this node, depending on its typeN(tNone(tself((RR^st getNodeValuecCsdS(s-The value of this node, depending on its typeN(R(R((RRcst getParentNodecCsdS(sgThe parent of this node. All nodes except Document DocumentFragment and Attr may have a parentN(R(R((RRhst getChildNodescCstƒS(svReturns a NodeList that contains all children of this node. If there are no children, this is a empty NodeListN(tNodeList(R((RRnst getFirstChildcCsdS(sQThe first child of this node. If there is no such node this returns None.N(R(R((RR!tst getLastChildcCsdS(sPThe last child of this node. If there is no such node this returns None.N(R(R((RR"zstgetPreviousSiblingcCsdS(s_The node immediately preceding this node. If there is no such node, this returns None.N(R(R((RR#stgetNextSiblingcCsdS(s_The node immediately preceding this node. If there is no such node, this returns None.N(R(R((RR$‡st getAttributescCsdS(snReturns a NamedNodeMap containing the attributes of this node (if it is an element) or None otherwise.N(R(R((RR%stgetOwnerDocumentcCs1|}t|dƒo|i}|iƒSn|S(s[The Document object associated with this node. When this is a document this is Nonet aq_parentN(RtnodethasattrR'R&(RR(((RR&“s  t hasChildNodescCst|iƒƒS(sHReturns true if the node has any children, false if it doesn't. N(tlenRt objectIds(R((RR* s(RRt__doc__tClassSecurityInfotsecuritytdeclareProtectedtaccess_contents_informationRRRRR!R"R#R$R%R&R*(((RRSs2             tDocumentcBs¡tZdZeƒZeiedƒd„Zeiedƒd„Zeiedƒd„Z d„Z d„Z d „Z d „Z d „Zd „Zd „ZRS(s Document Interface tgetImplementationcCstƒS(sJ The DOMImplementation object that handles this document. N(tDOMImplementation(R((RR3³st getDoctypecCsdS(sÁ The Document Type Declaration associated with this document. For HTML documents as well as XML documents without a document type declaration this returns null. N(R(R((RR5ºstgetDocumentElementcCs|iS(s This is a convenience attribute that allows direct access to the child node that is the root element of the document. N(RR'(R((RR6ÄscCsdS(s,The name of this node, depending on its types #documentN((R((RRÎscCstS(s)A code representing the type of the node.N(t DOCUMENT_NODE(R((Rt getNodeTypeÒscCs|S(s[The Document object associated with this node. When this is a document this is NoneN(R(R((RR&ÖscCst|igƒS(svReturns a NodeList that contains all children of this node. If there are no children, this is a empty NodeListN(R RR'(R((RRÛscCs|iS(sQThe first child of this node. If there is no such node this returns None.N(RR'(R((RR!àscCs|iS(sPThe last child of this node. If there is no such node this returns None.N(RR'(R((RR"åscCsdS(sHReturns true if the node has any children, false if it doesn't. iN((R((RR*ês(RRR-R.R/R0R1R3R5R6RR8R&RR!R"R*(((RR2¨s           R4cBs3tZdZeƒZeiedƒed„ZRS(s% DOMImplementation Interface t hasFeaturecCsd|iƒ}|djodSn|djo2|djodSn|djodSndSndS(sE hasFeature - Test if the DOM implementation implements a specific feature. Parameters: feature The package name of the feature to test. In Level 1, the legal values are "HTML" and "XML" (case-insensitive). version This is the version number of the package name to test. In Level 1, this is the string "1.0". If the version is not specified, supporting any version of the feature will cause the method to return true. Return Value true if the feature is implemented in the specified version, false otherwise. thtmlitxmlis1.0N(tfeaturetlowertversionR(RR<R>((RR9ús      ( RRR-R.R/R0R1RR9(((RR4òs  tElementcBsÃtZdZeƒZeiedƒd„Zd„Zd„Z d„Z d„Z d„Z d„Z d „Zd „Zeied ƒd „Zeied ƒd„Zeiedƒd„ZRS(s Element interface t getTagNamecCs |iiS(sThe name of the elementN(Rt __class__R(R((RR@scCs |iƒS(s,The name of this node, depending on its typeN(RR@(R((RR!scCstS(s)A code representing the type of the node.N(t ELEMENT_NODE(R((RR8%scCst|ddƒS(sgThe parent of this node. All nodes except Document DocumentFragment and Attr may have a parentR'N(tgetattrRR(R((RR)scCst|iƒƒS(svReturns a NodeList that contains all children of this node. If there are no children, this is a empty NodeListN(R Rt objectValues(R((RR.scCs&|iƒ}|o|idSndS(sPThe first child of this node. If there is no such node this returns NoneiN(RRtchildrent_dataR(RRE((RR!3s  cCs&|iƒ}|o|idSndS(sQThe last child of this node. If there is no such node this returns None.iÿÿÿÿN(RRRERFR(RRE((RR";s  cCsªt|dƒo–|i}t|iƒƒ}|i}t|ƒtdƒj o |ƒ}ny|i |ƒ}Wn dSnX|djodSn|i ƒ|dSndS(s_The node immediately preceding this node. If there is no such node, this returns None.R'tiN( R)RR'tparenttlistR,tidstidttypetindexRRD(RRMRHRJRK((RR#Cs    cCs´t|dƒo |i}t|iƒƒ}|i}t|ƒtdƒj o |ƒ}ny|i |ƒ}Wn dSnX|t |ƒdjodSn|i ƒ|dSndS(s_The node immediately preceding this node. If there is no such node, this returns None.R'RGiN( R)RR'RHRIR,RJRKRLRMRR+RD(RRMRHRJRK((RR$Qs   t getAttributecCsdS(s%Retrieves an attribute value by name.N(R(Rtname((RRNcstgetAttributeNodecCsdS(sO Retrieves an Attr node by name or None if there is no such attribute. N(R(RRO((RRPhstgetElementsByTagNamecCs›g}xˆ|iƒD]z}|iƒtjo|iƒ|jp |djo|i|ƒnt |dƒo |i |ƒ}||i }qqWt |ƒS(sN Returns a NodeList of all the Elements with a given tag name in the order in which they would be encountered in a preorder traversal of the Document tree. Parameter: tagname The name of the tag to match (* = all tags). Return Value: A new NodeList object containing all the matched Elements. t*RQN(tnodeListRRDtchildR8RBR@ttagnametappendR)RQtn1RFR (RRURSRTRW((RRQos 3(RRR-R.R/R0R1R@RR8RRR!R"R#R$RNRPRQ(((RR?s&              tElementWithAttributescBs)tZdZd„Zd„Zd„ZRS(s Elements that allow DOM access to Zope properties of type 'string'. Note: This sub-class should only be used by PropertyManagers cCsqh}x^|iD]S}|ddjo<|d}t||i|dƒƒi|ƒ}|||