I have an XML file that I'm loading into an XmlDocument and need to get a list of all the attributes on nodes with a specific name.
<shirts>
<product ID="123" Name="tee" Serial="5678"/>
<product ID="456" Name="crew" Serial="4566"/>
</shirts>
<pants>
<product ID="123" Name="jeans" Serial="1243" Color="blue"/>
<product ID="123" Name="dress" Serial="3455" Color="black"/>
<product ID="123" Name="shorts" Serial="6654" Color="grey"/>
</pants>
From this I need a list of all the "product" attributes. Result looking like:
ID
Name
Serial
Color
I don't need the values, just the attributes themselves. I'm using C# and Winforms. I know how to get the attribute values but not sure how it's done to get the attribute names themselves. How do I do that?