Tuesday, March 13, 2012

sitemap function

Hi earthlings

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

Can you acheive?
thanksBasically, 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...
"Mr. SweatyFinger" <sw@.sw1finger.comwrote in message
news:eBb4dZeKHHA.3872@.TK2MSFTNGP06.phx.gbl...

Quote:

Originally Posted by

Hi earthlings
>
I need a function that pulls in from the sitemap the URL when I pass in a
title.
>
Can you acheive?
thanks
>
>

0 comments:

Post a Comment