Platforms to show: All Mac Windows Linux Cross-Platform

XMLNodeMBS.appendChild(newChild as XMLNodeMBS) as XMLNodeMBS
Type Topic Plugin Version macOS Windows Linux iOS Targets
method XML MBS XML Plugin 22.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Function: Adds the node newChild to the end of the list of children of this node.
Notes:
If the newChild is already in the tree, it is first removed.
newChild The node to add. If it is a XMLDocumentFragmentMBS object, the entire contents of the document fragment are moved into the child list of this node
The node added.

Returns the newly added node.
XMLNodeMBS.AttributeNode(Index as Integer) as XMLAttributeMBS
Type Topic Plugin Version macOS Windows Linux iOS Targets
method XML MBS XML Plugin 22.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Function: Queries attribute node by index.
Notes: Index is zero based up to AttributeCount-1.
XMLNodeMBS.AttributeNodes as XMLAttributeMBS()
Type Topic Plugin Version macOS Windows Linux iOS Targets
method XML MBS XML Plugin 22.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Function: Queries an array with all attributes.
Example:

Dim doc As New XMLDocumentMBS
Dim node As XMLElementMBS = doc.createElement("Hello")

// add some attributes
node.AttributeValue("Hello") = "World"
node.AttributeValue("Value") = "123"
node.AttributeValue("Test") = "Value"

// now show them all in message dialogs
Dim attrs() As XMLAttributeMBS = node.AttributeNodes
For Each a As XMLAttributeMBS In attrs
MessageBox a.Name+": "+a.Value
Next
Notes: Gets a array containing the attributes of this node (if it is an XMLElementMBS) or null otherwise.
XMLNodeMBS.Child(Index as Integer) as XMLNodeMBS
Type Topic Plugin Version macOS Windows Linux iOS Targets
method XML MBS XML Plugin 22.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Function: Queries child node with given index.
Example:

Dim xml As String = "<test id=""123""><f>1</f><f>2</f><f>3</f><f>4</f></test>"
Dim doc As New XMLDocumentMBS(xml)
Dim node As XMLElementMBS = doc.DocumentElement

Dim count As Integer = node.ChildCount
Dim node0 As XMLNodeMBS = node.Child(0)
Dim node1 As XMLNodeMBS = node.Child(1)
Dim node2 As XMLNodeMBS = node.Child(2)
Dim node3 As XMLNodeMBS = node.Child(3)
'Dim node4 As XMLNodeMBS = node.Child(4) // out of bounds exception
Break // see debugger
Notes: Index is zero based up to ChildCount-1.
XMLNodeMBS.ChildNodes as XMLNodeMBS()
Type Topic Plugin Version macOS Windows Linux iOS Targets
method XML MBS XML Plugin 22.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Function: Gets a DOMNodeList that contains all children of this node.
Example:

Dim xml As String = "<test id=""123""><f>1</f><f>2</f><f>3</f><f>4</f></test>"
Dim doc As New XMLDocumentMBS(xml)
Dim DocumentElement As XMLElementMBS = doc.DocumentElement

Dim children() As XMLNodeMBS = DocumentElement.ChildNodes
For Each node As XMLNodeMBS In children
MessageBox node.toString
Next
Notes:
If there are no children, this is a array containing no nodes.

The array is a static snapshot of the content of the node.
XMLNodeMBS.Clone(deep as Boolean) as XMLNodeMBS
Type Topic Plugin Version macOS Windows Linux iOS Targets
method XML MBS XML Plugin 22.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Function: Returns a duplicate of this node.
Notes:
Pass true for deep parameter to copy all sub objects as well.

This function serves as a generic copy constructor for nodes.

The duplicate node has no parent ( parentNode returns nil.).

