Reading XML file in C#



a portion of an xml file:



<publisher>
<name>ABC</name>
<id>943</id>
</publisher>


c#:



publisher = n.SelectSingleNode(".//publisher").InnerText;
Console.WriteLine(publisher + "\n");


The c# program reads text off an xml file. The problem I'm having is that the publisher will have a string value of ABC943. Is there a way to just return the string value ABC?


No comments:

Post a Comment