Atom配信フォーマット(共通のAtomコンストラクト)

広告

広告

原文

最終更新
2006-10-02T21:21:00+09:00
この記事のURI参照
https://www.7key.jp/rfc/4287/rfc4287_3.html#source

Atom配信フォーマット(和訳)

最終更新
2006-10-04T20:25:00+09:00
この記事のURI参照
https://www.7key.jp/rfc/4287/rfc4287_3.html#translation

3. 共通のAtomコンストラクト

   Many of Atom's elements share a few common structures.  This section
   defines those structures and their requirements for convenient
   reference by the appropriate element definitions.

Atomの要素は、いくつかの共通する構造を共有することが少なくない。当章では適切な要素定義をすることにより、参照し易い構造と必要条件を定義する。

   When an element is identified as being a particular kind of
   construct, it inherits the corresponding requirements from that
   construct's definition in this section.

ある特定種類のコンストラクトとして識別される要素は、当章内のコンストラクトの定義から対応する要求事項を継承することとなる。

   Note that there MUST NOT be any white space in a Date construct or in
   any IRI.  Some XML-emitting implementations erroneously insert white
   space around values by default, and such implementations will emit
   invalid Atom Documents.

DateコンストラクトやIRI内で空白を用いてはならない(MUST NOT)ことに注意が必要である。XML発行の実装によっては、値の前後に不必要な空白を挿入するものがあり、それによって妥当ではないAtom文書が発行される可能性がある。

3.1. Textコンストラクト

   A Text construct contains human-readable text, usually in small
   quantities.  The content of Text constructs is Language-Sensitive.

   atomPlainTextConstruct =
      atomCommonAttributes,
      attribute type { "text" | "html" }?,
      text

   atomXHTMLTextConstruct =
      atomCommonAttributes,
      attribute type { "xhtml" },
      xhtmlDiv

   atomTextConstruct = atomPlainTextConstruct | atomXHTMLTextConstruct

通常少量ではあるが、Textコンストラクトは人間によって可読な文字列を含む。Textコンストラクトの内容は言語依存である。

3.1.1. "type"属性
   Text constructs MAY have a "type" attribute.  When present, the value
   MUST be one of "text", "html", or "xhtml".  If the "type" attribute
   is not provided, Atom Processors MUST behave as though it were
   present with a value of "text".  Unlike the atom:content element
   defined in Section 4.1.3, MIME media types [MIMEREG] MUST NOT be used
   as values for the "type" attribute on Text constructs.

Textコンストラクトにtype属性を用いてもよい(MAY)。type属性が取り得る値は、texthtmlxhtmlのいずれか1つでなければならない(MUST)。あるTextコンストラクトにtype属性が指定されていない場合、Atom処理装置はそのTextコンストラクトのtype属性値がtextであると解釈をしなければならない(MUST)。「4.1.3. "atom:content"要素」で定義のあるatom:contentとは違い、Textコンストラクトのtype属性値としてMIMEメディアタイプ[MIMEREG]を用いてはならない(MUST NOT)。

3.1.1.1. Text
   Example atom:title with text content:

   ...
   <title type="text">
     Less: <
   </title>
   ...

   If the value is "text", the content of the Text construct MUST NOT
   contain child elements.  Such text is intended to be presented to
   humans in a readable fashion.  Thus, Atom Processors MAY collapse
   white space (including line breaks) and display the text using
   typographic techniques such as justification and proportional fonts.

テキストを内容として持つatom:titleの例:

type属性値がtextの場合、そのTextコンストラクトの内容として子要素を含んではならない(MUST NOT)。内容となる文字列は、人間が判読可能な形式を提示するものと意図される。そのためAtom処理装置は、(改行を含め)複数の空白をまとめたり、行端揃えやプロポーショナルフォントのような印刷技術を用いて文字列を整形表示したりすることができる(MAY)。

3.1.1.2. HTML
   Example atom:title with HTML content:

   ...
   <title type="html">
     Less: &lt;em&gt; &amp;lt; &lt;/em&gt;
   </title>
   ...

   If the value of "type" is "html", the content of the Text construct
   MUST NOT contain child elements and SHOULD be suitable for handling
   as HTML [HTML].  Any markup within MUST be escaped; for example,
   "<br>" as "&lt;br&gt;".  HTML markup within SHOULD be such that it could
   validly appear directly within an HTML <DIV> element, after
   unescaping.  Atom Processors that display such content MAY use that
   markup to aid in its display.

HTMLを内容として持つatom:titleの例:

type属性値がhtmlの場合、そのTextコンストラクトの内容として子要素を含んではならず(MUST NOT)、そのTextコンストラクトの内容はHTMLとして処理に適したものであるべきだ(SHOULD)。例えば<br>であれば&lt;br&gt;のように、Textコンストラクトの内容としてのマークアップは全てエスケープしなければならず(MUST)、エスケープを解除した後に直接HTMLの<DIV>要素に正当に含まれるようなものであるべきだ(SHOULD)。Atom処理装置は、マークアップを解釈した上でその内容を表示してもよい(MAY)。

3.1.1.3. XHTML
   Example atom:title with XHTML content:

   ...
   <title type="xhtml" xmlns:xhtml="http://www.w3.org/1999/xhtml">
     <xhtml:div>
       Less: <xhtml:em> &lt; </xhtml:em>
     </xhtml:div>
   </title>
   ...

   If the value of "type" is "xhtml", the content of the Text construct
   MUST be a single XHTML div element [XHTML] and SHOULD be suitable for
   handling as XHTML.  The XHTML div element itself MUST NOT be
   considered part of the content.  Atom Processors that display the
   content MAY use the markup to aid in displaying it.  The escaped
   versions of characters such as "&" and ">" represent those
   characters, not markup.