Cloning an XMLElementMBS copies all attributes and their values, including those generated by the XML processor to represent defaulted attributes, but this method does not copy any text it contains unless it is a deep clone, since the text is contained in a child XMLTextMBS node. Cloning any other type of node simply returns a copy of this node.
deep If true, recursively clone the subtree under the specified node; if false, clone only the node itself (and its attributes, if it is an XMLElementMBS).
XMLNodeMBS.compareDocumentPosition(other as XMLNodeMBS) as Integer
Type Topic Plugin Version macOS Windows Linux iOS Targets
method XML MBS XML Plugin 22.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Function: Compares two nodes for their position in the document.
Notes:
Compares the reference node, i.e. the node on which this method is being called, with a node, i.e. the one passed as a parameter, with regard to their position in the document and according to the document order.

other: The node to compare against this node.

Returns how the given node is positioned relatively to this node.
XMLNodeMBS.Constructor   Private
Type Topic Plugin Version macOS Windows Linux iOS Targets
method XML MBS XML Plugin 22.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Function: The private constructor.
XMLNodeMBS.insertBefore(newChild as XMLNodeMBS, refChild as XMLNodeMBS) as XMLNodeMBS
Type Topic Plugin Version macOS Windows Linux iOS Targets
method XML MBS XML Plugin 22.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Function: Inserts the node newChild before the existing child node refChild.
Notes:
If refChild is nil, insert newChild at the end of the list of children.

If newChild is a XMLDocumentFragmentMBS object, all of its children are inserted, in the same order, before refChild. If the newChild is already in the tree, it is first removed. Note that a XMLNodeMBS that has never been assigned to refer to an actual node is == nil.
newChild The node to insert.

refChild The reference node, i.e., the node before which the new node must be inserted.
The node being inserted.

Returns the new node.
XMLNodeMBS.isDefaultNamespace(namespaceURI as String) as Boolean
Type Topic Plugin Version macOS Windows Linux iOS Targets
method XML MBS XML Plugin 22.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Function: This method checks if the specified namespaceURI is the default namespace or not.
Notes:
namespaceURI: The namespace URI to look for.
Returns true if the specified namespaceURI is the default namespace, false otherwise.
XMLNodeMBS.isEqualNode(other as XMLNodeMBS) as Boolean
Type Topic Plugin Version macOS Windows Linux iOS Targets
method XML MBS XML Plugin 22.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Function: Tests whether two nodes are equal.
Notes:
This method tests for equality of nodes, not sameness (i.e., whether the two nodes are pointers to the same object) which can be tested with XMLNodeMBS::isSameNode. All nodes that are the same will also be equal, though the reverse may not be true.

Two nodes are equal if and only if the following conditions are satisfied: The two nodes are of the same type.The following string attributes are equal: nodeName, localName, namespaceURI, prefix, nodeValue , baseURI. This is: they are both null, or they have the same length and are character for character identical. The attributes node maps are equal. This is: they are both nil, or they have the same length and for each node that exists in one map there is a node that exists in the other map and is equal, although not necessarily at the same index.The childNodes node lists are equal. This is: they are both nil, or they have the same length and contain equal nodes at the same index. This is true for XMLAttributeMBS nodes as for any other type of node. Note that normalization can affect equality; to avoid this, nodes should be normalized before being compared.

For two XMLDocumentTypeMBS nodes to be equal, the following conditions must also be satisfied: The following string attributes are equal: publicId, systemId, internalSubset. The entities node maps are equal. The notations node maps are equal.

On the other hand, the following do not affect equality: the ownerDocument attribute, the specified attribute for XMLAttributeMBS nodes, the isWhitespaceInElementContent attribute for XMLTextMBS nodes, as well as any user data or event listeners registered on the nodes.

other: The node to compare equality with.
If the nodes, and possibly subtrees are equal, true otherwise false.
XMLNodeMBS.isSameNode(other as XMLNodeMBS) as Boolean
Type Topic Plugin Version macOS Windows Linux iOS Targets
method XML MBS XML Plugin 22.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Function: Returns whether this node is the same node as the given one.
Notes:
This method provides a way to determine whether two XMLNodeMBS references returned by the implementation reference the same object. When two XMLNodeMBS references are references to the same object, even if through a proxy, the references may be used completely interchangeably, such that all attributes have the same values and calling the same DOM method on either reference always has exactly the same effect.

other: The node to test against.

