CSharpTest.Net
SelectSingleNode Method
See Also  Example Send Feedback Download Help File
CSharpTest.Net.Library Assembly > CSharpTest.Net.Html Namespace > XmlLightElement Class : SelectSingleNode Method

xpath

Glossary Item Box

Returns the first element from the given xpath expression

Syntax

Visual Basic (Declaration) 
Public Function SelectSingleNode( _
   ByVal xpath As String _
) As XmlLightElement
C# 
public XmlLightElement SelectSingleNode( 
   string xpath
)

Parameters

xpath

Example

Library/Library.Test/TestHtmlParser.cs

C#Copy Code
XmlLightDocument doc = new HtmlLightDocument(document);
XmlLightElement e = doc.SelectSingleNode("/html/head");
e = e.NextSibling;
Assert.IsTrue(e.IsComment);
Assert.AreEqual("<!-- comments included -->", e.InnerXml);
VB.NETCopy Code
Dim doc As XmlLightDocument = New HtmlLightDocument(document)
Dim e As XmlLightElement = doc.SelectSingleNode("/html/head")
e = e.NextSibling
Assert.IsTrue(e.IsComment)
Assert.AreEqual("<!-- comments included -->", e.InnerXml)

Requirements

Target Platforms: Windows XP, Windows Server 2003, Windows Vista, Windows Server 2008, Windows 7

See Also

Generated with Document! X 2011 by Innovasys