Skip to content Skip to navigation Skip to collection information

OpenStax-CNX

You are here: Home » Content » Connexions Tutorial and Reference (Japanese version) » CNXML中級

Navigation

Recently Viewed

This feature requires Javascript to be enabled.
 

CNXML中級

Module by: Ricardo Radaelli-Sanchez, Hironori Takaryo, Connexions. E-mail the authors

Based on: The Intermediate CNXML by Ricardo Radaelli-Sanchez

Summary: This is the second installment of the CNXML language tutorials. It is designed to give a more comprehensive look at the CNXML tags and explain some more advanced uses of the language. Includes helpful examples of CNXML tags, extending the module created in The Basic CNXML tutorial.

Warning:

This module contains Connexions documentation which is out-of-date. The contents of this module are provided here for historical purposes only and should not be considered accurate for the current version of the Connexions website. The current (English-language) version of this module can be located at http://cnx.org/content/m9006/latest/. If you have any additional questions or cannot find the answer to your question, please contact techsupport@cnx.org and we will be happy to assist in any way we can.

If you would like to assist Connexions by helping us update this module with an appropriate translation from the current English version, please contact us at cnx@cnx.org as we would appreciate your help with improving our support for non-English-speaking users.

 テキストブックでよくあるように、チャプターやセクションの中に例を入れるでしょう。このため、ドキュメント内に例を含めることができるようにするタグを、CNXMLは提供しています。exampleタグは固有のid属性を持ち、子要素としてほとんどのタグを含むことができます。1番目は任意のnameです。詳細が知りたいならば、CNXML Specに相談してください。

Example 1


	  
<example id='tboneexam'>
  <figure id='tbonefig'>
    <name>T-Bone Steak</name>
    <media type='image/jpg' src='tbone.jpg'/>
  </figure>
</example>
	  
	

Figure

 figureタグは、ドキュメント内に図を作成するための構造を提供します。それらは2つ以上のsubfigureタグか、1つのmediaタグ、tableタグ、codeタグを含むことができます。

 figureタグは2つの属性を持っています。

  • id - 固有のIDです。必ず必要です。
  • orient - 複数のsubfigure(副図)をどのように表示するかを指定する属性です。verticalhorizontalという2つの値が入ります。ディフォルトではhorizontalが入ります。

 figureタグの任意のタグはnameです。これは図のタイトルとして使用されます。

 nameタグは上で述べられているどのタグにも従います。しかし、最も一般的に使用されるタグは、画像、動画、音声、Javaアプレットなどを含めるmediaタグです。mediaタグは2つの属性を持っています。

  • src - 表示されるメディアの場所
  • type - 表示されるメディアのタイプの定義。それは有効なMIMEの一種であるかもしれません
    • audio/FILETYPE - audio/mp3, audio/wav, etc.
    • video/FILETYPE - video/qt, video/mov, etc.
    • image/FILETYPE - image/png, image/gif, etc.
    • application/FILETYPE - application/PostScript, application/x-java-applet, etc.

 最後のタグは任意のcaptionタグです。これは図の小さな見出しを追加するのに使用されます。

Example 2


	  
<figure id='tbone'>
  <name>T-Bone Steak</name>
  <media type='image/jpeg' src='tbone.jpg'/>
  <caption>
    Upon successful completion of these documents, you should be able
    to grill a steak that looks just as good!
  </caption>
</figure>
	  
	

Subfigure

 subfigureタグは、1つ以上のmediacodetableを同じfigure内に含めたいときに使用します。

 subfigureタグの使い方はfigureタグと同じです。任意のid属性、任意の最初の子要素のnameタグ、1つのmediacodetableがあります。

 現在、figureorient属性は重要になるので、副図が横並びで表示されるか、縦に表示されるかに関わらず、orient属性を指定してください。

Example 3


	  
<figure orient='horizontal' id='horfig'>
  <name>Steaks</name>
  <subfigure id='subfigtbone1'>
    <name>T-Bone</name>
    <media type='image/jpeg' src='tbone.jpg'/>
  </subfigure>
  <subfigure id='subfingnystrip1'>
    <name>New York Strip</name>
    <media type='image/jpeg' src='ny_strip.gif'/>
  </subfigure>
  <caption>
      Upon successful completion of these documents, you
      should be able to grill a steak that looks just as good!
  </caption>
</figure>
	  
	  
Or

	  
<figure orient='vertical' id='verfig'>
  <name>Steaks</name>
  <subfigure id='subfigtbone2'>
    <name>T-Bone</name>
    <media type='image/jpeg' src='tbone.jpg'/>
  </subfigure>
  <subfigure id='subfig2'>
    <name>New York Strip</name>
    <media type='image/jpeg' src='ny_strip.jpg'/>
  </subfigure>
  <caption>
    Upon successful completion of these documents, you
    should be able to grill a steak that looks just as good!
  </caption>
