-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathOpmlParser.cs
32 lines (28 loc) · 922 Bytes
/
OpmlParser.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
using System.Xml;
namespace OpmlParser
{
public static class Parser
{
public static string[] ParseAtrribute(string filePath, string parseAtrribute)
{
XmlReader xmlReader = XmlReader.Create(filePath);
var list = new List<string> {};
while (xmlReader.Read())
{
if (xmlReader.NodeType == XmlNodeType.Element)
{
if (xmlReader.HasAttributes)
{
// Console.WriteLine(xmlReader.GetAttribute(parseAtrribute));
var atrribute = xmlReader.GetAttribute(parseAtrribute);
if (atrribute != null)
{
list.Add(atrribute);
}
}
}
}
return list.ToArray();
}
}
}