0

セグメントが埋め込まれた Web サイトの RSS フィードを取得したかったのですが、取得できませんでした。気性データを使用した後、XML がフィードにつながったが、検証されないことがわかりました。以下を返すフィードの有効性をテストしました。

これはフィードではなくウェブページのようです。このページに関連付けられたフィードを探しましたが、見つかりませんでした。検証するフィードのアドレスを入力してください。

この XML のソース コード(以下のように変更され、切り詰められています) を見ると、HTML ページではないようです。

<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:bt="http://example.com/2009/atom_extensions">
  <title>IDUG DB2 Tech Channel</title>
  <id>tag:example.com,2012:channel:7637</id>
  <bt:description>Desciption</bt:description>
  <subtitle>Joint DB2 Tech Talk series sponsored by IDUG with IBM</subtitle>
  <updated>2012-04-18T16:53:39Z</updated>
  <link href="http://www.example.org" rel="alternate" type="text/html"/>
  <link href="http://www.example.com/channel/7637/feed" rel="self" type="application/atom+xml"/>
  <entry>
    <id>tag:example.com,2012:communication:47115</id>
    <title>DB2 Tech Talk: Oracle Database and PL/SQL Compatibility Features of DB2 10</title>
    <updated>2012-05-31T16:30:00Z</updated>
    <summary>blah blah</summary>
    <author>
      <name>Serge Rielau</name>
    </author>
    <bt:communication id="47115"/>
    <bt:channel id="7637"/>
    <bt:status>upcoming</bt:status>
    <bt:format>audio</bt:format>
    <bt:duration>5400</bt:duration>
    <bt:start>1338481800</bt:start>
    <bt:entryTime>1338481500</bt:entryTime>
    <bt:closeTime>1338487500</bt:closeTime>
    <bt:rating>0</bt:rating>
    <link href="http://www.example.org?commid=47115" rel="alternate" type="text/html"/>
    <link href="http://www.example.com/communication/47115/tn1_1.png" rel="enclosure" type="image/png" title="thumbnail"/>
    <link href="http://www.example.com/communication/47115/slide1_001.png" rel="related" type="image/png" title="preview"/>
    <link href="http://www.example.com/communication/47115/calendar/ics" rel="related" type="text/calendar" title="calendar"/>
    <category scheme="keyword" term="DB2"/>
    <category scheme="keyword" term="Oracle"/>
    <category scheme="keyword" term="Database"/>
    <category scheme="keyword" term="PL/SQL"/>
    <category scheme="keyword" term="compatibility"/>
    <category scheme="keyword" term="SQL"/>
  </entry>
  ...
</feed>

これが有効な RSS フィードではないのはなぜですか? http://www.idug-db2.com/のページには、使用できる RSS フィードがありますか?

4

1 に答える 1

0

RSS は XML の一種であり、それが有効であるために表示される必要がある独自の定義された要素のセットを持っています。

RSS は XML の方言です。すべての RSS ファイルは、World Wide Web Consortium (W3C) Web サイトで公開されている XML 1.0 仕様に準拠している必要があります。

翼のあるエルフと鉱夫のドワーフがヒューマノイドであるかのようですが、同じように作られているわけではありません。あなたがここに持っているのと同じもの。これは有効な XML フィードであり、サイトが埋め込み部分で必要に応じて食べたり消化したりできます。

ただし、必要な要素がなく、RSS 仕様に該当しない要素が追加されていないため、有効な RSS フィードではありません。

必要に応じて XML フィード ソースを解釈できるパーサーがある場合、または独自のクラス/メソッドを記述できる場合は、探しているパーサーで十分です。サンプルサイトが行ったように。

仕様で定義された形式で RSS を期待するリーダーやパーサーには適していません。

于 2012-04-28T01:13:14.000 に答える