I have an ASP.NET web form page on which I'm going to use repeater controls along with an xmlDataSource to display an archived listing of blog entries. I'm used to using databases and not working with XML so I'm not completely familiar with the XPath syntax. The xml file looks like this (minus the prefixed periods):
..<BlogEntry @date="7/23/07 10:00 AM" @poster="John Doe" @title="This is a blog post" @id="123456">
....<![CDATA[<p>This is also a test post.</p>]]>
..<BlogEntry @date="5/10/07 3:00 PM" @poster="John Doe" @title="Test Post" @id="12345">
....<![CDATA[<p>This is a test post.</p>]]>
What I want to do is to have my page look something like this:
- This is a blog post. (Posted by John Doe on 7/23/07 @ 10:00 AM)
- Test Post (Posted by John Doe on 5/10/07 @ 3:00 PM)
I've tried using an XPath filter on the xml data source like such:
BlogEntries/BlogEntry[distinct-values(year-from-duration(@date))] just to get started and other various ways from looking at documenation online but I always either get no results or I get error messages about user defined functions like it doesn't recognize distinct-values() or year-from-duration().
How can I go about getting to what I want? Also, does asp.net's XML Data source only support minimal functionality of XPath queries or was I just using distinct-values and other XPath functions incorrectly?