Add support for silverstripe 5

This commit is contained in:
Mohamed Alsharaf 2023-02-13 13:38:57 +13:00
parent cfcb002cf3
commit 286115174d
10 changed files with 125 additions and 121 deletions

View File

@ -2,22 +2,29 @@
"name": "wilr/silverstripe-googlesitemaps", "name": "wilr/silverstripe-googlesitemaps",
"description": "SilverStripe support for the Google Sitemaps XML, enabling Google and other search engines to see all urls on your site. This helps your SilverStripe website rank well in search engines, and to encourage the information on your site to be discovered quickly.", "description": "SilverStripe support for the Google Sitemaps XML, enabling Google and other search engines to see all urls on your site. This helps your SilverStripe website rank well in search engines, and to encourage the information on your site to be discovered quickly.",
"type": "silverstripe-vendormodule", "type": "silverstripe-vendormodule",
"keywords": ["silverstripe", "googlesitemaps", "seo"], "keywords": [
"silverstripe",
"googlesitemaps",
"seo"
],
"homepage": "https://github.com/wilr/silverstripe-googlesitemaps", "homepage": "https://github.com/wilr/silverstripe-googlesitemaps",
"license": "BSD-3-Clause", "license": "BSD-3-Clause",
"authors": [{ "authors": [
{
"name": "Will Rossiter", "name": "Will Rossiter",
"email": "will@fullscreen.io" "email": "will@fullscreen.io"
}], }
],
"require": { "require": {
"silverstripe/framework": "^4" "php": "^8.1",
"silverstripe/framework": "^5"
}, },
"require-dev": { "require-dev": {
"phpunit/phpunit": "^5.7", "phpunit/phpunit": "^9.5",
"squizlabs/php_codesniffer": "^3" "squizlabs/php_codesniffer": "^3"
}, },
"replace": { "replace": {
"silverstripe/googlesitemaps":"*" "silverstripe/googlesitemaps": "*"
}, },
"extra": { "extra": {
"branch-alias": { "branch-alias": {
@ -35,5 +42,12 @@
} }
}, },
"prefer-stable": true, "prefer-stable": true,
"minimum-stability": "dev" "minimum-stability": "dev",
"config": {
"allow-plugins": {
"composer/installers": true,
"silverstripe/vendor-plugin": true,
"silverstripe/recipe-plugin": true
}
}
} }

View File

@ -1,14 +1,14 @@
<phpunit bootstrap="vendor/silverstripe/framework/tests/bootstrap.php" colors="true"> <?xml version="1.0"?>
<testsuite name="Default"> <phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="vendor/silverstripe/framework/tests/bootstrap.php" colors="true" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
<directory>tests</directory> <coverage includeUncoveredFiles="true">
</testsuite> <include>
<filter>
<whitelist addUncoveredFilesFromWhitelist="true">
<directory suffix=".php">src/</directory> <directory suffix=".php">src/</directory>
</include>
<exclude> <exclude>
<directory suffix=".php">tests/</directory> <directory suffix=".php">tests/</directory>
</exclude> </exclude>
</whitelist> </coverage>
</filter> <testsuite name="Default">
<directory>tests</directory>
</testsuite>
</phpunit> </phpunit>

View File

