I have an XML file taken from an RSS feed, saved locally, and I simply want to display the contents of this XML file (without the tags) inside a textbox or a textblock – something to just display it to the user.
I have already written a method which loops through the whole XML file getting each section of information from the relevant tags and storing it all into a list. Is there any simple way for me to either just display the contents of my newly generated list inside a textbox? Or even just a method of displaying the full XML file itself without the tags would be very much appreciated.
Many thanks!
You can use the following code to add each item from your List to the TextBlock. (You said you’ve already removed the tags from this list, correct?)
XAML:
C#:
in
Item.cs, you need to overrideToString(). Because you haven’t told us about yourItemclass, I’ll make a rough guess here:If, however, you need help with removing the XML tags, take a look at this StackOverflow answer.