Hidden |
---|
DO NOT EDIT THE CONTENT OF THIS PAGE DIRECTLY, UNLESS YOU KNOW WHAT YOU'RE DOING.
THE STRUCTURE OF THE CONTENT IS VITAL IN BEING ABLE TO EXTRACT CHANGES FROM THE PAGE AND MERGE THEM BACK INTO SERVOY SOURCE |
Creating XML objects
from a string
Code Block |
---|
var myXml = new XML('<test level="1"><test2 level="2">A value</test2></test>'); |
using XML object notation
Code Block |
---|
var myXml =
<test level="1">
<test2 level="2">A value</test2>
</test>; |
using JavaScript variables
Code Block |
---|
var myValue = 'hello, some value!';
var myXml =
<test level="1">
<test2 level="2">{myValue}</test2>
</test>; |
Accessing the XML
General
Code Block |
---|
var myXml = new XML('<test level="1"><test2 level="2">A value</test2></test>');
application.output(myXml.test2); //outputs 'A value'
|
A specific index on subnodes
Code Block |
---|
var myXml = new XML('<test level="1"><test2 level="2">A value</test2><test2 level=2>Another value</test2></test>');
application.output(myXml.test2[1]); //outputs 'Another value'
|
XML in Action!
Video |
---|
| http://www.servoy.com/docs/servoy_4/tutorials/qv_javascript_XML/JS_XML.swf |
---|
| http://www.servoy.com/docs/servoy_4/tutorials/qv_javascript_XML/JS_XML.swf |
---|
|
HTML Table |
---|
|
Table Row (tr) |
---|
| Table Head (th) |
---|
| Property Summary |
|
Table Body (tbody) |
---|
Table Row (tr) |
---|
Table Cell (td) |
---|
#ignoreComments If set to true, then comments in the XML are ignored when constructing new XML objects. |
|
|
Table Body (tbody) |
---|
Table Row (tr) |
---|
Table Cell (td) |
---|
#ignoreWhitespace If set to true, then whitespace in the XML is ignored when constructing new XML objects. |
|
|
Table Body (tbody) |
---|
Table Row (tr) |
---|
Table Cell (td) |
---|
#prettyIndent The amount of positions used when indenting child nodes are relative to their parent if prettyPrinting is enabled. |
|
|
Table Body (tbody) |
---|
Table Row (tr) |
---|
Table Cell (td) |
---|
#prettyPrinting If set to true, then toString() and toXMLString() methods will normalize the output to achieve a uniform appearance. |
|
|
|
HTML Table |
---|
|
Table Row (tr) |
---|
| Table Head (th) |
---|
| Method Summary |
|
Table Body (tbody) |
---|
Table Row (tr) |
---|
Table Cell (td) |
---|
#addNamespace(namespaceToAdd) Takes one argument which can be a string with a namespace URI or a Namespace object and adds the argument to the in scope namespaces of this XML object. |
|
|
Table Body (tbody) |
---|
Table Row (tr) |
---|
Table Cell (td) |
---|
#appendChild(childToAppend) Appends a new child at the end of this XML object's properties, the changed XML object is then returned. |
|
|
Table Body (tbody) |
---|
Table Row (tr) |
---|
Table Cell (td) |
---|
#attribute(attributeName) Takes a single argument with the attribute name and returns an XMLList with attributes matching the argument. |
|
|
Table Body (tbody) |
---|
Table Row (tr) |
---|
Table Cell (td) |
---|
#attributes() Returns an XMLList with the attributes of this XML object which are in no namespace. |
|
|
Table Body (tbody) |
---|
Table Row (tr) |
---|
Table Cell (td) |
---|
#child(propertyName) Returns an XMLList with children matching the property name. |
|
|
Table Body (tbody) |
---|
Table Row (tr) |
---|
Table Cell (td) |
---|
#childIndex() If the XML object has no parent then the special number NaN is returned, otherwise the ordinal position the object has in the context of its parent is returned. |
|
|
Table Body (tbody) |
---|
Table Row (tr) |
---|
Table Cell (td) |
---|
#children() Returns an XMLList with the child nodes of this XML object. |
|
|
Table Body (tbody) |
---|
Table Row (tr) |
---|
Table Cell (td) |
---|
#comments() Returns an XMLList with the comment nodes which are children of this XML object. |
|
|
Table Body (tbody) |
---|
Table Row (tr) |
---|
Table Cell (td) |
---|
#contains(value) Calling xmlObject. |
|
|
Table Body (tbody) |
---|
Table Row (tr) |
---|
Table Cell (td) |
---|
#copy() Returns a deep copy of the XML object it is called on where the internal parent property is set to null |
|
|
Table Body (tbody) |
---|
Table Row (tr) |
---|
Table Cell (td) |
---|
#defaultSettings() Returns an object containing the default XML settings. |
|
|
Table Body (tbody) |
---|
Table Row (tr) |
---|
Table Cell (td) |
---|
#descendants([name]) Returns an XMLList with the descendants matching the passed name argument or with all descendants if no argument is passed. |
|
|
Table Body (tbody) |
---|
Table Row (tr) |
---|
Table Cell (td) |
---|
#elements([name]) Takes one optional argument, the name of elements you are looking for, and returns an XMLList with all matching child elements. |
|
|
Table Body (tbody) |
---|
Table Row (tr) |
---|
Table Cell (td) |
---|
#hasComplexContent() Returns false for XML objects of node kind 'text', 'attribute', 'comment', and 'processing-instruction'. |
|
|
Table Body (tbody) |
---|
Table Row (tr) |
---|
Table Cell (td) |
---|
#hasOwnProperty(propertyName) Returns true if the XML object the method is called on has a property of that name. |
|
|
Table Body (tbody) |
---|
Table Row (tr) |
---|
Table Cell (td) |
---|
#hasSimpleContent() Returns true for XML objects of node kind text or attribute. |
|
|
Table Body (tbody) |
---|
Table Row (tr) |
---|
Table Cell (td) |
---|
#inScopeNamespaces() Returns an array of Namespace objects representing the namespace that are in scope for this XML object. |
|
|
Table Body (tbody) |
---|
Table Row (tr) |
---|
Table Cell (td) |
---|
#insertChildAfter(childToInserAfter, childToInsert) Takes two arguments, an existing child to insert after and the new child to be inserted. |
|
|
Table Body (tbody) |
---|
Table Row (tr) |
---|
Table Cell (td) |
---|
#insertChildBefore(childToInsertBefore, childToInsert) Takes two arguments, an existing child to insert before and the new child to be inserted. |
|
|
Table Body (tbody) |
---|
Table Row (tr) |
---|
Table Cell (td) |
---|
#length() This always returns 1. |
|
|
Table Body (tbody) |
---|
Table Row (tr) |
---|
Table Cell (td) |
---|
#localName() returns the local name part if the XML object has a name. |
|
|
Table Body (tbody) |
---|
Table Row (tr) |
---|
Table Cell (td) |
---|
#name() Returns the qualified name (a QName object) of the XML object it is called |
|
|
Table Body (tbody) |
---|
Table Row (tr) |
---|
Table Cell (td) |
---|
#namespace([prefix]) If no argument is passed to the method then it returns the namespace associated with the qualified name of this XML object. |
|
|
Table Body (tbody) |
---|
Table Row (tr) |
---|
Table Cell (td) |
---|
#namespaceDeclarations() Returns an array with the namespace declarations associated with the XML object it is called on. |
|
|
Table Body (tbody) |
---|
Table Row (tr) |
---|
Table Cell (td) |
---|
#nodeKind() Returns a string denoting the kind of node this XML object represents. |
|
|
Table Body (tbody) |
---|
Table Row (tr) |
---|
Table Cell (td) |
---|
#normalize() Returns this XML object after normalizing all text content. |
|
|
Table Body (tbody) |
---|
Table Row (tr) |
---|
Table Cell (td) |
---|
#parent() Returns the parent XML object of this XML object or null if there is no parent. |
|
|
Table Body (tbody) |
---|
Table Row (tr) |
---|
Table Cell (td) |
---|
#prependChild(childToPrepend) Iinserts the given value as the first child of the XML object and returns the XML object. |
|
|
Table Body (tbody) |
---|
Table Row (tr) |
---|
Table Cell (td) |
---|
#processingInstructions([name]) If no argument is passed in then the method returns an XMLList with all the children of the XML object which are processing instructions. |
|
|
Table Body (tbody) |
---|
Table Row (tr) |
---|
Table Cell (td) |
---|
#propertyIsEnumerable(propertyName) Returns true if the property name is '0' and false otherwise. |
|
|
Table Body (tbody) |
---|
Table Row (tr) |
---|
Table Cell (td) |
---|
#removeNamespace(namespace) Removes the namespace from the in scope namespaces of this XML object if the namespace is not used for the qualified name of the object or its attributes. |
|
|
Table Body (tbody) |
---|
Table Row (tr) |
---|
Table Cell (td) |
---|
#replace(propertyName, replacementValue) Takes two arguments, the property name of the property / properties to be replaced, and the value to replace the properties. |
|
|
Table Body (tbody) |
---|
Table Row (tr) |
---|
Table Cell (td) |
---|
#setChildren(value) Replaces all children of the XML object with this value. |
|
|
Table Body (tbody) |
---|
Table Row (tr) |
---|
Table Cell (td) |
---|
#setLocalName(name) Changes the local name of this XML object to the name passed in. |
|
|
Table Body (tbody) |
---|
Table Row (tr) |
---|
Table Cell (td) |
---|
#setName(name) Replaces the name of this XML object with the name passed in. |
|
|
Table Body (tbody) |
---|
Table Row (tr) |
---|
Table Cell (td) |
---|
#setNamespace(namespace) Changes the namespace associated with the name of this XML object to the new namespace. |
|
|
Table Body (tbody) |
---|
Table Row (tr) |
---|
Table Cell (td) |
---|
#setSettings([settings]) Allows the global XML settings to be adjusted or restored to their default values. |
|
|
Table Body (tbody) |
---|
Table Row (tr) |
---|
Table Cell (td) |
---|
#settings() Returns an object containing the global XML settings. |
|
|
Table Body (tbody) |
---|
Table Row (tr) |
---|
Table Cell (td) |
---|
#text() Returns an XMLList with all the children of this XML object that represent text nodes. |
|
|
Table Body (tbody) |
---|
Table Row (tr) |
---|
Table Cell (td) |
---|
#toString() Returns a convenient string value of this XML object. |
|
|
Table Body (tbody) |
---|
Table Row (tr) |
---|
Table Cell (td) |
---|
#toXMLString() Returns a string with the serialized XML markup for this XML object. |
|
|
Table Body (tbody) |
---|
Table Row (tr) |
---|
Table Cell (td) |
---|
#valueOf() The method simply returns the XML object it is called on. |
|
|
|
HTML Table |
---|
id | property |
---|
class | servoy sDetail |
---|
|
Table Row (tr) |
---|
| Table Head (th) |
---|
| Property Details |
|
Table Body (tbody) |
---|
id | ignoreComments |
---|
class | node |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
If set to true, then comments in the XML are ignored when constructing new XML objects. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
var element = <foo><!-- my comment --><bar/></foo>;
application.output(element.comments().length());
application.output(element.toXMLString());
XML.ignoreComments = false;
element = <foo><!-- my comment --><bar/></foo>;
application.output(element.comments().length());
application.output(element.toXMLString());
|
|
|
|
|
Table Body (tbody) |
---|
id | ignoreProcessingInstructions |
---|
class | node |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
ignoreProcessingInstructions |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
If set to true, then processing instructions are ignored when constructing new XML objects. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
XML.ignoreProcessingInstructions=false;
var xmlElement = <publishing><?process author="yes"?><author type="leadership">John C. Maxwell</author></publishing>;
application.output(" Element = "+ xmlElement.toXMLString());
|
|
|
|
|
Table Body (tbody) |
---|
id | ignoreWhitespace |
---|
class | node |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
ignoreWhitespace |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
If set to true, then whitespace in the XML is ignored when constructing new XML objects. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
XML.ignoreWhitespace = false;
var xmlElement =
<publishing>
<author>John C. Maxwell</author>
</publishing>;
application.output(xmlElement.toString());
|
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
prettyIndent |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
The amount of positions used when indenting child nodes are relative to their parent if prettyPrinting is enabled. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
var xmlElement = <publishing><author>Tom DeMarco</author><author>Roger S. Pressman</author></publishing>;
application.output(xmlElement.toXMLString());
XML.prettyPrinting = true;
XML.prettyIndent = 4;
xmlElement = <publishing><author>Tom DeMarco</author><author>Roger S. Pressman</author></publishing>;
application.output(xmlElement.toXMLString());
|
|
|
|
|
Table Body (tbody) |
---|
id | prettyPrinting |
---|
class | node |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
prettyPrinting |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
If set to true, then toString() and toXMLString() methods will normalize the output to achieve a uniform appearance. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
var xmlElement = <publishing><author>Tom DeMarco</author><author>Roger S. Pressman</author></publishing>;
application.output(xmlElement.toXMLString());
XML.prettyPrinting = true;
XML.prettyIndent = 4;
xmlElement = <publishing><author>Tom DeMarco</author><author>Roger S. Pressman</author></publishing>;
application.output(xmlElement.toXMLString());
|
|
|
|
|
|
HTML Table |
---|
id | function |
---|
class | servoy sDetail |
---|
|
Table Row (tr) |
---|
| Table Head (th) |
---|
| Method Details |
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
addNamespace |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
style | float: left; margin-right: 5px; |
---|
| XML |
Span |
---|
style | float: left; font-weight: bold; |
---|
id | iets |
---|
| addNamespace |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Takes one argument which can be a string with a namespace URI or a Namespace object and adds the argument to the in scope namespaces of this XML object. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters {String} namespaceToAdd |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns XML |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
xml.addNamespace(namespaceToAdd)
|
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
appendChild |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
style | float: left; margin-right: 5px; |
---|
| XML |
Span |
---|
style | float: left; font-weight: bold; |
---|
id | iets |
---|
| appendChild |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Appends a new child at the end of this XML object's properties, the changed XML object is then returned. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters {XML} childToAppend |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns XML |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
xml.appendChild(childToAppend)
|
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
style | float: left; margin-right: 5px; |
---|
| XMLList |
Span |
---|
style | float: left; font-weight: bold; |
---|
id | iets |
---|
| attribute |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Takes a single argument with the attribute name and returns an XMLList with attributes matching the argument. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters {String} attributeName |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
xml.attribute(attributeName)
|
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
attributes |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
style | float: left; margin-right: 5px; |
---|
| XMLList |
Span |
---|
style | float: left; font-weight: bold; |
---|
id | iets |
---|
| attributes |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns an XMLList with the attributes of this XML object which are in no namespace. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
xml.attributes()
|
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
style | float: left; margin-right: 5px; |
---|
| XMLList |
Span |
---|
style | float: left; font-weight: bold; |
---|
id | iets |
---|
| child |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns an XMLList with children matching the property name. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters {String} propertyName |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
xml.child(childPropertyName)
|
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
childIndex |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
style | float: left; margin-right: 5px; |
---|
| Number |
Span |
---|
style | float: left; font-weight: bold; |
---|
id | iets |
---|
| childIndex |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
If the XML object has no parent then the special number NaN is returned, otherwise the ordinal position the object has in the context of its parent is returned. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
xml.childIndex()
|
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
style | float: left; margin-right: 5px; |
---|
| XMLList |
Span |
---|
style | float: left; font-weight: bold; |
---|
id | iets |
---|
| children |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns an XMLList with the child nodes of this XML object. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
xml.children()
|
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
style | float: left; margin-right: 5px; |
---|
| XMLList |
Span |
---|
style | float: left; font-weight: bold; |
---|
id | iets |
---|
| comments |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns an XMLList with the comment nodes which are children of this XML object. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
xml.comments()
|
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
style | float: left; margin-right: 5px; |
---|
| Boolean |
Span |
---|
style | float: left; font-weight: bold; |
---|
id | iets |
---|
| contains |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Calling xmlObject.contains(value) yields the same result as the equality comparison xmlObject == value |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters {Object} value |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
xml.contains(value)
|
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
style | float: left; margin-right: 5px; |
---|
| XML |
Span |
---|
style | float: left; font-weight: bold; |
---|
id | iets |
---|
| copy |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns a deep copy of the XML object it is called on where the internal parent property is set to null |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns XML |
|
|
Table Body (tbody) |
---|
id | defaultSettings |
---|
class | node |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
defaultSettings |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
style | float: left; margin-right: 5px; |
---|
| Object |
Span |
---|
style | float: left; font-weight: bold; |
---|
id | iets |
---|
| defaultSettings |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns an object containing the default XML settings. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
xml.defaultSettings()
|
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
descendants |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
style | float: left; margin-right: 5px; |
---|
| XMLList |
Span |
---|
style | float: left; font-weight: bold; |
---|
id | iets |
---|
| descendants |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns an XMLList with the descendants matching the passed name argument or with all descendants if no argument is passed. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters {String} [name] |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
xml.descendants([name])
|
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
style | float: left; margin-right: 5px; |
---|
| XMLList |
Span |
---|
style | float: left; font-weight: bold; |
---|
id | iets |
---|
| elements |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Takes one optional argument, the name of elements you are looking for, and returns an XMLList with all matching child elements. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters {String} [name] |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
xml.elements([name])
|
|
|
|
|
Table Body (tbody) |
---|
id | hasComplexContent |
---|
class | node |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
hasComplexContent |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
style | float: left; margin-right: 5px; |
---|
| Boolean |
Span |
---|
style | float: left; font-weight: bold; |
---|
id | iets |
---|
| hasComplexContent |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns false for XML objects of node kind 'text', 'attribute', 'comment', and 'processing-instruction'. For objects of kind 'element' it checks whether the element has at least one child element. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
xml.hasComplexContent()
|
|
|
|
|
Table Body (tbody) |
---|
id | hasOwnProperty |
---|
class | node |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
hasOwnProperty |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
style | float: left; margin-right: 5px; |
---|
| Boolean |
Span |
---|
style | float: left; font-weight: bold; |
---|
id | iets |
---|
| hasOwnProperty |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns true if the XML object the method is called on has a property of that name. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters {String} propertyName |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
xml.hasOwnProperty(propertyName)
|
|
|
|
|
Table Body (tbody) |
---|
id | hasSimpleContent |
---|
class | node |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
hasSimpleContent |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
style | float: left; margin-right: 5px; |
---|
| Boolean |
Span |
---|
style | float: left; font-weight: bold; |
---|
id | iets |
---|
| hasSimpleContent |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns true for XML objects of node kind text or attribute. For XML objects of node kind element it returns true if the element has no child elements and false otherwise. For other node kinds (comment, processing instruction) the method always returns false. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
xml.hasSimpleContent()
|
|
|
|
|
Table Body (tbody) |
---|
id | inScopeNamespaces |
---|
class | node |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
inScopeNamespaces |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
style | float: left; margin-right: 5px; |
---|
| Array |
Span |
---|
style | float: left; font-weight: bold; |
---|
id | iets |
---|
| inScopeNamespaces |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns an array of Namespace objects representing the namespace that are in scope for this XML object. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns Array |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
xml.inScopeNamespaces()
|
|
|
|
|
Table Body (tbody) |
---|
id | insertChildAfter |
---|
class | node |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
insertChildAfter |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
style | float: left; margin-right: 5px; |
---|
| XML |
Span |
---|
style | float: left; font-weight: bold; |
---|
id | iets |
---|
| insertChildAfter |
Span |
---|
| (childToInserAfter, childToInsert) |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Takes two arguments, an existing child to insert after and the new child to be inserted. If the first argument is null then the second argument is inserted as the first child of this XML. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters {XML} childToInserAfter {XML} childToInsert |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns XML |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
xml.insertChildAfter(childToInsertAfter, childToInsert)
|
|
|
|
|
Table Body (tbody) |
---|
id | insertChildBefore |
---|
class | node |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
insertChildBefore |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
style | float: left; margin-right: 5px; |
---|
| XML |
Span |
---|
style | float: left; font-weight: bold; |
---|
id | iets |
---|
| insertChildBefore |
Span |
---|
| (childToInsertBefore, childToInsert) |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Takes two arguments, an existing child to insert before and the new child to be inserted. If the first argument is null then the child is inserted as the last child. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters {XML} childToInsertBefore {XML} childToInsert |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns XML |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
xml.insertChildBefore(childToInsertBefore, childToInsert)
|
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
style | float: left; margin-right: 5px; |
---|
| Number |
Span |
---|
style | float: left; font-weight: bold; |
---|
id | iets |
---|
| length |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
This always returns 1. This is done to blur the distinction between an XML object and an XMLList containing exactly one value. |
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
style | float: left; margin-right: 5px; |
---|
| String |
Span |
---|
style | float: left; font-weight: bold; |
---|
id | iets |
---|
| localName |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
returns the local name part if the XML object has a name. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
xml.localName()
|
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
style | float: left; margin-right: 5px; |
---|
| QName |
Span |
---|
style | float: left; font-weight: bold; |
---|
id | iets |
---|
| name |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns the qualified name (a QName object) of the XML object it is called |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns QName |
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
style | float: left; margin-right: 5px; |
---|
| Namespace |
Span |
---|
style | float: left; font-weight: bold; |
---|
id | iets |
---|
| namespace |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
If no argument is passed to the method then it returns the namespace associated with the qualified name of this XML object. If a prefix is passed to the method then it looks for a matching namespace in the in scope namespace of this XML object and returns it when found, otherwise undefined is returned. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters {String} [prefix] |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
xml.namespace([prefix])
|
|
|
|
|
Table Body (tbody) |
---|
id | namespaceDeclarations |
---|
class | node |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
namespaceDeclarations |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
style | float: left; margin-right: 5px; |
---|
| Array |
Span |
---|
style | float: left; font-weight: bold; |
---|
id | iets |
---|
| namespaceDeclarations |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns an array with the namespace declarations associated with the XML object it is called on. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns Array |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
xml.namespaceDeclarations()
|
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
style | float: left; margin-right: 5px; |
---|
| String |
Span |
---|
style | float: left; font-weight: bold; |
---|
id | iets |
---|
| nodeKind |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns a string denoting the kind of node this XML object represents. Possible values: 'element', 'attribute', 'text', 'comment', 'processing-instruction'. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
xml.nodeKind()
|
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
style | float: left; margin-right: 5px; |
---|
| XML |
Span |
---|
style | float: left; font-weight: bold; |
---|
id | iets |
---|
| normalize |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns this XML object after normalizing all text content. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns XML |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
xml.normalize()
|
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
style | float: left; margin-right: 5px; |
---|
| XML |
Span |
---|
style | float: left; font-weight: bold; |
---|
id | iets |
---|
| parent |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns the parent XML object of this XML object or null if there is no parent. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns XML |
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
prependChild |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
style | float: left; margin-right: 5px; |
---|
| XML |
Span |
---|
style | float: left; font-weight: bold; |
---|
id | iets |
---|
| prependChild |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Iinserts the given value as the first child of the XML object and returns the XML object. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters {XML} childToPrepend |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns XML |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
xml.prependChild(childToPrepend)
|
|
|
|
|
Table Body (tbody) |
---|
id | processingInstructions |
---|
class | node |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
processingInstructions |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
style | float: left; margin-right: 5px; |
---|
| XMLList |
Span |
---|
style | float: left; font-weight: bold; |
---|
id | iets |
---|
| processingInstructions |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
If no argument is passed in then the method returns an XMLList with all the children of the XML object which are processing instructions. If an argument is passed in then the method returns an XMLList with all children of the XML object which are processing instructions where the name matches the argument. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters {String} [name] |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
xml.processingInstructions([name])
|
|
|
|
|
Table Body (tbody) |
---|
id | propertyIsEnumerable |
---|
class | node |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
propertyIsEnumerable |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
style | float: left; margin-right: 5px; |
---|
| Boolean |
Span |
---|
style | float: left; font-weight: bold; |
---|
id | iets |
---|
| propertyIsEnumerable |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns true if the property name is '0' and false otherwise. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters {String} propertyName |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
xml.propertyIsEnumerable(propertyName)
|
|
|
|
|
Table Body (tbody) |
---|
id | removeNamespace |
---|
class | node |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
removeNamespace |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
style | float: left; margin-right: 5px; |
---|
| XML |
Span |
---|
style | float: left; font-weight: bold; |
---|
id | iets |
---|
| removeNamespace |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Removes the namespace from the in scope namespaces of this XML object if the namespace is not used for the qualified name of the object or its attributes. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters {Namespace} namespace |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns XML |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
xml.removeNamespace(namespace)
|
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
style | float: left; margin-right: 5px; |
---|
| XML |
Span |
---|
style | float: left; font-weight: bold; |
---|
id | iets |
---|
| replace |
Span |
---|
| (propertyName, replacementValue) |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Takes two arguments, the property name of the property / properties to be replaced, and the value to replace the properties. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters {String} propertyName {XML} replacementValue |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns XML |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
xml.replace(propertyName, replacementValue)
|
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
setChildren |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
style | float: left; margin-right: 5px; |
---|
| XML |
Span |
---|
style | float: left; font-weight: bold; |
---|
id | iets |
---|
| setChildren |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Replaces all children of the XML object with this value. The method returns the XML object it is called on. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters {Object} value |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns XML |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
xml.setChildren(value)
|
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
setLocalName |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
style | float: left; margin-right: 5px; |
---|
| void |
Span |
---|
style | float: left; font-weight: bold; |
---|
id | iets |
---|
| setLocalName |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Changes the local name of this XML object to the name passed in. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters {String} name |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns void |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
xml.setLocalName(name)
|
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
style | float: left; margin-right: 5px; |
---|
| void |
Span |
---|
style | float: left; font-weight: bold; |
---|
id | iets |
---|
| setName |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Replaces the name of this XML object with the name passed in. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters {String} name |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns void |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
xml.setName(name)
|
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
setNamespace |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
style | float: left; margin-right: 5px; |
---|
| void |
Span |
---|
style | float: left; font-weight: bold; |
---|
id | iets |
---|
| setNamespace |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Changes the namespace associated with the name of this XML object to the new namespace. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters {Namespace} namespace |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns void |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
xml.setNamespace(namespace)
|
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
setSettings |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
style | float: left; margin-right: 5px; |
---|
| void |
Span |
---|
style | float: left; font-weight: bold; |
---|
id | iets |
---|
| setSettings |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Allows the global XML settings to be adjusted or restored to their default values. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters {Object} [settings] – The new settings that should be applied globally to the XML object. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns void |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
xml.setSettings(settings)
|
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
style | float: left; margin-right: 5px; |
---|
| Object |
Span |
---|
style | float: left; font-weight: bold; |
---|
id | iets |
---|
| settings |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns an object containing the global XML settings. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
xml.settings()
|
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
style | float: left; margin-right: 5px; |
---|
| XMLList |
Span |
---|
style | float: left; font-weight: bold; |
---|
id | iets |
---|
| text |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns an XMLList with all the children of this XML object that represent text nodes. |
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
style | float: left; margin-right: 5px; |
---|
| String |
Span |
---|
style | float: left; font-weight: bold; |
---|
id | iets |
---|
| toString |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns a convenient string value of this XML object. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
xml.toString()
|
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
toXMLString |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
style | float: left; margin-right: 5px; |
---|
| String |
Span |
---|
style | float: left; font-weight: bold; |
---|
id | iets |
---|
| toXMLString |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns a string with the serialized XML markup for this XML object. XML.prettyPrinting and XML.prettyIndent settings affect the returned string. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
xml.toXMLString()
|
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
style | float: left; margin-right: 5px; |
---|
| XML |
Span |
---|
style | float: left; font-weight: bold; |
---|
id | iets |
---|
| valueOf |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
The method simply returns the XML object it is called on. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns XML |
|
|
|