Mark Wilson I am the creator of TopXML. I am available for international and local (Australia) contracts. I am a Solution Architect/Business Analyst. I have worked in IT in several countries (NZ, Australia, South Africa, UK) building and training teams for government and very large non-governmental organizations. I am ex-Microsoft Consulting Services. I wrote the first book on Microsoft XML published in 2000 called XML Programming with VB and ASP. Most recently I have been building tools for the SEO industry. Ask me for a 37 point SEO health-checkup for your website.
First posted :
03/24/2008
Times viewed :
302
The System.Xml.XmlNodeReader Class
Supported Versions
.NET Framework 1.0, 1.1, 1.2
Public Members
Bold members are covered in the sample code.
Public Properties
Public Methods
AttributeCount
Close
BaseURI
Equals
CanResolveEntity
GetAttribute
Depth
GetHashCode
EOF
GetType
HasAttributes
IsStartElement
HasValue
LookupNamespace
IsDefault
MoveToAttribute
IsEmptyElement
MoveToContent
LocalName
MoveToElement
Name
MoveToFirstAttribute
NamespaceURI
MoveToNextAttribute
NameTable
Read
NodeType
ReadAttributeValue
Prefix
ReadElementString
QuoteChar
ReadEndElement
ReadState
ReadInnerXml
Value
ReadOuterXml
XmlLang
ReadStartElement
XmlSpace
ReadString
ResolveEntity
Skip
ToString
Overview
The XmlNodeReader class is a specialized implementation of
the XmlReader class that allows you to read information about an XmlNode. Note
that the XmlNodeReader is a forward-only reader which does not perform any
validation.
Example (VB.NET): How
to read a list of attributes from an element node using the XmlNodeReader.MoveToContent
and XmlNodeReader.MoveToAttribute methods.
In the following example we create an XmlNodeReader object
and assign it an XmlDocument with one element. We read in the element's
attributes by first ensuring the element has attributes (using the
XmlNodeReader.HasAttributes property), and then by looping through the number
of available attributes identified by the XmlNodeReader.AttributeCount value.