• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Trouble creating sitemap CS5

Community Beginner ,
Jun 04, 2020 Jun 04, 2020

Copy link to clipboard

Copied

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.

Views

552

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 04, 2020 Jun 04, 2020

Copy link to clipboard

Copied

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 & Moderator
Alt-Web Design & Publishing ~ Web : Print : Graphics : Media

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jun 04, 2020 Jun 04, 2020

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 04, 2020 Jun 04, 2020

Copy link to clipboard

Copied

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 & Moderator
Alt-Web Design & Publishing ~ Web : Print : Graphics : Media

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jun 04, 2020 Jun 04, 2020

Copy link to clipboard

Copied

 

Hi Nancy-

 

Sorry - totally my fault for not being more specific-

 

I didn't use the DWCS5 sitemap so wasn't using the DW validator. I added the code generated from XML-Sitemaps to a DW page and saved it as an XML file with DW, but the included code came from XML-Sitemaps.

 

I tested the sitemap using the W3C validator and the XML-sitemaps validators. The XML-Sitemaps validation failure was a surprise because that's where the code came from.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 04, 2020 Jun 04, 2020

Copy link to clipboard

Copied

If you care to post the XML code exactly as generated by the online sitemap generator, I'll look at it and tell you if it's valid XML syntax or not.

 

The W3C markup validation service is not suitable for checking XML because it's an HTML code checker.

https://validator.w3.org/nu/

 

Nancy O'Shea— Product User, Community Expert & Moderator
Alt-Web Design & Publishing ~ Web : Print : Graphics : Media

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jun 04, 2020 Jun 04, 2020

Copy link to clipboard

Copied

Thanks - The posted XML code  from the XML-Sitemaps generator  is verbatim. Only the URLs have been changed.

 

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 04, 2020 Jun 04, 2020

Copy link to clipboard

Copied

There's nothing technically wrong with your sitemap except that it's incomplete.  And if you're on a secure HTTPS server, you probably want to use links with HTTPS instead of HTTP for consistency.

 

This is the format I use. 

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance" xmlns="https://www.sitemaps.org/schemas/sitemap/0.9" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 https://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">
<url>
<loc>https://example.com/</loc>
<lastmod>2020-06-04</lastmod>
<changefreq>weekly</changefreq>
<priority>0.8</priority>
</url>
<url>
<loc>https://example.com/index.php</loc>
<lastmod>2020-06-04</lastmod>
<changefreq>weekly</changefreq>
<priority>0.8</priority>
</url>
<url>
<loc>https://example.com/page2.php</loc>
<lastmod>2020-06-04</lastmod>
<changefreq>monthly</changefreq>
<priority>0.5</priority>
</url>
</urlset>

 

Nancy O'Shea— Product User, Community Expert & Moderator
Alt-Web Design & Publishing ~ Web : Print : Graphics : Media

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jun 05, 2020 Jun 05, 2020

Copy link to clipboard

Copied

LATEST

Thanks -

 

It's a personal blog site so none of the posts ever get modified once they've been posted, which is why I opted not to include

<lastmod>2020-06-04</lastmod>
<changefreq>monthly</changefreq>

when  generating the code. 

 

Your code uses the xmlns in the urlset code - I tried that but don't remember if it was in the same order as yours. I'll try again later.

 

Thanks again for posting.

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines