UnitTest( sitemap.asp )

Output

Generating examples as shown at Build and submit a sitemap / Sitemap formats / XML

<?xml version='1.0' encoding='UTF-8'?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
	<url>
		<loc>http://www.example.com/foo.html</loc>
	</url>
</urlset>

<?xml version='1.0' encoding='UTF-8'?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1" xmlns:video="http://www.google.com/schemas/sitemap-video/1.1">
	<url>
		<image:image>
			<image:loc>http://example.com/image.jpg</image:loc>
			<image:caption>Dogs playing poker</image:caption>
		</image:image>
		<video:video>
			<video:content_loc>http://www.example.com/video123.flv</video:content_loc>
			<video:player_loc allow_embed="yes" autoplay="ap=1">http://www.example.com/videoplayer.swf?video=123</video:player_loc>
			<video:thumbnail_loc>http://www.example.com/thumbs/123.jpg</video:thumbnail_loc>
			<video:title>Grilling steaks for summer</video:title>
			<video:description>Cook the perfect steak every time.</video:description>
		</video:video>
		<loc>http://www.example.com/foo.html</loc>
	</url>
</urlset>

Generating examples as shown at Creating a Google News Sitemap

<?xml version='1.0' encoding='UTF-8'?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:news="http://www.google.com/schemas/sitemap-news/0.9">
	<url>
		<news:news>
			<news:publication>
				<news:name>The Example Times</news:name>
				<news:language>en</news:language>
			</news:publication>
			<news:genres>PressRelease, Blog</news:genres>
			<news:publication_date>2008-12-23</news:publication_date>
			<news:title>Companies A, B in Merger Talks</news:title>
			<news:keywords>business, merger, acquisition, A, B</news:keywords>
			<news:stock_tickers>NASDAQ:A, NASDAQ:B</news:stock_tickers>
		</news:news>
		<loc>http://www.example.org/business/article55.html</loc>
	</url>
</urlset>

Generating example as shown at Sample XML Sitemap Index

<?xml version='1.0' encoding='UTF-8'?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
	<sitemap>
		<loc>http://www.example.com/sitemap1.xml.gz</loc>
		<lastmod>2004-10-01T18:23:17+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>http://www.example.com/sitemap2.xml.gz</loc>
		<lastmod>2005-01-01</lastmod>
	</sitemap>
</sitemapindex>

Sources

/axe-ut/sitemap.unit.test.asp

<!--#include virtual="/lib/unit-tests.asp"-->
<!--#include virtual="/lib/axe/classes/interface.asp"-->
<!--#include virtual="/lib/axe/classes/Parsers/json2.asp"-->
<!--#include virtual="/lib/axe/classes/Utilities/stringbuilder.asp"-->
<!--#include virtual="/lib/axe/classes/Utilities/sitemap.asp"-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xml:lang="en">
	<head>
		<title>AXE - Unit Test - Sitemap</title>
		<!--// meta tags //-->
		<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
		<!--// link tags //-->
		<link rel="stylesheet" type="text/css" media="screen" href="/lib/unit-tests.css" />
	</head>
	<body>
		<div id="container">
			<div id="container-hd">
				<h1>UnitTest( sitemap.asp )</h1>
			</div>
			<div id="container-bd">
 
<h2>Output</h2>
<div class="code"><pre><%
 
dim S, Si
 
 
 
 
 
Response.write "Generating examples as shown at <a href='https://support.google.com/webmasters/answer/183668?hl=en'>Build and submit a sitemap</a> / Sitemap formats / XML" & vbNewline
Response.write vbNewline
 
 
 
 
 
with (new Sitemap)
	.Items.push ( (new Sitemap_Item)("http://www.example.com/foo.html").state )
 
	Response.write print_code( "<?xml version='1.0' encoding='UTF-8'?>" ) & vbLF
	Response.write print_code( indentXML( .write() ) ) & vbLF
 
	.dispose
end with
Response.write vbNewline
 
 
 
 
 
set S = new Sitemap
S.AttributeExtensions.set "xmlns:image", "http://www.google.com/schemas/sitemap-image/1.1"
' <image:image>
' 	<image:loc>(required)</image:loc>
' 	<image:caption>(optional)</image:caption>
' 	<image:geo_location>(optional)</image:geo_location>
' 	<image:title>(optional)</image:title>
' 	<image:license>(optional)</image:license>
' </image:image>
 
S.AttributeExtensions.set "xmlns:video", "http://www.google.com/schemas/sitemap-video/1.1"
' <video:video>
' 	<video:thumbnail_loc>(required)</video:thumbnail_loc>
' 	<video:title>(required)</video:title>
' 	<video:description>(required)</video:description>
' 	<video:content_loc>(depends)</video:content_loc>
' 	<video:player_loc>(depends)</video:player_loc>
' 	<video:duration>(recommended)</video:duration>
' 	<video:expiration_date>(recommended when applicable)</video:expiration_date>
' 	<video:rating>(optional)</video:rating>
' 	<video:view_count>(optional)</video:view_count>
' 	<video:publication_date>(optional)</video:publication_date>
' 	<video:family_friendly>(optional)</video:family_friendly>
' 	<video:tag>(optional)</video:tag>
' 	<video:category>(optional)</video:category>
' 	<video:restriction>(optional)</video:restriction>
' 	<video:gallery_loc>(optional)</video:gallery_loc>
' 	<video:price>(optional)</video:price>
' 	<video:requires_subscription>(optional)</video:requires_subscription>
' 	<video:uploader>(optional)</video:uploader>
' 	<video:platform>(optional)</video:platform>
' 	<video:live>(optional)</video:live>
' </video:video>
 
