creating google xml site map at localhost?

XML, Perl, Python, and other languages can be discussed here, even if it isn't PHP (We might forgive you).

Moderator: General Moderators

Post Reply
mayanktalwar1988
Forum Contributor
Posts: 133
Joined: Wed Jul 08, 2009 2:44 am

creating google xml site map at localhost?

Post by mayanktalwar1988 »

i want to create xml site map to be submitted to google want to create it at localhost offline i mean...tommorow i craeted one google denied it saying it cantains html code...i just created it fetching link from database and outputting them with google sitemap format...now how to create valid xml site map..i can create the links from database..but xml i dont know
User avatar
Apollo
Forum Regular
Posts: 794
Joined: Wed Apr 30, 2008 2:34 am

Re: creating google xml site map at localhost?

Post by Apollo »

What do you mean "outputting them with google sitemap format ... but xml i dont know", considering the fact that google's sitemap format is xml?
mayanktalwar1988
Forum Contributor
Posts: 133
Joined: Wed Jul 08, 2009 2:44 am

Re: creating google xml site map at localhost?

Post by mayanktalwar1988 »

outputting the links with the format means i outputted them with the help of php and html in a format of sitemap..and i just copied the text considering it will work but gogle said its a html even when i submitted text not the page source of the format..just tell me what to do craete sitemap ?
User avatar
Apollo
Forum Regular
Posts: 794
Joined: Wed Apr 30, 2008 2:34 am

Re: creating google xml site map at localhost?

Post by Apollo »

It's quite easy to find with with google.... http://www.sitemaps.org/protocol.php
mayanktalwar1988
Forum Contributor
Posts: 133
Joined: Wed Jul 08, 2009 2:44 am

Re: creating google xml site map at localhost?

Post by mayanktalwar1988 »

apollo i know the format and everything the thing is that i used <br/> tags to separate the links different links. i outputted in browser the same format like you shown and copied it and submitted it google rejected it saying it has html in it
User avatar
Apollo
Forum Regular
Posts: 794
Joined: Wed Apr 30, 2008 2:34 am

Re: creating google xml site map at localhost?

Post by Apollo »

mayanktalwar1988 wrote:the thing is that i used <br/> tags to separate the links different links.
Well then you're not following the official format, cause there shouldn't be any <br/> tags in there :)

Note that you see multiple lines in the example xml on that site, this does NOT mean there are <br> tags in there. Only in HTML (i.e. something that is meant to be displayed in a browser), <br> means a line break.

In XML you can use "\n" characters (like most text based formats) or simply no linebreaks at all. XML does not depend on lines, so you could just as well concatenate everything without any breaks or whitespace whatsoever:
[text]<url><loc>http://www.example.com/</loc><lastmod>2 ... l><loc>etc...[/text]
mayanktalwar1988
Forum Contributor
Posts: 133
Joined: Wed Jul 08, 2009 2:44 am

Re: creating google xml site map at localhost?

Post by mayanktalwar1988 »

ok thanks now no line formatting :)
Post Reply