Proprietà XmlReader.HasAttributes (System.Xml)

Cambia visualizzazione:
ScriptFree
Riferimento a .NET Framework
Proprietà XmlReader.HasAttributes

Ottiene un valore che indica se il nodo corrente dispone di attributi.

Spazio dei nomi: System.Xml
Assembly: System.Xml (in system.xml.dll)

Sintassi

Visual Basic - (Dichiarazione)
Public Overridable ReadOnly Property HasAttributes As Boolean
Visual Basic (Utilizzo)
Dim instance As XmlReader
Dim value As Boolean

value = instance.HasAttributes

C#
public virtual bool HasAttributes { get; }
C++
public:
virtual property bool HasAttributes {
	bool get ();
}
J#
/** @property */
public boolean get_HasAttributes ()

JScript
public function get HasAttributes () : boolean

Valore proprietà

true se il nodo corrente presenta degli attributi, in caso contrario false.
Esempio

Nel seguente esempio vengono visualizzati tutti gli attributi sul nodo corrente.

Visual Basic
If reader.HasAttributes Then
  Console.WriteLine("Attributes of <" + reader.Name + ">")
  While reader.MoveToNextAttribute()
    Console.WriteLine(" {0}={1}", reader.Name, reader.Value)
  End While
  ' Move the reader back to the element node.
  reader.MoveToElement()
End If

C#
if (reader.HasAttributes) {
  Console.WriteLine("Attributes of <" + reader.Name + ">");
  while (reader.MoveToNextAttribute()) {
    Console.WriteLine(" {0}={1}", reader.Name, reader.Value);
  }
  // Move the reader back to the element node.
  reader.MoveToElement();
}

Piattaforme

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile per Pocket PC, Windows Mobile per Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

.NET Framework non supporta tutte le versioni di ciascuna piattaforma. Per un elenco delle versioni supportate, vedere Requisiti di sistema.

Informazioni sulla versione

.NET Framework

Supportato in: 2.0 1.1 1.0

.NET Compact Framework

Supportato in: 2.0 1.0
Vedere anche