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

Discussion in 'XML' started by lkrubner@geocities.com, Jan 28, 2005.

  1. Guest

    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?
    , Jan 28, 2005
    #1
    1. Advertising

  2. 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
    Janwillem Borleffs, Jan 30, 2005
    #2
    1. Advertising

  3. Guest

    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?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.
    , Feb 10, 2005
    #3
  4. 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
    Janwillem Borleffs, Feb 12, 2005
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. lawrence
    Replies:
    9
    Views:
    1,096
    lawrence
    May 29, 2004
  2. Julian
    Replies:
    0
    Views:
    444
    Julian
    Jul 29, 2005
  3. Ruby Girl

    How to parse <pubDate> in RSS

    Ruby Girl, Sep 6, 2008, in forum: Ruby
    Replies:
    2
    Views:
    231
    Peña, Botp
    Sep 6, 2008
  4. Andrew Doades

    RSS::Parser.parse pubdate changing back

    Andrew Doades, Dec 3, 2008, in forum: Ruby
    Replies:
    1
    Views:
    106
    melampus
    Dec 3, 2008
  5. Jonathan Groll
    Replies:
    1
    Views:
    252
    Kouhei Sutou
    Jun 27, 2009
Loading...

Share This Page