我有一个xml文件,我使用LINQ to XML从中提取html.这是该文件的示例:
<?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>
Run Code Online (Sandbox Code Playgroud)
我使用以下查询从文件中提取"提示":
Tip tip = (from t in tipsXml.Descendants("tip")
where …Run Code Online (Sandbox Code Playgroud)