@ -95,7 +95,7 @@ class GoogleSitemapController extends Controller
*/ */
protected function unsanitiseClassName($class) protected function unsanitiseClassName($class)
{ {
return str_replace('-', '\\', $class); return str_replace('-', '\\', (string) $class);
} }
/** /**

View File

@ -390,7 +390,7 @@ class GoogleSitemap
for ($i = 1; $i <= $neededForPage; $i++) { for ($i = 1; $i <= $neededForPage; $i++) {
$lastEdited = $instances $lastEdited = $instances
->limit($countPerFile, ($i - 1) * $countPerFile) ->limit($countPerFile, ($i - 1) * $countPerFile)
->sort(array()) ->sort(null)
->max('LastEdited'); ->max('LastEdited');
$lastModified = ($lastEdited) ? date('Y-m-d', strtotime($lastEdited)) : date('Y-m-d'); $lastModified = ($lastEdited) ? date('Y-m-d', strtotime($lastEdited)) : date('Y-m-d');
@ -515,6 +515,6 @@ class GoogleSitemap
*/ */
protected function sanitiseClassName($class) protected function sanitiseClassName($class)
{ {
return str_replace('\\', '-', $class); return str_replace('\\', '-', (string) $class);
} }
} }

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type='text/xsl' href='{$BaseHref}sitemap.xml/styleSheetIndex'?> <?xml-stylesheet type='text/xsl' href='{$AbsoluteBaseURL}/sitemap.xml/styleSheetIndex'?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"><% loop Sitemaps %> <sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"><% loop Sitemaps %>
<sitemap> <sitemap>
<loc>{$AbsoluteBaseURL}sitemap.xml/sitemap/$ClassName/$Page.xml</loc> <loc>{$AbsoluteBaseURL}/sitemap.xml/sitemap/$ClassName/$Page.xml</loc>
<% if $LastModified %><lastmod>$LastModified</lastmod><% end_if %> <% if $LastModified %><lastmod>$LastModified</lastmod><% end_if %>
</sitemap><% end_loop %> </sitemap><% end_loop %>
</sitemapindex> </sitemapindex>

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type='text/xsl' href='{$BaseHref}sitemap.xml/styleSheet'?> <?xml-stylesheet type='text/xsl' href='{$AbsoluteBaseURL}/sitemap.xml/styleSheet'?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1"> <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">
<% loop $Items %> <% loop $Items %>
<url> <url>

View File

