Solved

Need to code to determine whether

Posted on 2011-02-21
3
304 Views
Last Modified: 2012-05-11
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
Comment
Question by:TrueBlue
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 34948032
What is a robot going to do with a style sheet?  Web robots just collect links and files.  They aren't viewing them.
0
 

Author Comment

by:TrueBlue
ID: 34951882
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
 
LVL 83

Accepted Solution

by:
Dave Baldwin earned 500 total points
ID: 34954280
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

Webinar: Aligning, Automating, Winning

Join Dan Russo, Senior Manager of Operations Intelligence, for an in-depth discussion on how Dealertrack, leading provider of integrated digital solutions for the automotive industry, transformed their DevOps processes to increase collaboration and move with greater velocity.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Browsing the questions asked to the Experts of this forum, you will be amazed to see how many times people are headaching about monster regular expressions (regex) to select that specific part of some HTML or XML file they want to extract. The examp…
The Confluence of Individual Knowledge and the Collective Intelligence At this writing (summer 2013) the term API (http://dictionary.reference.com/browse/API?s=t) has made its way into the popular lexicon of the English language.  A few years ago, …
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

710 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question