XMLNode.LoadXml Method (String)
Populates an XMLNode control with data from the specified XML string.
Namespace: Microsoft.Office.Tools.Word
Assembly: Microsoft.Office.Tools.Word (in Microsoft.Office.Tools.Word.dll)
Syntax
'Declaration
Sub LoadXml ( _
xml As String _
)
void LoadXml(
string xml
)
Parameters
xml
Type: System.StringThe XML string to read data from.
Remarks
This method does not add additional XMLNode controls or delete unnecessary XMLNode controls from the document.
This method updates all attributes of the XMLNode control.
Examples
The following code example uses the LoadXml method to fill an XMLNode control with data from an XML string. This example assumes that the current document contains an XMLNode named CustomerNode, and the namespace and elements described in the XML string conform to the schema associated with CustomerNode.
Private Sub LoadXmlFromString()
Me.CustomerNode.LoadXml( _
"<Customer xmlns='http://tempuri.org/XMLNodeVBCustomers.xsd'>" & _
"<LastName>Smith</LastName></Customer>")
End Sub
private void LoadXmlFromString()
{
this.CustomerNode.LoadXml(
"<Customer xmlns='http://tempuri.org/XMLNodeCSCustomers.xsd'>" +
"<LastName>Smith</LastName></Customer>");
}
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.