sitemap function

  • Thread starter Thread starter Mr. SweatyFinger
  • Start date Start date
M

Mr. SweatyFinger

Hi earthlings

I need a function that pulls in from the sitemap the URL when I pass in a
title.

Can you acheive?
thanks
 
Basically, sitemap is just an XML document, you can use XPathDocument to
load sitemap, then you can easy navigate through document with
XPathNavigator and read whatever you want. For example:

XPathDocument xpd = new XPathDocument(Server.MapPath("~/web.sitemap"); // Or
whereever is your sitemap)
XPathNavigator xpn = xpd.CreateNavigator();

For how to use navigator and XPath at all, check out MSDN...

This is starting point. I think you can proceed on your own...
 
Back
Top