XML
| Module | ejs |
| Namespace | intrinsic |
| Definition | final class XML |
| Specified | Ecma-357. |
| Inheritance | XML Object |
The XML class, and the entire XML API, is based on ECMA-357, ECMAScript for XML (E4X).
The XML class is a core class in the E4X specification; it provides the ability to load, parse and save XML documents.
Properties
| Qualifiers | Property | Type | Description |
|---|---|---|---|
| public static | ignoreComments | Boolean | TODO - doc. |
| public static | ignoreProcessingInstructions | Boolean | |
| public static | ignoreWhitespace | Boolean | |
| public static | prettyIndent | Boolean | |
| public static | prettyPrinting | Boolean |
XML Methods
| Qualifiers | Method |
|---|---|
| public | addNamespace(ns: Namespace): XML |
| public | appendChild(child: XML): XML |
| Append a child to this XML object. | |
| public | attribute(name: String): XMLList |
| Get an XMLList containing all of the attributes of this object with the given name. | |
| public | attributes(): XMLList |
| Get an XMLList containing all of the attributes of this object. | |
| public | child(name: String): XMLList |
| Get an XMLList containing the list of children (properties) in this XML object with the given name. | |
| public | childIndex(): Number |
| Get the position of this object within the context of its parent. | |
| public | children(): XMLList |
| Get an XMLList containing the children (properties) of this object in order. | |
| public | comments(): XMLList |
| Get an XMLList containing the properties of this object that are comments. | |
| public | contains(obj: Object): Boolean |
| Compare an XML object to another one or an XMLList with only one XML object in it. | |
| public | copy(): XML |
| Deep copy an XML object. | |
| public | defaultSettings(): Object |
| Get the defaults settings for an XML object. | |
| public | descendants(name: String): Object |
| Get all the descendants (that have the same name) of this XML object. | |
| public | elements(name: String): XMLList |
| Get all the children of this XML node that are elements having the given name. | |
| iterator override | get(deep: Boolean): Iterator |
| Get an iterator for this node to be used by "for (v in node)". | |
| iterator override | getValues(deep: Boolean): Iterator |
| Get an iterator for this node to be used by "for each (v in node)". | |
| public | hasComplexContent(): Boolean |
| Determine whether this XML object has complex content. | |
| public | hasSimpleContent(): Boolean |
| Determine whether this XML object has simple content. | |
| public | inScopeNamespaces(): Array |
| public | insertChildAfter(marker: Object, child: Object): XML |
| Insert a child object into an XML object immediately after a specified marker object. | |
| public | insertChildBefore(marker: Object, child: Object): XML |
| Insert a child object into an XML object immediately before a specified marker object. | |
| public override | length(): Number |
| Return the length of an XML object; the length is defined as 1. | |
| public | load(filename: String): Void |
| public | localName(): String |
| Get the local name portion of the complete name of this XML object. | |
| public | name(): String |
| Get the qualified name of this XML object. | |
| public | namespace(prefix: String): Object |
| public | namespaceDeclarations(): Array |
| public | nodeKind(): String |
| Get the kind of node this XML object is. | |
| public | normalize(): XML |
| Merge adjacent text nodes into one text node and eliminate empty text nodes. | |
| public | parent(): XML |
| Get the parent of this XML object. | |
| public | prependChild(child: Object): XML |
| Insert a child object into an XML object immediately before all existing properties. | |
| public | processingInstructions(name: String): XMLList |
| Get all the children of this XML node that are processing instructions having the given name. | |
| public | replace(property: Object, value: Object): Void |
| Change the value of a property. | |
| public | save(filename: String): Void |
| public | setChildren(properties: Object): XML |
| Replace all the current properties of this XML object with a new set. | |
| public | setLocalName(name: String): Void |
| Set the local name portion of the complete name of this XML object. | |
| public | setName(name: String): Void |
| Set the qualified name of this XML object. | |
| public | setSettings(settings: Object): Void |
| Configure the settings for this XML object. | |
| public | settings(): Object |
| Get the settings for this XML object. | |
| public | text(name: String): XMLList |
| Get all the properties of this XML node that are text nodes having the given name. | |
| public override | toString(): String |
| Provides a string representation of the XML object. | |
| public | toXMLString(): String |
| Provides an XML-encoded version of the XML object that includes the tags. | |
| XML(value: Object) | |
| XML Constructor. |