Returns true if the nodes are the same, false otherwise.
XMLNodeMBS.IterateAttributeNodes as XMLIterateAttributeNodesMBS
Type Topic Plugin Version macOS Windows Linux iOS Targets
method XML MBS XML Plugin 22.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Function: Iterates over the attributes.
Example:

Dim doc As New XMLDocumentMBS("<doc id=""123"" value=""test""></doc>")

Dim root As XMLElementMBS = doc.DocumentElement
For Each e As XMLAttributeMBS In root.IterateAttributeNodes
MessageBox e.Name+": "+e.Value
Next
Notes: For use with For Each Loops in Xojo.
XMLNodeMBS.IterateChildNodes as XMLIterateChildNodesMBS
Type Topic Plugin Version macOS Windows Linux iOS Targets
method XML MBS XML Plugin 22.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Function: Iterates over the child nodes.
Example:

Dim doc As New XMLDocumentMBS("<doc><test>abc</test><test>def</test></doc>")

Dim root As XMLElementMBS = doc.DocumentElement
For Each e As XMLElementMBS In root.IterateChildNodes
MessageBox e.toString
Next
Notes: For use with For Each Loops in Xojo.
XMLNodeMBS.lookupNamespaceURI(prefix as String) as String
Type Topic Plugin Version macOS Windows Linux iOS Targets
method XML MBS XML Plugin 22.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Function: Look up the namespace URI associated to the given prefix, starting from this node.
Notes:
The prefix to look for. If this parameter is null, the method will return the default namespace URI if any.
Returns the associated namespace URI or null if none is found.
XMLNodeMBS.lookupPrefix(namespaceURI as String) as String
Type Topic Plugin Version macOS Windows Linux iOS Targets
method XML MBS XML Plugin 22.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Function: Look up the prefix associated to the given namespace URI, starting from this node.
Notes:
The default namespace declarations are ignored by this method.

namespaceURI: The namespace URI to look for.

Returns an associated namespace prefix if found, null if none is found. If more than one prefix are associated to the namespace prefix, the returned namespace prefix is implementation dependent.
XMLNodeMBS.Normalize
Type Topic Plugin Version macOS Windows Linux iOS Targets
method XML MBS XML Plugin 22.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Function: Normalizes the node tree.
Notes:
Puts all XMLTextMBS nodes in the full depth of the sub-tree underneath this XMLNodeMBS, including attribute nodes, into a "normal" form where only markup (e.g., tags, comments, processing instructions, CDATA sections, and entity references) separates XMLTextMBS nodes, i.e., there are neither adjacent XMLTextMBS nodes nor empty XMLTextMBS nodes. This can be used to ensure that the DOM view of a document is the same as if it were saved and re-loaded, and is useful when operations (such as XPointer lookups) that depend on a particular document tree structure are to be used.

Note: In cases where the document contains CDATASections, the normalize operation alone may not be sufficient, since XPointers do not differentiate between XMLTextMBS nodes and XMLCDATASectionMBS nodes.
XMLNodeMBS.removeChild(Node as XMLNodeMBS)
Type Topic Plugin Version macOS Windows Linux iOS Targets
method XML MBS XML Plugin 22.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Function: Removes the child node indicated by oldChild from the list of children.
Notes: Returns the old node.
XMLNodeMBS.replaceChild(newChild as XMLNodeMBS, oldChild as XMLNodeMBS) as XMLNodeMBS
Type Topic Plugin Version macOS Windows Linux iOS Targets
method XML MBS XML Plugin 22.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Function: Replaces the child node oldChild with newChild in the list of children, and returns the oldChild node.
Notes:
If newChild is a XMLDocumentFragmentMBS object, oldChild is replaced by all of the XMLDocumentFragmentMBS children, which are inserted in the same order.

If the newChild is already in the tree, it is first removed.
newChild The new node to put in the child list.
oldChild The node being replaced in the list.
The node replaced.

Returns the old node.

The items on this page are in the following plugins: MBS XML Plugin.

Feedback: Report problem or ask question.

The biggest plugin in space...


Start Chat