</figure>
	    
	  

List

 listタグはリストを作成するのに使用されます。listタグは2つの属性をもっています。

  • id - 固有のIDです。必ず必要です。
  • type - リストのフォーマットの定義。type属性はbulleted(ディフォルト)、enumeratednamed-iteminlineという値を取ります。
 listタグには、2つの子要素があります。name(任意)とitemです。これらはリストの情報が格納されているところです。

Example 4: Example List


		
<list id='marinade' type='enumerated'>
  <name>Beer Marinade</name>
  <item>pour beer into large bowl</item>
  <item>add chili powder to taste</item>
  <item>squeeze half lime into beer marinade</item>
  <item>place steak in beer, let soak for 30 minutes</item>
</list>
	    
	
 結果はこのようになります。

Beer Marinade

  1. pour beer into large bowl
  2. add chili powder to taste
  3. squeeze half lime into beer marinade
  4. place steak in beer, let soak for 30 minutes

Example 5: New List Types Example

Named Item Lists

 CNXML0.5では2つの新しいタイプのリストを使うことができます。最初のタイプはnamed itemリストです。このタイプのリストを使うには、listタグのtype属性にnamed-itemと指定してください。名前のあるリストの各アイテムは名前を持ちます。


		
<list id='marinade' type='named-item'>
  <name>Beer Marinade</name>    
  <item><name>Step 1</name>pour beer into large bowl</item>
  <item><name>Step 2</name>add chili powder to taste</item>
  <item><name>Step 3</name>squeeze half lime into beer marinade</item>
  <item><name>Step 4</name>place steak in beer, let soak for 30 minutes</item>
</list>
	      
	
 結果はこのようになります。
Beer Marinade
  • Step 1: pour beer into large bowl
  • Step 2: add chili powder to taste
  • Step 3: squeeze half lime into beer marinade
  • Step 4: place steak in beer, let soak for 30 minutes

Inline Lists

 もう1つの新しいタイプのリストはinlineリストです。このタイプのリストは以下のようになります。


		 
In order to make a good marinade follow these directions:<list
id='marinade' type='inline'>
  <name>Beer Marinade</name>
  <item><name>Step 1</name>pour beer into large bowl</item>
  <item><name>Step 2</name>add chili powder to taste</item>
  <item><name>Step 3</name>squeeze half lime into beer marinade</item>
  <item><name>Step 4</name>place steak in beer, let soak for 30 minutes</item>
</list>.
	      
	
The resulting list will look like: In order to make a good marinade follow these directions: Beer Marinade: Step 1: pour beer into large bowl; Step 2: add chili powder to taste; Step 3: squeeze half lime into beer marinade; Step 4: place steak in beer, let soak for 30 minutes

Equation

 equationタグは、ASCIIテキストや数式を表示するためのmediaなどを使って、Connexions内のドキュメントで数式を表示するために使用されます。

Note:

しかし、数式を表示するときは、MathMLタグで数式を使うことが推奨されます。

ASCII Text and Images

 最初の子要素は、ASCIIテキストに埋め込まれたmediaタグの番号に続く、任意のnameです。

Example 6


	    
<equation id="eqn14">
  <name>Euler's Relation</name>
  <media type='image/gif' src='euler.gif' />
</equation>
	    
	    

	    
<equation id='eqn15'>
  <name>Simple Arithmetic</name>
    11+27=38
</equation>
	    
	    
This equation will display as:
Simple Arithmetic
11+27=38
(1)

Definition

 definitionタグはConnexionsドキュメントの単語を定義するのに使用されます。それは必ずid属性を持ち、termmeaningexampleという3つの子要素を持ちます。definitionタグの使い方は少し難しいので、Example 7を調べることを忘れないでください。

 最初の子要素のタグは、定義された単語や熟語を含むtermタグです。この次にはいろいろなexampleを伴ったmeaningタグが来ます。この過程は繰り返されます。

Example 7


	  
<definition id='tbonedef'>
  <term>T-Bone</term>
  <meaning>
    "The T-bone steak is cut between 1 and 3 inches thick and comes
     from the center section of the short loin. This steak is
     characterized by its T-shape bone, has a fine-grained shell and a
     small tenderloin eye,"
     <cite>http://www.chophousecalgary.com/steak.html</cite>.
  </meaning>
  <example id='tboneexam'>
    <figure id='tbonefig'>
      <name>T-Bone Steak</name>
      <media type='image/jpeg' src='tbone.jpg'/>
    </figure>
  </example>
</definition>
	  
	

