can't get rss to validate, error on pubDate, yet pubDate is listed in the DTD as valid


L

lkrubner

Pardon my ignorance on XML DTD's. I'm having trouble reading the one
for RSS .91.

If I take this page:

http://www.bluewallllc.com/hms/rss/page464.xml

and I run it through this validator:

http://www.feedvalidator.org/check.cgi?url=http://www.bluewallllc.com/hms/rss/page464.xml

I get this error message:

line 2, column 121: XML parsing error: Element item content does not
follow the DTD, Misplaced pubDate

It highlights this line:

<!DOCTYPE rss PUBLIC "-//Netscape Communications//DTD RSS 0.91//EN"
"http://my.netscape.com/publish/formats/rss-0.91.dtd">

And yet when I go and look at this DTD:

http://my.netscape.com/publish/formats/rss-0.91.dtd

I see that pubDate is listed as a valid element:


<!ELEMENT rss (channel)>
<!ATTLIST rss
version CDATA #REQUIRED> <!-- must be "0.91"> -->
<!ELEMENT channel (title | description | link | language | item+ |
rating? | image? | textinput? | copyright? | pubDate? | lastBuildDate?
| docs? | managingEditor? | webMaster? | skipHours? | skipDays?)*>
<!ELEMENT title (#PCDATA)>
<!ELEMENT description (#PCDATA)>
<!ELEMENT link (#PCDATA)>
<!ELEMENT image (title | url | link | width? | height? |
description?)*>
<!ELEMENT url (#PCDATA)>
<!ELEMENT item (title | link | description)*>
<!ELEMENT textinput (title | description | name | link)*>
<!ELEMENT name (#PCDATA)>
<!ELEMENT rating (#PCDATA)>
<!ELEMENT language (#PCDATA)>
<!ELEMENT width (#PCDATA)>
<!ELEMENT height (#PCDATA)>
<!ELEMENT copyright (#PCDATA)>
<!ELEMENT pubDate (#PCDATA)>
<!ELEMENT lastBuildDate (#PCDATA)>
<!ELEMENT docs (#PCDATA)>
<!ELEMENT managingEditor (#PCDATA)>
<!ELEMENT webMaster (#PCDATA)>
<!ELEMENT hour (#PCDATA)>
<!ELEMENT day (#PCDATA)>
<!ELEMENT skipHours (hour+)>
<!ELEMENT skipDays (day+)>


So why am I being told that it is not in the DTD? What does an error
like this mean?
 
Ad

Advertisements

J

Janwillem Borleffs

And yet when I go and look at this DTD:

http://my.netscape.com/publish/formats/rss-0.91.dtd

I see that pubDate is listed as a valid element:

True, but only as a child of the channel element:

<!ELEMENT channel (title | description | link | language | item+ |
rating? | image? | textinput? | copyright? | pubDate? | lastBuildDate?
docs? | managingEditor? | webMaster? | skipHours? | skipDays?)*>


While the item element can only contain title, link and description
elements:

<!ELEMENT item (title | link | description)*>

To learn more about DTD's, start with the nice tutorial of www.w3schools.com


JW
 
L

lkrubner

Janwillem said:
While the item element can only contain title, link and description
elements:

<!ELEMENT item (title | link | description)*>

To learn more about DTD's, start with the nice tutorial of
www.w3schools.com


Okay, I took out the pubDate and it validated on that server. Then I
switched to a different website on a different server and I started
getting a mismatch of the UTF-8 character encoding and what the web
server said. Check out this:

http://feedvalidator.org/check.cgi?url=http://www.alexmarshall.org/rss/page2494.xml


What do I have to do to get the web server to say UTF-8? And is there
any easy way to filter out wrong bit characters? I think in this case
someone on a Macintosh wrote a document in Microsoft Word and then copy
and pasted it to a form so that it ended up in the RSS feed.
 
Ad

Advertisements

J

Janwillem Borleffs

What do I have to do to get the web server to say UTF-8? And is there
any easy way to filter out wrong bit characters? I think in this case
someone on a Macintosh wrote a document in Microsoft Word and then
copy and pasted it to a form so that it ended up in the RSS feed.

As the recommendation mentions (click the Help link next to the error
message), ensure that the feed is served as application/xml; Typically, this
is done by sending a "Content-Type: application/xml" header along with the
output of your application.


JW
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top