Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Xml;
- using System.IO;
- namespace Articulos.Preguntas
- {
- public sealed class LecturaAtributosXML
- {
- public static void Main()
- {
- XmlReader lectorXml = XmlReader.Create ("almacen2.xml");
- while (lectorXml.Read())
- {
- // Muestra los atributos del nodo actual:
- if (lectorXml.HasAttributes)
- {
- Console.WriteLine ("Atributos de <{0}>", lectorXml.Name);
- for (int i = 0; i < lectorXml.AttributeCount; ++i)
- {
- Console.WriteLine (" {0}", lectorXml[i]);
- }
- }
- // Desplaza el lector a la posición inicial:
- lectorXml.MoveToElement();
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement