<?xml version="1.0" encoding="utf-8" standalone="no"?>
<!DOCTYPE document PUBLIC "-//CNX//DTD CNXML 0.5//EN" "http://cnx.rice.edu/cnxml/0.5/DTD/cnxml_plain.dtd">
<document xmlns="http://cnx.rice.edu/cnxml" xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="m9002">
  <name xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/">XML Basics (日本語 - Japanese)</name>
  <metadata xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/">
  <md:version xmlns:bib="http://bibtexml.sf.net/">2.20</md:version>
  <md:created xmlns:bib="http://bibtexml.sf.net/">2005/08/24 10:26:38.161 GMT-5</md:created>
  <md:revised xmlns:bib="http://bibtexml.sf.net/">2005/08/24 10:27:49.161 GMT-5</md:revised>
  <md:authorlist xmlns:bib="http://bibtexml.sf.net/">
      <md:author xmlns:bib="http://bibtexml.sf.net/" id="selc">
      <md:firstname xmlns:bib="http://bibtexml.sf.net/">Sarah</md:firstname>
      
      <md:surname xmlns:bib="http://bibtexml.sf.net/">Coppin</md:surname>
      <md:email xmlns:bib="http://bibtexml.sf.net/">coppin@alumni.rice.edu</md:email>
    </md:author>
      <md:author xmlns:bib="http://bibtexml.sf.net/" id="brentmh">
      <md:firstname xmlns:bib="http://bibtexml.sf.net/">Brent</md:firstname>
      <md:othername xmlns:bib="http://bibtexml.sf.net/">Michael</md:othername>
      <md:surname xmlns:bib="http://bibtexml.sf.net/">Hendricks</md:surname>
      <md:email xmlns:bib="http://bibtexml.sf.net/">brentmh@rice.edu</md:email>
    </md:author>
      <md:author xmlns:bib="http://bibtexml.sf.net/" id="takaryo">
      <md:firstname xmlns:bib="http://bibtexml.sf.net/">Hironori</md:firstname>
      
      <md:surname xmlns:bib="http://bibtexml.sf.net/">Takaryo</md:surname>
      <md:email xmlns:bib="http://bibtexml.sf.net/">s043105@ishikawa-nct.ac.jp</md:email>
    </md:author>
  </md:authorlist>

  <md:maintainerlist xmlns:bib="http://bibtexml.sf.net/">
    <md:maintainer xmlns:bib="http://bibtexml.sf.net/" id="takaryo">
      <md:firstname xmlns:bib="http://bibtexml.sf.net/">Hironori</md:firstname>
      
      <md:surname xmlns:bib="http://bibtexml.sf.net/">Takaryo</md:surname>
      <md:email xmlns:bib="http://bibtexml.sf.net/">s043105@ishikawa-nct.ac.jp</md:email>
    </md:maintainer>
  </md:maintainerlist>
  
  <md:keywordlist xmlns:bib="http://bibtexml.sf.net/">
    <md:keyword xmlns:bib="http://bibtexml.sf.net/">attribute</md:keyword>
    <md:keyword xmlns:bib="http://bibtexml.sf.net/">entity</md:keyword>
    <md:keyword xmlns:bib="http://bibtexml.sf.net/">nesting</md:keyword>
    <md:keyword xmlns:bib="http://bibtexml.sf.net/">unicode</md:keyword>
    <md:keyword xmlns:bib="http://bibtexml.sf.net/">valid</md:keyword>
    <md:keyword xmlns:bib="http://bibtexml.sf.net/">well-formed</md:keyword>
    <md:keyword xmlns:bib="http://bibtexml.sf.net/">xml</md:keyword>
  </md:keywordlist>

  <md:abstract xmlns:bib="http://bibtexml.sf.net/">This module describes XML (eXtensible Markup Language) and the rules that govern its usage.  It also explains what a well-formed and valid document is.</md:abstract>
</metadata>

  <content xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/">
    
    <section xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="whatxml">
      <name xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/">XMLとは</name>
      <para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="pa1">　<term xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/">XML</term>(eXtensible Markup Language)は、<link xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" src="http://www.w3.org">World Wide Web Consortium(W3C)</link>によって定義されたメタマークアップ言語です。厳密に言えば、それ自身はマークアップ言語ではなく、むしろマークアップ言語を生成するルールの集まりのようなものです。私たちの目的のために、<term xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/">マークアップ言語</term>は、情報伝達のためにテキストをタグで囲む言語（例えばHTML）です。<link xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" src="http://cnx.rice.edu">Connexionsプロジェクト</link>で使用されているマークアップ言語、<link xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" src="http://cnx.rice.edu/cnxml">CNXML</link>はXMLで書かれた言語の1つの例です。
他の多くの例がW3Cのサイトにあります。CNXMLの記述例です。
      </para>
      <code xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" type="block">