set Si = (new Sitemap_Item)("http://www.example.com/foo.html")
 
Si.ElementExtensions.push S.createElement( "image:image", ['->" parse]("{}"), ['->" parse]( join( array( _
  "{" _
, "	'image:loc': 'http://example.com/image.jpg'," _
, "	'image:caption': 'Dogs playing poker' " _
, "}" _
), "" ) ) )
 
Si.ElementExtensions.push S.createElement( "video:video", ['->" parse]("{}"), ['->" parse]( join( array( _
  "{" _
, "	'video:content_loc': 'http://www.example.com/video123.flv'," _
, "	'video:player_loc': {" _
, "		'@allow_embed': 'yes'," _
, "		'@autoplay': 'ap=1'," _
, "		'#text': 'http://www.example.com/videoplayer.swf?video=123'" _
, "	}," _
, "	'video:thumbnail_loc': 'http://www.example.com/thumbs/123.jpg'," _
, "	'video:title': 'Grilling steaks for summer'," _
, "	'video:description': 'Cook the perfect steak every time.'" _
, "}" _
), "" ) ) )
 
S.Items.push Si.state
Si.dispose
set Si = nothing
 
Response.write print_code( "<?xml version='1.0' encoding='UTF-8'?>" ) & vbLF
Response.write print_code( indentXML( S.write() ) ) & vbLF
 
S.dispose
set S = nothing
Response.write vbNewline
 
 
 
 
 
Response.write "Generating examples as shown at <a href='https://support.google.com/news/publisher/answer/74288'>Creating a Google News Sitemap</a>" & vbNewline
Response.write vbNewline
 
 
 
 
 
set S = new Sitemap
S.AttributeExtensions.set "xmlns:news", "http://www.google.com/schemas/sitemap-news/0.9"
' <news:news>
' 	<news:publication>
' 		<news:name>(required)</news:name>
' 		<news:language>(required)</news:language>
' 	</news:publication>
' 	<news:genres>(required, if genres apply; otherwise can be omitted)</news:genres>
' 	<news:publication_date>(required)</news:publication_date>
' 	<news:title>(required)</news:title>
' 	<news:keywords>(optional)</news:keywords>
' 	<news:stock_tickers>(optional)</news:stock_tickers>
' </news:news>
 
set Si = (new Sitemap_Item)("http://www.example.org/business/article55.html")
Si.ElementExtensions.push S.createElement( "news:news", ['->" parse]("{}"), ['->" parse]( join( array( _
  "{" _
, "	'news:publication': {" _
, "		'news:name': 'The Example Times'," _
, "		'news:language': 'en'" _
, "	}," _
, "	'news:genres': 'PressRelease, Blog'," _
, "	'news:publication_date': '2008-12-23'," _
, "	'news:title': 'Companies A, B in Merger Talks'," _
, "	'news:keywords': 'business, merger, acquisition, A, B'," _
, "	'news:stock_tickers': 'NASDAQ:A, NASDAQ:B'" _
, "}" _
), "" ) ) )
 
S.Items.push Si.state
Si.dispose
set Si = nothing
 
Response.write print_code( "<?xml version='1.0' encoding='UTF-8'?>" ) & vbLF
Response.write print_code( indentXML( S.write() ) ) & vbLF
 
S.dispose
set S = nothing
Response.write vbNewline
 
 
 
 
 
Response.write "Generating example as shown at <a href='https://www.sitemaps.org/protocol.html#index'>Sample XML Sitemap Index</a>" & vbNewline
Response.write vbNewline
 
 
 
 
 
set S = new SiteIndex
set Si = (new SiteIndex_Item)("http://www.example.com/sitemap1.xml.gz")
Si.lastmod = "2004-10-01T18:23:17+00:00"
S.Items.push Si.state
Si.dispose
set Si = nothing
 
set Si = (new SiteIndex_Item)("http://www.example.com/sitemap2.xml.gz")
Si.lastmod = "2005-01-01"
S.Items.push Si.state
Si.dispose
set Si = nothing
 
Response.write print_code( "<?xml version='1.0' encoding='UTF-8'?>" ) & vbLF
Response.write print_code( indentXML( S.write() ) ) & vbLF
 
S.dispose
set S = nothing
Response.write vbNewline
 
 
 
 
 
function ['->" parse](byVal source)
	set ['->" parse] = JSON.parse( replace( source, "'", """" ) )
end function
 
function print_code(byVal code)
	print_code = replace( code, "<", "&lt;" )
end function
 
%></pre></div>
 
			</div>
			<div id="container-ft">
				<h2>Sources</h2>
				<h3><%= Request.ServerVariables("SCRIPT_NAME") %></h3>
				<div class="code"><%= geshify( loadTextFile( Server.mapPath( Request.ServerVariables("SCRIPT_NAME") ) ), "asp" ) %></div>
			</div>
		</div>
		<!--// javascript tags //-->
	</body>
</html>