Skip to main content
Participant
June 4, 2020
Question

Trouble creating sitemap CS5

  • June 4, 2020
  • 1 reply
  • 835 views

Hey everyone -

 

It's been a while since I've visted the DW forums, and I hope everyone is doing well.

 

I'm trying to create an XML sitemap for my personal blog. I've tried the built-in XML sitemap generator in DWCS5, but that sitemap seems to be more for collaboration than search engines. I then tried an online XML generator, added the generated text to DW, saved it as .xml and uploaded the file. Everything looks okay, but the file won't validate, and I get the feeling I'm supposed to be adding something to the generated content. I've searched and searched but I'm not familiar at all with XML or Schema so I haven't found an answer yet.

 

The xml file starts with the header from DW:

<?xml version="1.0" encoding="utf-8"?>

 

The next lines are from the online generator:


<urlset xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">
<!--created with Free Online Sitemap Generator www.xml-sitemaps.com -->
<url>

<loc>https://example.com/</loc>
<priority>1.00</priority></url>
<url>
<loc>https://example.com/index.html</loc>
<priority>0.80</priority>
</url>
<url>
<loc>https://example.com/page2.html</loc>
<priority>0.80</priority>
</url>
</urlset>

Obviously there are quite a few more entries but they're all the same so they've been left out for brevity.


The error that shows up most often in the validator is:

Fatal Error: undeclared attribute prefix in: xsi:schemaLocation
At line 3, column 128
.9/sitemap.xsd">?<!--? created with Free
with the closing tag after the .xsd" highlighted in yellow. There's a question mark in the error that's not in the commented-out text - maybe that's a clue?

 

I keep adding and subtracting text from the first urlset xsi link and another error that sometimes comes up is:

Incorrect http header content-type: "text/html" (expected: "application/xml")

 

What am I missing? I searched the forum but found surpringly few threads, so maybe it's something simple?

 

Thanks for your time.

    This topic has been closed for replies.

    1 reply

    Nancy OShea
    Community Expert
    Community Expert
    June 4, 2020

    Use the online XML sitemap generator below.  Validation is not necessary. 

    https://www.xml-sitemaps.com/

     

    Keep in mind, XML sitemaps are for search engine crawlers only, not fit for human consumption.  For learning XML,  see links below.

    XML Validation - https://www.xmlvalidation.com/

    XML Tutorial  - https://www.w3schools.com/xml/

     

    If you want a sitemap for humans, use HTML instead of XML.

     

    Post back if you still have questions.

     

    Nancy O'Shea— Product User & Community Expert
    lostintnAuthor
    Participant
    June 4, 2020

    Hi Nancy-

     

    Thanks for your reply.

     

    The XML generator is where the posted example above came from, and as mentioned, the reason for not using the DW sitemap is because it seemed to be geared towards human collaboration instead of search engines.

     

    Why wouldn't an XML file need to be validated?

     

    Thanks again.

    Nancy OShea
    Community Expert
    Community Expert
    June 4, 2020

    The sitemap generator does exactly what it needs to do.  Trust the code.  Besides, the validation in outdated CS5 was for HTML only, not XML. 

     

    Nancy O'Shea— Product User & Community Expert