Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 308
  • Last Modified:

Need to code to determine whether

Hi!

I have three files.
One XML and Two XSLT.
I need some code so that if a robot is looking at my file sitemap.xml that sitemap.xsl is called.
If a user is looking at sitemap.xml that sitemap2.xsl is called to generate user friendly html page.
I guess the logic would need to be in the xml page.
Any specific code modifications would be apprecaited.

<?xml-stylesheet type="text/xsl" href="sitemap.xsl"?>
0
TrueBlue
Asked:
TrueBlue
  • 2
1 Solution
 
Dave BaldwinFixer of ProblemsCommented:
What is a robot going to do with a style sheet?  Web robots just collect links and files.  They aren't viewing them.
0
 
TrueBlueAuthor Commented:
DaveBaldwin,

We added an alt tag to the XML so that when the stylesheet displays the links the user sees the user friendly text instead of the URL. Unfortunately, Google does not like the alt tag. Therefore, we created another stylesheet to strip out the alt tag. Just need a way of calling the correct stylesheet based on whether a robot or human is trying to look at the sitemap.
0
 
Dave BaldwinFixer of ProblemsCommented:
I think you misunderstand.  The style sheet will not help because Google Sitemaps will not look at it.  In my server logs, Google downloads 'sitemap.xml' and never gets the style sheet.  Bing and several other search engines do the same.

For the search engines, you need to use the correct format without any additions.  Here is the reference for sitemaps used by Google: http://www.sitemaps.org/protocol.php  I use http://gsitecrawler.com/ to generate my sitemaps.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now