Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > can't get rss to validate, error on pubDate, yet pubDate is listed in the DTD as valid

Reply
Thread Tools

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

 
 
lkrubner@geocities.com
Guest
Posts: n/a
 
      01-28-2005
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.c...%2Fpage464.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?

 
Reply With Quote
 
 
 
 
Janwillem Borleffs
Guest
Posts: n/a
 
      01-30-2005
http://www.velocityreviews.com/forums/(E-Mail Removed) wrote:
> 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



 
Reply With Quote
 
 
 
 
lkrubner@geocities.com
Guest
Posts: n/a
 
      02-10-2005

Janwillem Borleffs wrote:
> 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?u...2Fpage2494.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.

 
Reply With Quote
 
Janwillem Borleffs
Guest
Posts: n/a
 
      02-12-2005
(E-Mail Removed) wrote:
> 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



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Two ways to generate RSS - rss/maker and rss/2.0 - which is better? Jonathan Groll Ruby 1 06-27-2009 03:53 AM
RSS::Parser.parse pubdate changing back Andrew Doades Ruby 1 12-03-2008 02:08 PM
How to parse <pubDate> in RSS Ruby Girl Ruby 2 09-06-2008 04:17 AM
Is that discount code valid for and limited to one exam listed? Elliot Microsoft Certification 1 05-22-2007 03:03 PM
Reading RSS feed - significance of pubDate? Julian XML 0 07-29-2005 12:50 PM



Advertisments