Base Framework
|
DOM document. More...
#include <base/xml/Document.h>
Inherits Node.
Public Types | |
typedef Array< Pair< String, String > > | PrefixNamespace |
![]() | |
enum | NodeType { ELEMENT_NODE, ATTRIBUTE_NODE, TEXT_NODE, CDATA_SECTION_NODE, ENTITY_REFERENCE_NODE, ENTITY_NODE, PROCESSING_INSTRUCTION_NODE, COMMENT_NODE, DOCUMENT_NODE, DOCUMENT_TYPE_NODE, DOCUMENT_FRAGMENT_NODE, NOTATION_NODE, ATTRIBUTE_DECL_NODE, ELEMENT_DECL_NODE, ENTITY_DECL_NODE } |
Public Member Functions | |
Document () | |
Document (ShadowDocument document) noexcept | |
DocumentType | getDocumentType () noexcept |
DOMImplementation | getImplementation () noexcept |
DocumentType | createAndSetDocumentType (const String &qualifiedName, const String &publicId, const String &systemId) |
Element | getDocumentElement () noexcept |
Attribute | createAttribute (const String &name) |
Attribute | createAttributeNS (const String &namespaceURI, const String &qualifiedName) |
Element | createElement (const String &name) |
Element | createElementNS (const String &namespaceURI, const String &qualifiedName) |
DocumentFragment | createDocumentFragment () |
Text | createText (const String &data) |
Comment | createComment (const String &data) |
CDATASection | createCDATASection (const String &data) |
ProcessingInstruction | createProcessingInstruction (const String &target, const String &data) |
EntityReference | createEntityReference (const String &name) |
Element | getElementById (const String &elementId) |
Node | selectSingleNode (const String &xpath, const PrefixNamespace &namespaces=PrefixNamespace()) |
Array< Node * > | getXPath (const String &xpath, const PrefixNamespace &namespaces=PrefixNamespace()) |
Attribute | createAttribute (const String &name, const String &value) |
Node | importNode (Node importedNode, bool deep) |
void | doXIncludeSubstitution () |
void | save (const String &filename) |
bool | validate () const |
bool | validate (Node node) const |
void | destroy () |
![]() | |
Node () noexcept | |
Node (const Node ©) noexcept | |
Node & | operator= (const Node &assign) noexcept |
Node | appendChild (Node child) |
Node | insertBefore (Node newChild, Node refChild) |
Node | removeChild (Node child) |
Node | replaceChild (Node newChild, Node oldChild) |
Node | cloneNode (bool deep) |
String | getLocalName () const noexcept |
String | getNamespaceURI () const noexcept |
String | getName () const |
NodeType | getType () const |
String | getValue () const |
ShadowDocument | getOwnerDocument () noexcept |
String | getPrefix () const |
void | setPrefix (const String &prefix) |
Node | getParent () const noexcept |
Node | getPreviousSibling () const noexcept |
Node | getNextSibling () const noexcept |
Node | getFirstChild () const |
Node | getLastChild () const |
bool | hasAttributes () const noexcept |
bool | hasChildNodes () const |
bool | isSupported (const String &feature, const String &version) const noexcept |
void | normalize () |
void | setValue (const String &value) |
bool | isValid () const noexcept |
bool | isInvalid () const noexcept |
bool | isUnlinked () const noexcept |
bool | isSame (const Node &node) const noexcept |
bool | operator== (const Node &node) const noexcept |
bool | hasSameOwner (const Node &node) const noexcept |
bool | isAncestor (const Node &node) const noexcept |
operator bool () const noexcept | |
~Node () noexcept | |
Protected Member Functions | |
Document (void *context) noexcept | |
![]() | |
Node (void *_context) noexcept | |
void * | getContext () noexcept |
const void * | getContext () const noexcept |
DOM document.
DOM document.
typedef Array<Pair<String, String> > Document::PrefixNamespace |
Prefix and namespace pair.
|
inlineprotectednoexcept |
Internal constructor.
Document::Document | ( | ) |
Initializes the document as invalid.
|
inlinenoexcept |
Initializes the document as invalid.
DocumentType Document::createAndSetDocumentType | ( | const String & | qualifiedName, |
const String & | publicId, | ||
const String & | systemId | ||
) |
Creates and sets a document type object for this document.
Creates a new attribute.
Creates an Attribute of the given qualified name and namespace URI.
CDATASection Document::createCDATASection | ( | const String & | data | ) |
Creates a CDATASection node whose value is the specified string.
Creates a Comment node given the specified string.
DocumentFragment Document::createDocumentFragment | ( | ) |
Creates an empty DocumentFragment node.
Creates an element of the type specified.
Creates an element of the given qualified name and namespace URI.
EntityReference Document::createEntityReference | ( | const String & | name | ) |
Creates an EntityReference node.
ProcessingInstruction Document::createProcessingInstruction | ( | const String & | target, |
const String & | data | ||
) |
Creates a ProcessingInstruction node given the specified target and data strings.
void Document::destroy | ( | ) |
Destroys the document.
void Document::doXIncludeSubstitution | ( | ) |
Do XInclude substitution.
|
noexcept |
This is a convenience attribute that allows direct access to the child node that is the root element of the document.
|
noexcept |
The Document Type Declaration associated with this document.
Returns the Element whose ID is given by elementId.
|
noexcept |
The DOMImplementation object that handles this document.
Array<Node*> Document::getXPath | ( | const String & | xpath, |
const PrefixNamespace & | namespaces = PrefixNamespace() |
||
) |
Returns the result for the given XPath expression.
Imports a node from another document to this document. The returned node has no parent. The source node is not altered or removed from the original document; this method creates a new copy of the source node.
void Document::save | ( | const String & | filename | ) |
Save to document to the specified file.
filename | The name of the file. |
Node Document::selectSingleNode | ( | const String & | xpath, |
const PrefixNamespace & | namespaces = PrefixNamespace() |
||
) |
Returns the first node for the given XPath expression.
bool Document::validate | ( | ) | const |
Returns true if the document is valid.
bool Document::validate | ( | Node | node | ) | const |
Returns true if the tree is valid.