How would you do this: sorting/querying an XML file...

D

darrel

We have a home grown web site. We store page information, including a
time-stamp as to when it was last updated in a database table.

We also store the site architecture (navigation) in an XML file.

We want to create RSS feeds that show the most recent page updates for a
particular node of our site menu. For instance, HR might want an RSS feed to
list all recent HR page updates.

To do this, we need to get the HR page, all childrend of the HR page, all
children of those children, and so on.

Obviously, doing this via the DB would require some recursive queries...not
something we likely want to do.

So...I could add the timestamp info to each page node of the XML file. My
question is how would one go about grabbing and sorting the most recently
updated items from a node in the XML file?

Would XSL work by itself?

Should I grab a node via Xpath and then import all nodes as a dataset and
query the dataset?

Any other suggestions?

-Darrel
 
G

Guest

We have a home grown web site. We store page information, including a
time-stamp as to when it was last updated in a database table.

We also store the site architecture (navigation) in an XML file.

We want to create RSS feeds that show the most recent page updates for a
particular node of our site menu. For instance, HR might want an RSS feed to
list all recent HR page updates.

To do this, we need to get the HR page, all childrend of the HR page, all
children of those children, and so on.

Obviously, doing this via the DB would require some recursive queries...not
something we likely want to do.

So...I could add the timestamp info to each page node of the XML file. My
question is how would one go about grabbing and sorting the most recently
updated items from a node in the XML file?

Would XSL work by itself?

Should I grab a node via Xpath and then import all nodes as a dataset and
query the dataset?

Any other suggestions?

-Darrel

Either try to sort it via XSL

http://www.xml.com/pub/a/2002/07/03/transform.html

or use ASP.NET, for example:

DataSet ds = new DataSet();
ds.ReadXml(Server.MapPath("my.xml"));
DataView view = new DataView(ds.Tables["item"]);
view.Sort = "...";
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,763
Messages
2,569,562
Members
45,038
Latest member
OrderProperKetocapsules

Latest Threads

Top