Home >Backend Development >PHP Tutorial >PHP XML operation class DOMDocument_PHP tutorial
DOMDocument related content.
Attributes:
Attributes stores the node’s attribute list (read-only)
childNodes stores the node’s child node list (read-only)
dataType returns this node The data type of
Definition is the definition of the node given in DTD or XML mode (read-only)
Doctype specifies the document type node (read-only)
documentElement returns the root element of the document (readable and writable)
firstChild returns the first child node of the current node (read-only)
Implementation returns the XMLDOMImplementation object
lastChild returns the last child node of the current node (read-only)
nextSibling returns the next sibling node of the current node ( Read only)
nodeName returns the name of the node (read only)
nodeType returns the type of the node (read only)
nodeTypedValue stores the node value (readable and writable)
nodeValue returns the text of the node (readable) Write)
ownerDocument returns the root document containing this node (read-only)
parentNode returns the parent node (read-only)
Parsed returns whether this node and its child nodes have been parsed (read-only)
Prefix Returns the namespace prefix (read-only)
preserveWhiteSpace Specifies whether to preserve whitespace (readable and writable)
previousSibling Returns the previous sibling node of this node (read-only)
Text Returns the text of this node and its descendants Content (readable and writable)
url Returns the URL of the recently loaded XML document (read-only)
Xml Returns the XML representation of the node and its descendants (read-only)
Method:
appendChild adds a new child node to the current node and places it after the last child node
cloneNode returns a copy of the current node
createAttribute creates a new attribute
createCDATASection creates a include Given a CDATA segment of data
createComment creates a comment node
createDocumentFragment creates a DocumentFragment object
createElement creates an element node
createEntityReference creates an EntityReference object
createNode creates a given type, name and namespace Node
createPorcessingInstruction creates an operation instruction node
createTextNode creates a text node including the given data
getElementsByTagName returns a collection of elements with the specified name
hasChildNodes returns whether the current node has child nodes
insertBefore before the specified node Insert child node
Load Import the XML document at the specified location
loadXML Import the XML document with the specified string
removeChild Remove the specified child node from the child node list
replaceChild Replace the specified child node from the child node list The child node
Save saves the XML file to the specified node
selectNodes performs the specified matching on the node and returns the matching node list
selectSingleNode performs the specified matching on the node and returns the first matching node
transformNode uses the specified style sheet to transform the node and its descendants
transformNodeToObject uses the specified style sheet to transform the node and its descendants
Instance gets the label attribute. Value:
Me. xml