problem with XML sitemap

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
someguyhere
Forum Contributor
Posts: 181
Joined: Sun Jul 27, 2008 3:24 pm

problem with XML sitemap

Post by someguyhere »

Within a script I'm working on, a page is added to the site map. When I view the site map in a browser, there is a line break that shouldn't exist before and after the url, as such:

Code: Select all

<urlset>
−<url>
  −<loc>
  http://domain.org/test-page-407.htm
  </loc>
  <lastmod>2011-01-05 10:19:02</lastmod>
  <changefreq>monthly</changefreq>
  <priority>0.5</priority>
</url>
If I click view source, the line breaks are gone:

Code: Select all

<url>
<loc>http://domain.org/test-page-407.htm</loc>
<lastmod>2011-01-05 10:19:02</lastmod>
<changefreq>monthly</changefreq>
<priority>0.5</priority>
</url>
If it makes a difference, here are the first two lines of the site map:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
Any idea what's causing it? Does it matter?
josh
DevNet Master
Posts: 4872
Joined: Wed Feb 11, 2004 3:23 pm
Location: Palm beach, Florida

Re: problem with XML sitemap

Post by josh »

Your browser is formatting it. Its an XML document, not a TXT document. Keep that in mind. For example some browsers show a blog like user interface when viewing RSS feeds, rather than showing the code.
someguyhere
Forum Contributor
Posts: 181
Joined: Sun Jul 27, 2008 3:24 pm

Re: problem with XML sitemap

Post by someguyhere »

Ahh...ok, thx :)
Post Reply