Definition 1: T-Bone
"The T-bone steak is cut between 1 and 3 inches thick and comes from the center section of the short loin. This steak is characterized by its T-shape bone, has a fine-grained shell and a small tenderloin eye," http://www.chophousecalgary.com/steak.html.

Example

Figure 1
T-Bone Steak
T-Bone Steak (tbone.jpg)

Rule

 ruleタグは、定理、原理、経験則などのルールを、CNXMLドキュメントに挿入するのに使用されます。それは2つの属性を持っています。

  • id - 固有のID。必ず必要です。
  • type - ルールの種類。必ず必要です。(例えば定理、原理、経験則)
 また任意のnameタグ、1つ以上のstatementタグ、proofもしくはexampleタグを持つかもしれません。

Statement

 statementタグはruleタグの中で使用され、ルールの宣言を定義します。任意のid属性を持ちます。また、paraequationの2つの子要素を持ちます。

Proof

 proofタグはruleタグの中で使用され、ルールの証拠をマークします。それは任意のid属性を持ち、別のrule、paraequationfigurelistタグを持つことがあります。

Using rule

Example 8


	    
<rule id='murph' type='law'> 
  <name>Murphy's Law</name>
  <statement>
    <para id='murphp1'>
      If there are two or more ways to do something, and one of those
      ways can result in a catastrophe, then someone will do it.
    </para>
  </statement>
  <proof>
    <para id='murphp2'>
      Edward A. Murphy, Jr. was one of the engineers on the
      rocket-sled experiments that were done by the U.S. Air Force in
      1949 to test human acceleration tolerances (USAF project
      MX981). One experiment involved a set of 16 accelerometers
      mounted to different parts of the subject's body. There were two
      ways each sensor could be glued to its mount, and somebody
      methodically installed all 16 the wrong way around. Murphy then
      made the original form of his pronouncement, which the test
      subject (Major John Paul Stapp) quoted at a news conference a
      few days later
      <cite>http://www.lylemariam.com/murphy.htm</cite>.
    </para>
  </proof>
</rule>
	    
	  

Law 1: Murphy's Law

If there are two or more ways to do something, and one of those ways can result in a catastrophe, then someone will do it.

Proof

Edward A. Murphy, Jr. was one of the engineers on the rocket-sled experiments that were done by the U.S. Air Force in 1949 to test human acceleration tolerances (USAF project MX981). One experiment involved a set of 16 accelerometers mounted to different parts of the subject's body. There were two ways each sensor could be glued to its mount, and somebody methodically installed all 16 the wrong way around. Murphy then made the original form of his pronouncement, which the test subject (Major John Paul Stapp) quoted at a news conference a few days later http://www.lylemariam.com/murphy.htm.

最後に

 更なる情報はThe Advanced CNXMLを見てください。またはCNXML Specに相談してください。

Collection Navigation

Content actions

Download:

Collection as:

PDF | EPUB (?)

What is an EPUB file?

EPUB is an electronic book format that can be read on a variety of mobile devices.

Downloading to a reading device

For detailed instructions on how to download this content's EPUB to your specific device, click the "(?)" link.

| More downloads ...

Module as:

PDF | More downloads ...

Add:

Collection to:

My Favorites (?)

'My Favorites' is a special kind of lens which you can use to bookmark modules and collections. 'My Favorites' can only be seen by you, and collections saved in 'My Favorites' can remember the last module you were on. You need an account to use 'My Favorites'.

| A lens I own (?)

Definition of a lens

Lenses

A lens is a custom view of the content in the repository. You can think of it as a fancy kind of list that will let you see content through the eyes of organizations and people you trust.

What is in a lens?

Lens makers point to materials (modules and collections), creating a guide that includes their own comments and descriptive tags about the content.

Who can create a lens?

Any individual member, a community, or a respected organization.

What are tags? tag icon

Tags are descriptors added by lens makers to help label content, attaching a vocabulary that is meaningful in the context of the lens.

| External bookmarks

Module to:

My Favorites (?)

'My Favorites' is a special kind of lens which you can use to bookmark modules and collections. 'My Favorites' can only be seen by you, and collections saved in 'My Favorites' can remember the last module you were on. You need an account to use 'My Favorites'.

| A lens I own (?)

Definition of a lens

Lenses

A lens is a custom view of the content in the repository. You can think of it as a fancy kind of list that will let you see content through the eyes of organizations and people you trust.

What is in a lens?

Lens makers point to materials (modules and collections), creating a guide that includes their own comments and descriptive tags about the content.

Who can create a lens?

Any individual member, a community, or a respected organization.

What are tags? tag icon

Tags are descriptors added by lens makers to help label content, attaching a vocabulary that is meaningful in the context of the lens.

| External bookmarks