Response ContentAsXml Property C# API
Gets an XML DOM representation of this Response.

Namespace: Facilita.Web
Assembly: clrWebBrowser (in clrWebBrowser.dll) Version: 9.5.8.37 (1.0.0.0)
Syntax

public XmlDocument ContentAsXml { get; }

Field Value

An XML DOM representation of this Response.
Exceptions

ExceptionCondition
System ExceptionUnable to represent this Response as an XML document, possibly because it is not valid XML.
Examples

The following example demonstrates getting the values of <option> elements from the XML content of a Response. The code uses OnlineXPath to retrieve <option> elements from the myForm form and mySelect select element in the HTML.

The content of the HTTP Response object:

<html>
<body>
<form name="myForm">
Select:
<select name="mySelect">
<option value="1">1</option>
<option value="2">2</option>
</select>
</form>
</body>
</html>
System.Xml.XmlNodeList optionList = response.ContentAsXml.SelectNodes("//form[@name='myForm']/select[@name='mySelect']/option");

// This outputs "1", "2" 
foreach (System.Xml.XmlNode optionNode in optionList)
{
    WriteMessage(optionNode.Attributes["value"].InnerText);
}
See Also