Windows.Data.Xml.Dom.XmlDocument.SelectSingleNode C# (CSharp) Method

SelectSingleNode() public method

public SelectSingleNode ( [ xpath ) : IXmlNode
xpath [
return IXmlNode
		public extern IXmlNode SelectSingleNode([In] string xpath);
		public extern XmlNodeList SelectNodes([In] string xpath);

Usage Example

        internal XmlRpcMethodResponse(string responseText)
        {
            try
            {
                // analyze the response text to determine the content of the response
                XmlDocument document = new XmlDocument();
                if (responseText != null)
                {
                    responseText = responseText.TrimStart(' ', '\t', '\r', '\n');
                }
                document.LoadXml(responseText);
                IXmlNode responseValue = document.SelectSingleNode("/methodResponse/params/param/value");
                if (responseValue != null)
                {
                    _response = responseValue;
                }
                else
                {
                    // fault occurred
                    _faultOccurred = true;

                    IXmlNode errorCode = document.SelectSingleNode("/methodResponse/fault/value/struct/member[name='faultCode']/value");
                    _faultCode = errorCode.InnerText;

                    IXmlNode errorString = document.SelectSingleNode("/methodResponse/fault/value/struct/member[name='faultString']/value");
                    _faultString = errorString.InnerText;
                }
            }
            catch (Exception ex)
            {
                throw new XmlRpcClientInvalidResponseException(responseText, ex);
            }
        }
All Usage Examples Of Windows.Data.Xml.Dom.XmlDocument::SelectSingleNode