OpenQuizz
Une application de gestion des contenus pédagogiques
|
Public Member Functions | |
def | __init__ (self, name) |
def | __str__ (self) |
def | __repr__ (self) |
def | appendChild (self, node) |
def | insertText (self, data, insertBefore=None) |
def | insertBefore (self, node, refNode) |
def | removeChild (self, node) |
def | reparentChildren (self, newParent) |
def | cloneNode (self) |
def | hasContent (self) |
Data Fields | |
name | |
parent | |
value | |
attributes | |
childNodes | |
Represents an item in the tree
def __init__ | ( | self, | |
name | |||
) |
Creates a Node :arg name: The tag name associated with the node
def __repr__ | ( | self | ) |
def __str__ | ( | self | ) |
def appendChild | ( | self, | |
node | |||
) |
Insert node as a child of the current node :arg node: the node to insert
def cloneNode | ( | self | ) |
Return a shallow copy of the current node i.e. a node with the same name and attributes but with no parent or child nodes
def hasContent | ( | self | ) |
Return true if the node has children or text, false otherwise
def insertBefore | ( | self, | |
node, | |||
refNode | |||
) |
Insert node as a child of the current node, before refNode in the list of child nodes. Raises ValueError if refNode is not a child of the current node :arg node: the node to insert :arg refNode: the child node to insert the node before
def insertText | ( | self, | |
data, | |||
insertBefore = None |
|||
) |
Insert data as text in the current node, positioned before the start of node insertBefore or to the end of the node's text. :arg data: the data to insert :arg insertBefore: True if you want to insert the text before the node and False if you want to insert it after the node
def removeChild | ( | self, | |
node | |||
) |
Remove node from the children of the current node :arg node: the child node to remove
def reparentChildren | ( | self, | |
newParent | |||
) |
Move all the children of the current node to newParent. This is needed so that trees that don't store text as nodes move the text in the correct way :arg newParent: the node to move all this node's children to
attributes |
childNodes |
name |
parent |
value |