TrueBlue
asked on
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"?>
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"?>
What is a robot going to do with a style sheet? Web robots just collect links and files. They aren't viewing them.
ASKER
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.
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.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.