一般最常搭配 XML 用來查詢資料的技術是 XPath . 不過 .Net 僅支援到 XPath 1.0 , 有時想在 XPath 中加上日期函式的判斷都不行.
再加上若使用了 XPath 的函式或一些判斷式後, 整個 XmlDocument 的查詢效能會變慢. (參考以下的例子)
本文章所使用的 XML 內容 (ad.xml : 紀錄一些廣告圖與連結):
2010/08/06
2010/07/28
[C#] 利用 Regex 查詢 Html/Xml 標籤中的屬性值
作用: 取得 HTML 或 XML 內容中, 某個標籤下所指定的屬性值.
輸入參數:
輸入參數:
- strHtml(string): HTML 或 XML 的內容.
- strTagName(string): 標籤名.
- strAttributeName(string): 屬性名.
[ASP.NET] XML 與 XSL 的操作
users.xml 的內容如下:
<?xmlversion="1.0"encoding="utf-8" ?>
<root>
<user>
<account>John</account>
<name>王小明</name>
</user>
<user>
<account>Mary</account>
<name>吳阿美</name>
</user>
<user>
<account>David</account>
<name>徐丁丁</name>
</user>
</root>
訂閱:
文章 (Atom)