class Document
smx. Document
source: document/Document.js, line 13
The Document class wraps an XMLDocument and provides an easy to use api to interact with it and its contents.
This class can be further extended by mixins from custom modules.
Constructor
new Document(xmlDocument)
source: document/Document.js, line 13
Parameters
-
xmlDocument
{XMLDocument}
Members
_cache:Object
- private
source: document/Document.js, line 36
Contains an id → key map of all processed nodes for easy acccess.
_data:Object
- private
source: document/Document.js, line 43
Namespace for storing custom modules data.
path:String
- readonly
source: document/Document.js, line 53
Gets Uniform Resource Locator Concatenation of path values from parent nodes up to document root
src:String
- readonly
source: document/Document.js, line 63
Gets the source file url for this document.
Methods
getNodeById(id) → {smx.Node}
source: document/Document.js, line 81
Gets the node with the given identifier.
Parameters
-
id
{String}
Returns
-
{smx.Node}
find(selector, [context]) → {Array.<smx.Node>}
source: document/Document.js, line 102
Finds all nodes matching the given selector.
Parameters
-
selector
{String}
:search selector
-
[context]
{smx.Node}
:node context to find inside
Returns
-
{Array.<smx.Node>}