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

Glossary Item Box

Returns the name without the namespace prefix

Syntax

Visual Basic (Declaration) 
Public ReadOnly Property LocalName As String
C# 
public string LocalName {get;}

Example

Library/Library.Test/TestHtmlParser.cs

C#Copy Code
string xml = "<root id='a'></root>";
XmlLightDocument doc = new XmlLightDocument(xml);
Assert.AreEqual("root", doc.Root.LocalName);
Assert.AreEqual(1, doc.Root.Attributes.Count);
Assert.IsTrue(doc.Root.Attributes.GetEnumerator().MoveNext());
Assert.IsTrue(((System.Collections.IEnumerable)doc.Root.Attributes).GetEnumerator().MoveNext());
Assert.IsTrue(doc.Root.Attributes.Remove("id"));
Assert.AreEqual(0, doc.Root.Attributes.Count);
VB.NETCopy Code
Dim xml As String = "<root id='a'></root>"
Dim doc As New XmlLightDocument(xml)
Assert.AreEqual("root", doc.Root.LocalName)
Assert.AreEqual(1, doc.Root.Attributes.Count)
Assert.IsTrue(doc.Root.Attributes.GetEnumerator().MoveNext())
Assert.IsTrue((DirectCast(doc.Root.Attributes, System.Collections.IEnumerable)).GetEnumerator().MoveNext())
Assert.IsTrue(doc.Root.Attributes.Remove("id"))
Assert.AreEqual(0, doc.Root.Attributes.Count)

Requirements

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

See Also

Generated with Document! X 2011 by Innovasys