how do we access attributes using xmlreaderthe


How do we access attributes using "XmlReader"?

The below snippets represents the way to access attributes. At First in order to check whether there any attributes present in the current node you can use "HasAttributes" function and use the "MoveToNextAttribute" method to move forward in attribute. Just in case you want to move to the next element use "MoveToElement()".

if (reader.HasAttributes)

{

while(reader.MoveToNextAttribute())

{

// your logic goes here

string pdata = reader.Value

}

}

reader.MoveToElement();

Request for Solution File

Ask an Expert for Answer!!
DOT NET Programming: how do we access attributes using xmlreaderthe
Reference No:- TGS0161424

Expected delivery within 24 Hours