по давней статейке, которую написал Ayavryk
файл.xml
<?xml version="1.0" encoding="UTF-8"?> <?xml-stylesheet href="user-Hide-Link.xsl" type="text/xsl"?> <html> <head> <title>Как спрятать ссылку от ботов?</title> </head> <body> <p>Вот <u class="in" id="How-to-Hide-Link-from-Robot.xml" title="результат XSLT">внутренняя ссылка</u>.</p> <p>А вот — <u id="forum.search" ed="engines.ru/" title="серч">текст внешней ссылки</u>.</p> <!-- можете между атрибутами с кусками урла — впихивать другой атрибут --> </body> </html>
шаблон.xsl
<?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="html" encoding="UTF-8"/> <xsl:template match="/"> <html> <xsl:apply-templates/> </html> </xsl:template> <xsl:template match="head"> <head> <xsl:copy-of select="title"/> <style type="text/css">body{margin: 25%}</style> </head> </xsl:template> <xsl:template match="body"> <body> <xsl:apply-templates/> </body> </xsl:template> <xsl:template match="p"> <p><xsl:apply-templates/></p> </xsl:template> <xsl:template match="u[@class='in']"> <a href="{@id}" title="{@title}"><xsl:value-of select="."/></a> </xsl:template> <xsl:template match="u"> <a href="http://{@id}{@ed}" title="{@title}"><xsl:value-of select="."/></a> </xsl:template> </xsl:stylesheet>
Урл внешней в исходном коде не читается… пока ПС не выполняют XSLT.