Solved

Need to code to determine whether

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

The New “Normal” in Modern Enterprise Operations

DevOps for the modern enterprise offers many benefits — increased agility, productivity, and more, but digital transformation isn’t easy, especially if you’re not addressing the right issues. Register for the webinar to dive into the “new normal” for enterprise modern ops.

Question has a verified solution.

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

The Client Need Led Us to RSS I recently had an investment company ask me how they might notify their constituents about their newsworthy publications.  Probably you would think "Facebook" or "Twitter" but this is an interesting client.  Their cons…
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, …
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 …
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

856 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