You appear to be a bot. Output may be restricted
Description
Returns the xsl of a sitemap xml file as a string.
Usage
$string = Jetpack_Sitemap_Stylist::sitemap_xsl();
Parameters
Returns
string The contents of the xsl file.
Source
File name: jetpack/modules/sitemaps/sitemap-stylist.php
Lines:
1 to 100 of 104
public static function sitemap_xsl() { $title = esc_html( ent2ncr( __( 'XML Sitemap', 'jetpack' ) ) ); $header_url = esc_html( ent2ncr( __( 'URL', 'jetpack' ) ) ); $header_lastmod = esc_html( ent2ncr( __( 'Last Modified', 'jetpack' ) ) ); $description = self::sanitize_with_links( __( 'This is an XML Sitemap generated by <a href="%1$s" rel="noopener noreferrer" target="_blank">Jetpack</a>, meant to be consumed by search engines like <a href="%2$s" rel="noopener noreferrer" target="_blank">Google</a> or <a href="%3$s" rel="noopener noreferrer" target="_blank">Bing</a>.', 'jetpack' ), array( 1 => 'https://jetpack.com/', 2 => 'https://www.google.com/', 3 => 'https://www.bing.com/', ) ); $more_info = self::sanitize_with_links( __( 'You can find more information on XML sitemaps at <a href="%1$s" rel="noopener noreferrer" target="_blank">sitemaps.org</a>', 'jetpack' ), array( 1 => 'https://sitemaps.org', ) ); $generated_by = self::sanitize_with_links( __( 'Generated by <a href="%s" rel="noopener noreferrer" target="_blank">Jetpack for WordPress</a>', 'jetpack' ), array( 1 => 'https://jetpack.com', ) ); $css = self::sitemap_xsl_css(); return <<<XSL <?xml version='1.0' encoding='UTF-8'?> <xsl:stylesheet version='2.0' xmlns:html='http://www.w3.org/TR/REC-html40' xmlns:sitemap='http://www.sitemaps.org/schemas/sitemap/0.9' xmlns:xsl='http://www.w3.org/1999/XSL/Transform'> <xsl:output method='html' version='1.0' encoding='UTF-8' indent='yes'/> <xsl:template match="/"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>$title</title> <meta http-equiv='Content-Type' content='text/html; charset=utf-8'/> <style type='text/css'> $css </style> </head> <body> <div id='description'> <h1>$title</h1> <p>$description</p> <p>$more_info</p> </div> <div id='content'> <!-- <xsl:value-of select="count(sitemap:urlset/sitemap:url)"/> --> <table> <tr> <th>#</th> <th>$header_url</th> <th>$header_lastmod</th> </tr> <xsl:for-each select="sitemap:urlset/sitemap:url"> <tr> <xsl:choose> <xsl:when test='position() mod 2 != 1'> <xsl:attribute name="class">odd</xsl:attribute> </xsl:when> </xsl:choose> <td> <xsl:value-of select = "position()" /> </td> <td> <xsl:variable name='itemURL'> <xsl:value-of select='sitemap:loc'/> </xsl:variable> <a href='{\$itemURL}'> <xsl:value-of select='sitemap:loc'/> </a> </td> <td> <xsl:value-of select='sitemap:lastmod'/> </td> </tr> </xsl:for-each> </table> </div> <div id='footer'> <p>$generated_by</p> </div> </body> </html> </xsl:template> </xsl:stylesheet>\n