I have an xml file from which I am extracting html using LINQ to XML. This is a sample of the file:
<?xml version="1.0" encoding="utf-8" ?>
<tips>
<tip id="0">
This is the first tip.
</tip>
<tip id="1">
Use <b>Windows Live Writer</b> or <b>Microsoft Word 2007</b> to create and publish content.
</tip>
<tip id="2">
Enter a <b>url</b> into the box to automatically screenshot and index useful webpages.
</tip>
<tip id="3">
Invite your <b>colleagues</b> to the site by entering their email addresses. You can then share the content with them!
</tip>
</tips>
I am using the following query to extract a 'tip' from the file:
Tip tip = (from t in tipsXml.Descendants("tip")
where t.Attribute("id").Value == nextTipId.ToString()
select new Tip()
{
TipText= t.Value,
TipId = nextTipId
}).First();
The problem I have is that the Html elements are being stripped out. I was hoping for something like InnerHtml to use instead of Value, but that doesn't seem to be there.
Any ideas?
Thanks all in advance,
Dave