Document
class Document (View source)
Constants
| ARRAY_SIMPLE |
Use with |
| ARRAY_MINIMAL |
Use with |
| ARRAY_COMPLETE |
Use with |
| HTML |
Use for define format |
| XML |
|
| ERROR |
Constants to treat errors issued by libXML as exceptions |
| FATAL |
|
| WARNING |
|
Methods
Create a Document instance
Define libXML errors as exceptions
Define libXML options for load a document or string
Define libXML options for dump or save a document as file
Get original document
Get root element
Load string or file
Save document to file
Convert Array to DOM
Convert DOM to Array
Details
__construct(int $type = 0)
Create a Document instance
static
setSeverityLevels(int $levels)
Define libXML errors as exceptions
setLoadOptions(int $options)
Define libXML options for load a document or string
setSaveOptions(int $options)
Define libXML options for dump or save a document as file
DOMDocument
document()
Get original document
DOMDocument
root()
Get root element
Selector
selector()
Gets all elements that match the CSS selector
array
getNamespaces(DOMElement $element)
Get namespace attributes from root element or specific element
load(string $source, bool $file = false)
Load string or file
dump(DOMNode $node)
Convert document to XML string, HTML string or array
save(string $file)
Save document to file
fromArray(array $data)
Convert Array to DOM
array
toArray(int $format)
Convert DOM to Array