YXmlElement
Extends:
An YXmlElement imitates the behavior of a {@link https://developer.mozilla.org/en-US/docs/Web/API/Element|Dom Element}.
- An YXmlElement has attributes (key value pairs)
- An YXmlElement has childElements that must inherit from YXmlElement
Constructor Summary
Public Constructor | ||
public |
|
Member Summary
Public Members | ||
public |
nodeName: * |
Method Summary
Public Methods | ||
public |
getAttribute(attributeName: String): String Returns an attribute value that belongs to the attribute name. |
|
public |
Returns all attribute name/value pairs in a JSON Object. |
|
public |
removeAttribute(attributeName: String): * Removes an attribute from this YXmlElement. |
|
public |
setAttribute(attributeName: String, attributeValue: String): * Sets or updates an attribute. |
|
public |
toDom(_document: Document, hooks: Object<key:hookDefinition>, binding: DomBinding): Element Creates a Dom Element that mirrors this YXmlElement. |
|
public |
Returns the string representation of this YXmlElement. |
Inherited Summary
From class Type | ||
public |
Compute the path from this type to the specified target. |
|
public |
Observe all events that are created on this type. |
|
public |
observeDeep(f: Function) Observe all events that are created by this type and its children. |
|
public |
Unregister an observer function. |
|
public |
Unregister an observer function. |
From class YArray | ||
public get |
length: * Computes the length of this YArray. |
|
public |
[Symbol.iterator](): {"next": *, "_item": *, "_itemElement": *, "_count": *} |
|
public |
delete(index: Integer, length: Integer) Deletes elements starting from an index. |
|
public |
Executes a provided function on once on overy element of this YArray. |
|
public |
get(index: Integer): * Returns the i-th element from a YArray. |
|
public |
Inserts new content at an index. |
|
public |
Returns an Array with the result of calling a provided function on every element of this YArray. |
|
public |
Appends content to this YArray. |
|
public |
Transforms this YArray to a JavaScript Array. |
|
public |
Transforms this Shared Type to a JSON object. |
From class YXmlFragment | ||
public |
createTreeWalker(filter: Function): TreeWalker Create a subtree of childNodes. |
|
public |
querySelector(query: CSS_Selector): YXmlElement Returns the first YXmlElement that matches the query. |
|
public |
querySelectorAll(query: CSS_Selector): Array<YXmlElement> Returns all YXmlElements that match the query. |
|
public |
toDom(_document: Document, hooks: Object<key:hookDefinition>, binding: DomBinding): Element Creates a Dom Element that mirrors this YXmlElement. |
|
public |
Get the string representation of all the children of this YXmlFragment. |
Public Constructors
Public Members
public nodeName: * source
Public Methods
public getAttribute(attributeName: String): String source
Returns an attribute value that belongs to the attribute name.
Params:
Name | Type | Attribute | Description |
attributeName | String | The attribute name that identifies the queried value. |
public removeAttribute(attributeName: String): * source
Removes an attribute from this YXmlElement.
Params:
Name | Type | Attribute | Description |
attributeName | String | The attribute name that is to be removed. |
Return:
* |
public setAttribute(attributeName: String, attributeValue: String): * source
Sets or updates an attribute.
Return:
* |
public toDom(_document: Document, hooks: Object<key:hookDefinition>, binding: DomBinding): Element source
Creates a Dom Element that mirrors this YXmlElement.
Override:
YXmlFragment#toDomParams:
Name | Type | Attribute | Description |
_document | Document |
|
The document object (you must define this when calling this method in nodejs) |
hooks | Object<key:hookDefinition> |
|
Optional property to customize how hooks are presented in the DOM |
binding | DomBinding |
|
You should not set this property. This is used if DomBinding wants to create a association to the created DOM type. |
public toString(): String source
Returns the string representation of this YXmlElement. The attributes are ordered by attribute-name, so you can easily use this method to compare YXmlElements