[Zope3-checkins] CVS: zopeproducts/xmldom/interfaces - traversal.py:1.1

Philipp von Weitershausen philikon@philikon.de
Thu, 19 Jun 2003 19:21:47 -0400


Update of /cvs-repository/zopeproducts/xmldom/interfaces
In directory cvs.zope.org:/tmp/cvs-serv31209/interfaces

Added Files:
	traversal.py 
Log Message:
Added interface for the DOM Level 2 Traversal feature. See
http://www.w3.org/TR/DOM-Level-2-Traversal-Range/traversal.html
for more information.


=== Added File zopeproducts/xmldom/interfaces/traversal.py ===
##############################################################################
#
# Copyright (c) 2003 Zope Corporation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL).  A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
"""
DOM interfaces for the DOM Level 2 Traversal feature

See http://www.w3.org/TR/DOM-Level-2-Traversal-Range/traversal.html for more
detailled information

$Id: traversal.py,v 1.1 2003/06/19 23:21:46 philikon Exp $
"""

from zope.interface import Interface, Attribute

class INodeIterator(Interface):
    """
    See http://www.w3.org/TR/DOM-Level-2-Traversal-Range/traversal.html
    """

    #
    # Attributes
    #

    expandEntityReferences = Attribute(
        "expandEntityReferences",
        "See http://www.w3.org/TR/DOM-Level-2-Traversal-Range/traversal.html"
        )

    filter = Attribute(
        "filter",
        "See http://www.w3.org/TR/DOM-Level-2-Traversal-Range/traversal.html"
        )

    root = Attribute(
        "root",
        "See http://www.w3.org/TR/DOM-Level-2-Traversal-Range/traversal.html"
        )

    whatToShow = Attribute(
        "whatToShow",
        "See http://www.w3.org/TR/DOM-Level-2-Traversal-Range/traversal.html"
        )

    #
    # Methods
    #

    def detach():
        """
        See http://www.w3.org/TR/DOM-Level-2-Traversal-Range/traversal.html
        """

    def nextNode():
        """
        See http://www.w3.org/TR/DOM-Level-2-Traversal-Range/traversal.html
        """

    def previousNode():
        """
        See http://www.w3.org/TR/DOM-Level-2-Traversal-Range/traversal.html
        """

class INodeFilter(Interface):
    """
    See http://www.w3.org/TR/DOM-Level-2-Traversal-Range/traversal.html
    """

    #
    # Definition group Constants returned by acceptNode
    #

    FILTER_ACCEPT = Attribute("FILTER_ACCEPT")
    FILTER_REJECT = Attribute("FILTER_REJECT")
    FILTER_SKIP   = Attribute("FILTER_SKIP")

    #
    # Definition group Constants for whatToShow
    #

    SHOW_ALL                    = Attribute("SHOW_ALL")
    SHOW_ATTRIBUTE              = Attribute("SHOW_ATTRIBUTE")
    SHOW_CDATA_SECTION          = Attribute("SHOW_CDATA_SECTION")
    SHOW_COMMENT                = Attribute("SHOW_COMMENT")
    SHOW_DOCUMENT               = Attribute("SHOW_DOCUMENT")
    SHOW_DOCUMENT_FRAGMENT      = Attribute("SHOW_DOCUMENT_FRAGMENT")
    SHOW_DOCUMENT_TYPE          = Attribute("SHOW_DOCUMENT_TYPE")
    SHOW_ELEMENT                = Attribute("SHOW_ELEMENT")
    SHOW_ENTITY                 = Attribute("SHOW_ENTITY")
    SHOW_ENTITY_REFERENCE       = Attribute("SHOW_ENTITY_REFERENCE")
    SHOW_NOTATION               = Attribute("SHOW_NOTATION")
    SHOW_PROCESSING_INSTRUCTION = Attribute("SHOW_PROCESSING_INSTRUCTION")
    SHOW_TEXT                   = Attribute("SHOW_TEXT")

    #
    # Methods
    #

    def acceptNode(n):
        """
        See http://www.w3.org/TR/DOM-Level-2-Traversal-Range/traversal.html
        """

class ITreeWalker(Interface):
    """
    See http://www.w3.org/TR/DOM-Level-2-Traversal-Range/traversal.html
    """

    #
    # Attributes
    #

    currentNode = Attribute(
        "currentNode",
        "See http://www.w3.org/TR/DOM-Level-2-Traversal-Range/traversal.html"
        )

    expandEntityReferences = Attribute(
        "expandEntityReferences",
        "See http://www.w3.org/TR/DOM-Level-2-Traversal-Range/traversal.html"
        )

    filter = Attribute(
        "filter",
        "See http://www.w3.org/TR/DOM-Level-2-Traversal-Range/traversal.html"
        )

    root = Attribute(
        "root",
        "See http://www.w3.org/TR/DOM-Level-2-Traversal-Range/traversal.html"
        )

    whatToShow = Attribute(
        "whatToShow",
        "See http://www.w3.org/TR/DOM-Level-2-Traversal-Range/traversal.html"
        )

    #
    # Methods
    #

    def firstChild():
        """
        See http://www.w3.org/TR/DOM-Level-2-Traversal-Range/traversal.html
        """

    def lastChild():
        """
        See http://www.w3.org/TR/DOM-Level-2-Traversal-Range/traversal.html
        """

    def nextNode():
        """
        See http://www.w3.org/TR/DOM-Level-2-Traversal-Range/traversal.html
        """

    def nextSibling():
        """
        See http://www.w3.org/TR/DOM-Level-2-Traversal-Range/traversal.html
        """

    def parentNode():
        """
        See http://www.w3.org/TR/DOM-Level-2-Traversal-Range/traversal.html
        """

    def previousNode():
        """
        See http://www.w3.org/TR/DOM-Level-2-Traversal-Range/traversal.html
        """

    def previousSibling():
        """
        See http://www.w3.org/TR/DOM-Level-2-Traversal-Range/traversal.html
        """

class IDocumentTraversal(Interface):
    """
    See http://www.w3.org/TR/DOM-Level-2-Traversal-Range/traversal.html
    """

    def createNodeIterator(root, whatToShow, filter, entityReferenceExpansion):
        """
        See http://www.w3.org/TR/DOM-Level-2-Traversal-Range/traversal.html
        """

    def createTreeWalker(root, whatToShow, filter, entityReferenceExpansion):
        """
        See http://www.w3.org/TR/DOM-Level-2-Traversal-Range/traversal.html
        """