Solved

Need to code to determine whether

Posted on 2011-02-21
3
298 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
  • 2
3 Comments
 
LVL 82

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 82

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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

The Problem How to write an Xquery that works like a SQL outer join, providing placeholders for absent data on the outer side?  I give a bit more background at the end. The situation expressed as relational data Let’s work through this.  I’ve …
Many times as a report developer I've been asked to display normalized data such as three rows with values Jack, Joe, and Bob as a single comma-separated string such as 'Jack, Joe, Bob', and vice versa.  Here's how to do it. 
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

708 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now