M

M

  • NA
  • 4
  • 0

how do i parse out member name from xml file?

May 14 2009 3:23 AM
hi, how do i parse out the value "system.web.ui.design.silverlightcontrols.collectioneditorbase" from below?

<member name="T:System.Web.UI.Design.SilverlightControls.CollectionEditorBase">
<summary>
Provides a utility class for Visual Studio property window behavior when editing media chapters.
</summary>
</member>

I tried using reader.Name, in which case reader is an instance of XMLTextReader class, but it gets only "member" string instead of the value after "=".


while (reader.Read())
{
switch (reader.NodeType)
{
case XmlNodeType.Element: // The node is an element.
{
if (reader.Name == "members")
{
sw.Write(reader.Name);
sw.Write("\r\n");
}
break;
}
case XmlNodeType.Text: //Display the text in each element.
sw.Write(reader.Value);
break;
case XmlNodeType.EndElement: //Display the end of the element.
sw.Write(reader.Name);
sw.Write("\r\n");
break;
}
}

Answers (3)