Solved

Need to code to determine whether

Posted on 2011-02-21
3
301 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 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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Post xml via PHP Soap Client 3 48
Convert XML to excel12book 5 29
Issue with XSLT mapping 10 35
split XML field into many fields from MS Access 15 15
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
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. 
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

770 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