<![CDATA[<para>
  This is a paragraph in <term>CNXML</term>.  Notice that the markup
  contains tags that express the meaning of the text.
</para>]]>
      </code>
      <para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="pa5">　<code xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" type="inline">&lt;para&gt;</code>と<code xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" type="inline">&lt;/para&gt;</code>がテキストを含んでいるタグです。XMLでは、タグは<code xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" type="inline">&lt;</code>と<code xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" type="inline">&gt;</code>で記述されます。普通<term xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/">タグ</term>はペアになります。開始のタグが<code xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" type="inline">&lt;tagname&gt;</code>のようになり、終了のタグが<code xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" type="inline">&lt;/tagname&gt;</code>のようになります。
      </para>
      <para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="pa2">　XMLでは、コンテンツからプレゼンテーションを分離することができます。例えば、HTMLには<code xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" type="inline">&lt;u&gt;</code>や<code xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" type="inline">&lt;i&gt;</code>などのタグがあります。前者はテキストにアンダーラインを付け、後者はテキストをイタリック体にします。これはフォーマットしているだけであり、コンテンツを説明してはいません。XMLではコンテンツの内容を表すため、あなたの好きなタグのタイトルを定義することができます。例えば本のタイトルを表すために、<code xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" type="inline">&lt;book&gt;</code>というタグを作成することができます。そしてスタイルシートでイタリック体にしたり、アンダーラインを引いたりできます。そして、そのタイプのコンテンツのプレゼンテーションを変更したい時、スタイルシートの1箇所を変更するだけで行うことができます。また、ドキュメントの中身を伝えるタグを作成するなら、探すよりいい方法があります。例えば、Authorタグを見ることによって、ドキュメントのAuthorを探すかもしれません。
      </para>
    </section>


    <section xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="xmlrules">
      <name xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/">Well-formed XML</name>
      <para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="pa3">　XMLには、CNXMLを含むすべての言語に適用されるいつくかのルールがあります。ドキュメントがこれらのルールを満たすなら、きちんと形成されてると言えます。XMLドキュメントはきとんと形成されていなければなりません。

	<list xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="threerules">
	<item xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/">
開かれたすべてのタグは閉じられなければなりません。<code xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" type="inline">&lt;module&gt;</code>で始まり、<code xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" type="inline">&lt;/module&gt;</code>で終わるように。簡単な方法があります。タグが他のタグを含まないなら、開始のタグの「&gt;」の前に「/」を入力することで、終了のタグを削除することができます。例えば、<code xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" type="inline">&lt;media&gt;</code>と<code xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" type="inline">&lt;/media&gt;</code>は<code xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" type="inline">&lt;media/&gt;</code>と簡略化することができます。
	  </item>
	<item xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/">
タグは互いに入れ子になっていなくてはなりません。<code xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" type="inline">&lt;b&gt;red &lt;i&gt;and&lt;/i&gt;
	    blue&lt;/b&gt;</code>は正しくて、<code xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" type="inline">&lt;b&gt;red &lt;i&gt;and&lt;/b&gt;
	    blue&lt;/i&gt;</code>は正しくありません。なぜなら後者は入れ子になっていないからです。
	  </item>
	<item xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/">
属性値には、シングルコーテーションかダブルコーテーションを付けなければなりません。<term xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/">属性</term>はタグに関連している情報です。例えば、<code xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" type="inline">&lt;module id="m0001"&gt;</code>は正しくて<code xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" type="inline">&lt;module id=m0001&gt;</code>は正しくありません。
	  </item>
	<item xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/">
また、すべてのドキュメントを<term xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/">XML宣言</term>ではじめることを選択することができます。XML宣言を使用するなら、それはファイルの最初で行わなければいけません。前に空白も入れてはいけません。それはタグではありません。XML宣言は以下の通りです。<code xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" type="inline">&lt;?xml version="1.0"?&gt;</code>ドキュメントのエンコードや、他のファイルを読み込むかどうかなどの別の情報も含めることができます。
	  </item>
	<item xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/">
すべてのタグを含む1つのタグがあるはずです。例えば、XHTMLでは<code xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" type="inline">&lt;html&gt;</code>と<code xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" type="inline">&lt;/html&gt;</code>は他のすべてのタグを囲まなくてはなりません。ドキュメントの最初にあり、タグで含まれていないものもあります。XML宣言はその例です。
	  </item>
</list>
</para>
    </section>


    <section xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="valid">
      <name xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/">Valid XML</name>
      <para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="pvalid">　特定のXML言語のタグに適応されるルールを定義することは可能です。これらのルールは異なった方法で定義することができます。もっとも一般的な方法は<term xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/">DTD</term>(Document Type Definition)を使用することです。その言語のルールに従う全てのドキュメントは、<term xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/">有効</term>であると言えます。ドキュメントは有効なXMLになる必要はありませんが、一般的にそれはいい考えです。
      </para>
    </section>
    <section xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="entities">
      <name xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/">Entities</name>
      <para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="pent1">　<term xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/">entity</term>は拡張文字を表示するためのものです。それには基本的なフォームがあります。アンパーサンドで始まり、セミコロンで終わります。例えば&amp;amp;は&amp;という文字を表示するためのものです。もしソースファイルに&amp;amp;と入力すると、ブラウザでは&amp;が表示されます。これにはさまざまな種類があり、全てのXMLファイルで使えます。例えば&amp;amp;(&amp;)、&amp;lt(&lt;)、&amp;gt(&gt;)、&amp;quot(")、&amp;apos(')などです。これらはHTMLで定義されているものと同じです。これらの基本記号に加えて、DTDを使用することにより、自分自身の記号を定義することができます。これらの定義は他のシンボルを示したり、長いテキストへのショートカットとして利用できます。
      </para>
      <para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="pent2">　<term xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/">Unicode</term>の文字もまたXMLに記述することができます。Unicodeは全ての言語の全ての文字のための、ユニークなコードを定義するためのプロジェクトです。UnicodeはASCIIの一部ではないシンボルを使用するとき、とても役に立ちます。
</para>
      <para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="pent3">　Unicodeのentityには、#があります。したがって&amp;#134;のようになります。もしくはコードが16真数で書かれているなら、&amp;#x03C0;のようにxがつきます。
</para>
    </section>
  </content>
</document>
