src/XML/DOM/GoogleSitemapBuilder.php
public static function buildSitemap( $links, $baseUrl = "" )
	{
		$root	= new XML_DOM_Node( "urlset" );
		$root->setAttribute( 'xmlns', "http://www.google.com/schemas/sitemap/0.84" );
		foreach( $links as $link )
		{
			$child	= new XML_DOM_Node( "url" );
			$loc	= new XML_DOM_Node( "loc", $baseUrl.$link );
			$child->addChild( $loc );
			$root->addChild( $child );
		}
		$builder	= new XML_DOM_Builder();
		return $builder->build( $root );
	}
public static function buildSitemap( $links, $baseUrl = "" )
	{
		$root	= new XML_DOM_Node( "urlset" );
		$root->setAttribute( 'xmlns', "http://www.google.com/schemas/sitemap/0.84" );
		foreach( $links as $link )
		{
			$child	= new XML_DOM_Node( "url" );
			$loc	= new XML_DOM_Node( "loc", $baseUrl.$link );
			$child->addChild( $loc );
			$root->addChild( $child );
		}
		$builder	= new XML_DOM_Builder();
		return $builder->build( $root );
	}
public static function buildSitemap ( $ links , $ baseUrl = "" ) { $ root = new XML_DOM_Node ( "urlset" ) ; $ root -> setAttribute ( 'xmlns' , "http://www.google.com/schemas/sitemap/0.84" ) ; foreach ( $ links as $ link ) { $ child = new XML_DOM_Node ( "url" ) ; $ loc = new XML_DOM_Node ( "loc" , $ baseUrl . $ link ) ; $ child -> addChild ( $ loc ) ; $ root -> addChild ( $ child ) ; } $ builder = new XML_DOM_Builder ( ) ; return $ builder -> build ( $ root ) ; }
Builds and return XML of Sitemap.
@access		public
@static
@param		string		$links		List of Sitemap Link
@param		string		$baseUrl	Basic URL to add to every Link
@return		bool
Builds and return XML of Sitemap .