Books.Xml
Reading from the above xml document....
Output of the above Console Application is
Note: If the element has attributes...
Inspect the attributes. Element node types can include a list of attribute nodes that are associated with them. The MovetoNextAttribute method moves sequentially through each attribute in the element. Use the HasAttributes property to test whether the node has any attributes. The AttributeCount property returns the number of attributes for the current node.
//If the element has attributes like
Console.Write("<" + XmlRdr.Name);
while (XmlRdr.MoveToNextAttribute()) // Read the attributes.
Console.Write(" " + XmlRdr.Name + "='" + XmlRdr.Value + "'" +">");
break;
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.