Adds the specified XML element to the collection.
public bool Add(XmlElement element, int before, int after);
Public Function Add(ByVal element As XmlElement, ByVal before As Integer, ByVal after As Integer) As Boolean
Parameter | Description |
---|---|
element | Specified an instance of the Xml |
before | Specifies a relative position in the collection. The Xml |
after | Specifies a relative position in the collection. The XML element to be added is placed in the collection after the member identified by the after parameter. If this parameter is zero, the new element is inserted after the element at the current input position. If this parameter is -1, it is ignored. |
The return value is false, if the new element could not be added because the document becomes invalid according to the document's DTD. In this case an Xml
The following example inserts a new Address element into an XML document that contains adresses consisting of the sub-elements Name, Street and City. The new address is inserted after the second address.
TXTextControl.XmlElement newElement = new TXTextControl.XmlElement("Telephone", "46798 / 3459786");
newElement.Text = "Jack Brown\nBaker Street\nNew York";
textControl1.GetXmlElements("Adress").Add(newElement, -1, 2);
Dim NewElement As New TXTextControl.XmlElement("Telephone", "46798 / 3459786")
NewElement.Text = "Jack Brown" & vbLf & "Baker Street" & vbLf & "New York"
TextControl1.GetXmlElements("Adress").Add(NewElement, -1, 2)