CSharpTest.Net
Name Field
See Also  Example Send Feedback Download Help File
CSharpTest.Net.Library Assembly > CSharpTest.Net.Html Namespace > XmlLightAttribute Structure : Name Field

Glossary Item Box

The full name of the attribute

Syntax

Visual Basic (Declaration) 
Public Name As String
C# 
public string Name

Example

Library/Library.Test/TestHtmlParser.cs

C#Copy Code
IEnumerator<XmlLightAttribute> en;
en = XmlLightParser.ParseAttributes("<tag a=\"1\" b='2' c=3 d e=>").GetEnumerator();
Assert.IsTrue(en.MoveNext());
Assert.AreEqual("a", en.Current.Name);
Assert.AreEqual("1", en.Current.Value);
Assert.IsTrue(en.MoveNext());
Assert.AreEqual("b", en.Current.Name);
Assert.AreEqual("2", en.Current.Value);
Assert.IsTrue(en.MoveNext());
Assert.AreEqual("c", en.Current.Name);
Assert.AreEqual("3", en.Current.Value);
Assert.IsTrue(en.MoveNext());
Assert.AreEqual("d", en.Current.Name);
Assert.AreEqual(null, en.Current.Value);
Assert.IsTrue(en.MoveNext());
Assert.AreEqual("e", en.Current.Name);
Assert.AreEqual("", en.Current.Value);
Assert.IsFalse(en.MoveNext());

en = XmlLightParser.ParseAttributes("<?xml version='1.0'?>").GetEnumerator();
Assert.IsTrue(en.MoveNext());
Assert.AreEqual("version", en.Current.Name);
Assert.AreEqual("1.0", en.Current.Value);
Assert.IsFalse(en.MoveNext());
VB.NETCopy Code
Dim en As IEnumerator(Of XmlLightAttribute)
en = XmlLightParser.ParseAttributes("<tag a=""1"" b='2' c=3 d e=>").GetEnumerator()
Assert.IsTrue(en.MoveNext())
Assert.AreEqual("a", en.Current.Name)
Assert.AreEqual("1", en.Current.Value)
Assert.IsTrue(en.MoveNext())
Assert.AreEqual("b", en.Current.Name)
Assert.AreEqual("2", en.Current.Value)
Assert.IsTrue(en.MoveNext())
Assert.AreEqual("c", en.Current.Name)
Assert.AreEqual("3", en.Current.Value)
Assert.IsTrue(en.MoveNext())
Assert.AreEqual("d", en.Current.Name)
Assert.AreEqual(Nothing, en.Current.Value)
Assert.IsTrue(en.MoveNext())
Assert.AreEqual("e", en.Current.Name)
Assert.AreEqual("", en.Current.Value)
Assert.IsFalse(en.MoveNext())

en = XmlLightParser.ParseAttributes("<?xml version='1.0'?>").GetEnumerator()
Assert.IsTrue(en.MoveNext())
Assert.AreEqual("version", en.Current.Name)
Assert.AreEqual("1.0", en.Current.Value)
Assert.IsFalse(en.MoveNext())

Requirements

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

See Also

Generated with Document! X 2011 by Innovasys