type属性値がxhtmlの場合、そのTextコンストラクトの内容は1つのXHTML div要素でなければならず(MUST)、そのTextコンストラクトの内容はXHTMLとして処理に適したものであるべきだ(SHOULD)。XHTMLのdiv要素そのものを、そのコンテンツの一部と解釈すべきではない(MUST NOT)。アトム処理装置は、マークアップを解釈した上でその内容を表示してもよい(MAY)。"&"や">"のようにエスケープされた文字の結果については、マークアップとしてではなく文字そのものとして表すこととなる。

   Examples of valid XHTML content:

   ...
   <summary type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
         This is <b>XHTML</b> content.
      </div>
   </summary>
   ...
   <summary type="xhtml">
      <xhtml:div xmlns:xhtml="http://www.w3.org/1999/xhtml">
         This is <xhtml:b>XHTML</xhtml:b> content.
      </xhtml:div>
   </summary>
   ...

妥当なXHTMLの内容の例:

   The following example assumes that the XHTML namespace has been bound
   to the "xh" prefix earlier in the document:

   ...
   <summary type="xhtml">
      <xh:div>
         This is <xh:b>XHTML</xh:b> content.
      </xh:div>
   </summary>
   ...

XHTML名前空間が、文書内で既に"xh"プレフィックスに結び付けられている場合の例:

3.2. Personコンストラクト

   A Person construct is an element that describes a person,
   corporation, or similar entity (hereafter, 'person').

   atomPersonConstruct =
      atomCommonAttributes,
      (element atom:name { text }
       & element atom:uri { atomUri }?
       & element atom:email { atomEmailAddress }?
       & extensionElement*)

   This specification assigns no significance to the order of appearance
   of the child elements in a Person construct.  Person constructs allow
   extension Metadata elements (see Section 6.4).

Personコンストラクトは、人、会社、又は同様の団体(これ以降は"person"と表す)を指し示す要素である。

当仕様書で示しているPersonコンストラクト内にて子要素が出現する順番は意味を持つものではない。Personコンストラクトは拡張メタデータ要素を認めるものである(「6.4. 拡張要素」を参照)。

3.2.1. "atom:name"要素
   The "atom:name" element's content conveys a human-readable name for
   the person.  The content of atom:name is Language-Sensitive.  Person
   constructs MUST contain exactly one "atom:name" element.

atom:name要素の内容は、人間によって判読可能なpersonの名称を伝達するものである。atom:nameの内容は言語依存である。Personコンストラクトは必ずただ1つのatom:name要素を含まなければならない(MUST)。

3.2.2. "atom:uri"要素
   The "atom:uri" element's content conveys an IRI associated with the
   person.  Person constructs MAY contain an atom:uri element, but MUST
   NOT contain more than one.  The content of atom:uri in a Person
   construct MUST be an IRI reference [RFC3987].

atom:uri要素の内容は、personに関連付けられたIRIを伝達するものである。Personコンストラクトは1つのatom:uri要素を含んでもよいが(MAY)、1つ以上含んではならない(MUST NOT)。Personコンストラクト内のatom:uriの内容はIRI参照[RFC3987]でなければならない(MUST)。

3.2.3. "atom:email"要素
   The "atom:email" element's content conveys an e-mail address
   associated with the person.  Person constructs MAY contain an
   atom:email element, but MUST NOT contain more than one.  Its content
   MUST conform to the "addr-spec" production in [RFC2822].

atom:email要素の内容は、personに関連付けられた電子メールアドレスを伝達するものである。Personコンストラクトは1つのatom:email要素を含んでもよいが(MAY)、1つ以上含んではならない(MUST NOT)。atom:email要素の内容は、[RFC2822]で定義される"addr-spec"形式に準拠させなければならない(MUST)。

3.3. Dateコンストラクト

   A Date construct is an element whose content MUST conform to the
   "date-time" production in [RFC3339].  In addition, an uppercase "T"
   character MUST be used to separate date and time, and an uppercase
   "Z" character MUST be present in the absence of a numeric time zone
   offset.

   atomDateConstruct =
      atomCommonAttributes,
      xsd:dateTime

Dateコンストラクトは要素であり、その内容は[RFC3339]で定義される"date-time"形式に準拠させなければならない(MUST)。また、日付と時間の区切り文字には大文字の"T"を用いなければならず(MUST)、タイムゾーンオフセット定数を指定しないのであれば代わりに大文字の"Z"を記さなければならない(MUST)。

   Such date values happen to be compatible with the following
   specifications: [ISO.8601.1988], [W3C.NOTE-datetime-19980827], and
   [W3C.REC-xmlschema-2-20041028].

ここで用いられる日付の値は、 [ISO.8601.1988]、[W3C.NOTE-datetime-19980827]、[W3C.REC-xmlschema-2-20041028]と互換性がある。

   Example Date constructs:

   <updated>2003-12-13T18:30:02Z</updated>
   <updated>2003-12-13T18:30:02.25Z</updated>
   <updated>2003-12-13T18:30:02+01:00</updated>
   <updated>2003-12-13T18:30:02.25+01:00</updated>

   Date values SHOULD be as accurate as possible.  For example, it would
   be generally inappropriate for a publishing system to apply the same
   timestamp to several entries that were published during the course of
   a single day.

Dateコンストラクトの例:

日付の値は可能な限り精密にすべきである(SHOULD)。例えばある出版システムにおいて、同じ日に発刊されたエントリのタイムスタンプが全て同一であることは、一般的に不適切だと言えるだろう。

広告

Copyright (C) 2006 七鍵 key@do.ai 初版:2006年10月02日 最終更新:2006年10月04日