@ -20,7 +20,10 @@ use Wilr\GoogleSitemaps\Tests\Model\UnviewableDataObject;
class GoogleSitemapTest extends FunctionalTest class GoogleSitemapTest extends FunctionalTest
{ {
protected static $fixture_file = 'GoogleSitemapTest.yml'; protected static $fixture_file = [
'GoogleSitemapTest.yml',
'GoogleSitemapPageTest.yml',
];
protected static $extra_dataobjects = [ protected static $extra_dataobjects = [
TestDataObject::class, TestDataObject::class,
@ -32,19 +35,15 @@ class GoogleSitemapTest extends FunctionalTest
GoogleSitemapExtension::class GoogleSitemapExtension::class
]; ];
public function setUp() protected function setUp(): void
{ {
parent::setUp(); parent::setUp();
if (class_exists('Page')) {
$this->loadFixture($this->resolveFixturePath('GoogleSitemapPageTest.yml'));
}
GoogleSitemap::clear_registered_dataobjects(); GoogleSitemap::clear_registered_dataobjects();
GoogleSitemap::clear_registered_routes(); GoogleSitemap::clear_registered_routes();
} }
public function tearDown() protected function tearDown(): void
{ {
parent::tearDown(); parent::tearDown();
@ -52,7 +51,7 @@ class GoogleSitemapTest extends FunctionalTest
GoogleSitemap::clear_registered_routes(); GoogleSitemap::clear_registered_routes();
} }
public function testCanIncludeInGoogleSitemap() public function testCanIncludeInGoogleSitemap(): void
{ {
GoogleSitemap::register_dataobject(TestDataObject::class, ''); GoogleSitemap::register_dataobject(TestDataObject::class, '');
@ -64,26 +63,24 @@ class GoogleSitemapTest extends FunctionalTest
$this->assertTrue($used->canIncludeInGoogleSitemap()); $this->assertTrue($used->canIncludeInGoogleSitemap());
} }
public function testIndexFileWithCustomRoute() public function testIndexFileWithCustomRoute(): void
{ {
GoogleSitemap::register_route('/test/'); GoogleSitemap::register_route('/test/');
$response = $this->get('sitemap.xml'); $response = $this->get('sitemap.xml');
$body = $response->getBody(); $body = $response->getBody();
$expected = "<loc>". Director::absoluteURL("sitemap.xml/sitemap/GoogleSitemapRoute/1") ."</loc>"; $this->assertXmlStringEqualsXmlFile(__DIR__ . '/xml/' . __FUNCTION__ . '.xml', $body, 'A link to the custom routes exists');
$this->assertEquals(1, substr_count($body, $expected), 'A link to the custom routes exists');
} }
public function testGetItems(): void
public function testGetItems()
{ {
GoogleSitemap::register_dataobject(TestDataObject::class, ''); GoogleSitemap::register_dataobject(TestDataObject::class, '');
$items = GoogleSitemap::get_items(TestDataObject::class, 1); $items = GoogleSitemap::get_items(TestDataObject::class, 1);
$this->assertEquals(2, $items->count()); $this->assertEquals(2, $items->count());
$this->assertDOSEquals(array( $this->assertListEquals(array(
array("Priority" => "0.2"), array("Priority" => "0.2"),
array("Priority" => "0.4") array("Priority" => "0.4")
), $items); ), $items);
@ -95,7 +92,7 @@ class GoogleSitemapTest extends FunctionalTest
$this->assertEquals(0, GoogleSitemap::get_items(UnviewableDataObject::class, 1)->count()); $this->assertEquals(0, GoogleSitemap::get_items(UnviewableDataObject::class, 1)->count());
} }
public function testGetItemsWithCustomRoutes() public function testGetItemsWithCustomRoutes(): void
{ {
GoogleSitemap::register_routes(array( GoogleSitemap::register_routes(array(
'/test-route/', '/test-route/',
@ -107,7 +104,7 @@ class GoogleSitemapTest extends FunctionalTest
$this->assertEquals(3, $items->count()); $this->assertEquals(3, $items->count());
} }
public function testAccessingSitemapRootXMLFile() public function testAccessingSitemapRootXMLFile(): void
{ {
GoogleSitemap::register_dataobject(TestDataObject::class); GoogleSitemap::register_dataobject(TestDataObject::class);
GoogleSitemap::register_dataobject(OtherDataObject::class); GoogleSitemap::register_dataobject(OtherDataObject::class);
@ -115,50 +112,23 @@ class GoogleSitemapTest extends FunctionalTest
$response = $this->get('sitemap.xml'); $response = $this->get('sitemap.xml');
$body = $response->getBody(); $body = $response->getBody();
// the sitemap should contain <loc> to both those files and not the other $this->assertXmlStringEqualsXmlFile(__DIR__ . '/xml/' . __FUNCTION__ . '.xml', $body);
// dataobject as it hasn't been registered
$expected = "<loc>". Director::absoluteURL(
"sitemap.xml/sitemap/Wilr-GoogleSitemaps-Tests-Model-TestDataObject/1"
) ."</loc>";
$this->assertEquals(
1,
substr_count($body, $expected),
'A link to GoogleSitemapTest_DataObject exists'
);
$expected = "<loc>". Director::absoluteURL(
"sitemap.xml/sitemap/Wilr-GoogleSitemaps-Tests-Model-OtherDataObject/1"
) ."</loc>";
$this->assertEquals(
1,
substr_count($body, $expected),
'A link to GoogleSitemapTest_OtherDataObject exists'
);
$expected = "<loc>". Director::absoluteURL(
"sitemap.xml/sitemap/Wilr-GoogleSitemaps-Tests-Model-UnviewableDataObject/2"
) ."</loc>";
$this->assertEquals(
0,
substr_count($body, $expected),
'A link to a GoogleSitemapTest_UnviewableDataObject does not exist'
);
} }
public function testLastModifiedDateOnRootXML() public function testLastModifiedDateOnRootXML(): void
{ {
Config::inst()->update(GoogleSitemap::class, 'enabled', true); Config::inst()->set(GoogleSitemap::class, 'enabled', true);
if (!class_exists('Page')) { if (!class_exists('Page')) {
$this->markTestIncomplete('No cms module installed, page related test skipped'); $this->markTestIncomplete('No cms module installed, page related test skipped');
} }
$page = $this->objFromFixture('Page', 'Page1'); $page = $this->objFromFixture('Page', 'Page1');
$page->publish('Stage', 'Live'); $page->publishSingle();
$page->flushCache(); $page->flushCache();
$page2 = $this->objFromFixture('Page', 'Page2'); $page2 = $this->objFromFixture('Page', 'Page2');
$page2->publish('Stage', 'Live'); $page2->publishSingle();
$page2->flushCache(); $page2->flushCache();
DB::query("UPDATE \"SiteTree_Live\" SET \"LastEdited\"='2014-03-14 00:00:00' WHERE \"ID\"='".$page->ID."'"); DB::query("UPDATE \"SiteTree_Live\" SET \"LastEdited\"='2014-03-14 00:00:00' WHERE \"ID\"='".$page->ID."'");
@ -176,36 +146,21 @@ class GoogleSitemapTest extends FunctionalTest
); );
} }
public function testIndexFilePaginatedSitemapFiles() public function testIndexFilePaginatedSitemapFiles(): void
{ {
$original = Config::inst()->get('GoogleSitemap', 'objects_per_sitemap'); $original = Config::inst()->get('GoogleSitemap', 'objects_per_sitemap');
Config::inst()->update(GoogleSitemap::class, 'objects_per_sitemap', 1); Config::inst()->set(GoogleSitemap::class, 'objects_per_sitemap', 1);
GoogleSitemap::register_dataobject(TestDataObject::class); GoogleSitemap::register_dataobject(TestDataObject::class);
$response = $this->get('sitemap.xml'); $response = $this->get('sitemap.xml');
$body = $response->getBody(); $body = $response->getBody();
$expected = "<loc>". Director::absoluteURL(
"sitemap.xml/sitemap/Wilr-GoogleSitemaps-Tests-Model-TestDataObject/1"
) ."</loc>";
$this->assertEquals(
1,
substr_count($body, $expected),
'A link to the first page of GoogleSitemapTest_DataObject exists'
);
$expected = "<loc>". Director::absoluteURL( $this->assertXmlStringEqualsXmlFile(__DIR__ . '/xml/' . __FUNCTION__ . '.xml', $body);
"sitemap.xml/sitemap/Wilr-GoogleSitemaps-Tests-Model-TestDataObject/2"
) ."</loc>";
$this->assertEquals(
1,
substr_count($body, $expected),
'A link to the second page GoogleSitemapTest_DataObject exists'
);
Config::inst()->update(GoogleSitemap::class, 'objects_per_sitemap', $original); Config::inst()->set(GoogleSitemap::class, 'objects_per_sitemap', $original);
} }
public function testRegisterRoutesIncludesAllRoutes() public function testRegisterRoutesIncludesAllRoutes(): void
{ {
GoogleSitemap::register_route('/test/'); GoogleSitemap::register_route('/test/');
GoogleSitemap::register_routes(array( GoogleSitemap::register_routes(array(
@ -221,10 +176,10 @@ class GoogleSitemapTest extends FunctionalTest
$this->assertEquals(3, substr_count($body, "<loc>")); $this->assertEquals(3, substr_count($body, "<loc>"));
} }
public function testAccessingNestedSiteMap() public function testAccessingNestedSiteMap(): void
{ {
$original = Config::inst()->get('GoogleSitemap', 'objects_per_sitemap'); $original = Config::inst()->get('GoogleSitemap', 'objects_per_sitemap');
Config::inst()->update(GoogleSitemap::class, 'objects_per_sitemap', 1); Config::inst()->set(GoogleSitemap::class, 'objects_per_sitemap', 1);
GoogleSitemap::register_dataobject(TestDataObject::class); GoogleSitemap::register_dataobject(TestDataObject::class);
$response = $this->get('sitemap.xml/sitemap/Wilr-GoogleSitemaps-Tests-Model-TestDataObject/1'); $response = $this->get('sitemap.xml/sitemap/Wilr-GoogleSitemaps-Tests-Model-TestDataObject/1');
@ -232,24 +187,24 @@ class GoogleSitemapTest extends FunctionalTest
$this->assertEquals(200, $response->getStatusCode(), 'successful loaded nested sitemap'); $this->assertEquals(200, $response->getStatusCode(), 'successful loaded nested sitemap');
Config::inst()->update(GoogleSitemap::class, 'objects_per_sitemap', $original); Config::inst()->set(GoogleSitemap::class, 'objects_per_sitemap', $original);
} }
public function testGetItemsWithPages() public function testGetItemsWithPages(): void
{ {
if (!class_exists('Page')) { if (!class_exists('Page')) {
$this->markTestIncomplete('No cms module installed, page related test skipped'); $this->markTestIncomplete('No cms module installed, page related test skipped');
} }
$page = $this->objFromFixture('Page', 'Page1'); $page = $this->objFromFixture('Page', 'Page1');
$page->publish('Stage', 'Live'); $page->publishSingle();
$page->flushCache(); $page->flushCache();
$page2 = $this->objFromFixture('Page', 'Page2'); $page2 = $this->objFromFixture('Page', 'Page2');
$page2->publish('Stage', 'Live'); $page2->publishSingle();
$page2->flushCache(); $page2->flushCache();
$this->assertDOSContains(array( $this->assertListContains(array(
array('Title' => 'Testpage1'), array('Title' => 'Testpage1'),
array('Title' => 'Testpage2') array('Title' => 'Testpage2')
), GoogleSitemap::inst()->getItems(SiteTree::class), "There should be 2 pages in the sitemap after publishing"); ), GoogleSitemap::inst()->getItems(SiteTree::class), "There should be 2 pages in the sitemap after publishing");
@ -257,18 +212,18 @@ class GoogleSitemapTest extends FunctionalTest
// check if we make a page readonly that it is hidden // check if we make a page readonly that it is hidden
$page2->CanViewType = 'LoggedInUsers'; $page2->CanViewType = 'LoggedInUsers';
$page2->write(); $page2->write();
$page2->publish('Stage', 'Live'); $page2->publishSingle();
$this->logOut(); $this->logOut();
$this->assertDOSEquals(array( $this->assertListEquals(array(
array('Title' => 'Testpage1') array('Title' => 'Testpage1')
), GoogleSitemap::inst()->getItems(SiteTree::class), "There should be only 1 page, other is logged in only"); ), GoogleSitemap::inst()->getItems(SiteTree::class), "There should be only 1 page, other is logged in only");
} }
public function testAccess() public function testAccess(): void
{ {
Config::inst()->update(GoogleSitemap::class, 'enabled', true); Config::inst()->set(GoogleSitemap::class, 'enabled', true);
$response = $this->get('sitemap.xml'); $response = $this->get('sitemap.xml');
@ -280,7 +235,7 @@ class GoogleSitemapTest extends FunctionalTest
$this->assertEquals(200, $response->getStatusCode(), 'Sitemap returns a 200 success when enabled'); $this->assertEquals(200, $response->getStatusCode(), 'Sitemap returns a 200 success when enabled');
$this->assertEquals('application/xml; charset="utf-8"', $response->getHeader('Content-Type')); $this->assertEquals('application/xml; charset="utf-8"', $response->getHeader('Content-Type'));
Config::inst()->update(GoogleSitemap::class, 'enabled', false); Config::inst()->set(GoogleSitemap::class, 'enabled', false);
$response = $this->get('sitemap.xml'); $response = $this->get('sitemap.xml');
$this->assertEquals(404, $response->getStatusCode(), 'Sitemap index returns a 404 when disabled'); $this->assertEquals(404, $response->getStatusCode(), 'Sitemap index returns a 404 when disabled');
@ -289,7 +244,7 @@ class GoogleSitemapTest extends FunctionalTest
$this->assertEquals(404, $response->getStatusCode(), 'Sitemap file returns a 404 when disabled'); $this->assertEquals(404, $response->getStatusCode(), 'Sitemap file returns a 404 when disabled');
} }
public function testDecoratorAddsFields() public function testDecoratorAddsFields(): void
{ {
if (!class_exists("Page")) { if (!class_exists("Page")) {
$this->markTestIncomplete('No cms module installed, page related test skipped'); $this->markTestIncomplete('No cms module installed, page related test skipped');
@ -305,7 +260,7 @@ class GoogleSitemapTest extends FunctionalTest
$this->assertInstanceOf(LiteralField::class, $tab->fieldByName('GoogleSitemapIntro')); $this->assertInstanceOf(LiteralField::class, $tab->fieldByName('GoogleSitemapIntro'));
} }
public function testGetPriority() public function testGetPriority(): void
{ {
if (!class_exists("Page")) { if (!class_exists("Page")) {
$this->markTestIncomplete('No cms module installed, page related test skipped'); $this->markTestIncomplete('No cms module installed, page related test skipped');
@ -326,7 +281,7 @@ class GoogleSitemapTest extends FunctionalTest
$this->assertFalse($page->getGooglePriority()); $this->assertFalse($page->getGooglePriority());
} }
public function testUnpublishedPage() public function testUnpublishedPage(): void
{ {
if (!class_exists('SilverStripe\CMS\Model\SiteTree')) { if (!class_exists('SilverStripe\CMS\Model\SiteTree')) {
$this->markTestSkipped('Test skipped; CMS module required for testUnpublishedPage'); $this->markTestSkipped('Test skipped; CMS module required for testUnpublishedPage');
@ -335,12 +290,12 @@ class GoogleSitemapTest extends FunctionalTest
$orphanedPage = new \SilverStripe\CMS\Model\SiteTree(); $orphanedPage = new \SilverStripe\CMS\Model\SiteTree();
$orphanedPage->ParentID = 999999; // missing parent id $orphanedPage->ParentID = 999999; // missing parent id
$orphanedPage->write(); $orphanedPage->write();
$orphanedPage->publish("Stage", "Live"); $orphanedPage->publishSingle();
$rootPage = new \SilverStripe\CMS\Model\SiteTree(); $rootPage = new \SilverStripe\CMS\Model\SiteTree();
$rootPage->ParentID = 0; $rootPage->ParentID = 0;
$rootPage->write(); $rootPage->write();
$rootPage->publish("Stage", "Live"); $rootPage->publishSingle();
$oldMode = Versioned::get_reading_mode(); $oldMode = Versioned::get_reading_mode();
Versioned::set_reading_mode('Live'); Versioned::set_reading_mode('Live');

View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type='text/xsl' href='http://localhostsitemap.xml/styleSheetIndex'?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<sitemap>
<loc>http://localhostsitemap.xml/sitemap/Wilr-GoogleSitemaps-Tests-Model-TestDataObject/1</loc>
<lastmod>2023-02-13</lastmod>
</sitemap>
<sitemap>
<loc>http://localhostsitemap.xml/sitemap/Wilr-GoogleSitemaps-Tests-Model-OtherDataObject/1</loc>
<lastmod>2023-02-13</lastmod>
</sitemap>
</sitemapindex>

View File

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type='text/xsl' href='http://localhostsitemap.xml/styleSheetIndex'?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<sitemap>
<loc>http://localhostsitemap.xml/sitemap/Wilr-GoogleSitemaps-Tests-Model-TestDataObject/1</loc>
<lastmod>2023-02-13</lastmod>
</sitemap>
<sitemap>
<loc>http://localhostsitemap.xml/sitemap/Wilr-GoogleSitemaps-Tests-Model-TestDataObject/2</loc>
<lastmod>2023-02-13</lastmod>
</sitemap>
<sitemap>
<loc>http://localhostsitemap.xml/sitemap/Wilr-GoogleSitemaps-Tests-Model-TestDataObject/3</loc>
<lastmod>2023-02-13</lastmod>
</sitemap>
</sitemapindex>

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type='text/xsl' href='http://localhostsitemap.xml/styleSheetIndex'?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<sitemap>
<loc>http://localhostsitemap.xml/sitemap/GoogleSitemapRoute/1</loc>
</sitemap>
</sitemapindex>