<< Chapter < Page Chapter >> Page >
This module explains how to use XML namespaces and DTDs to combine multiple XML languages in the same document.

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 (External Link) . 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.

  XML では、カスタムマークアップ言語でドキュメントを作成することができます。しかし、同じドキュメントで、複数の言語からのマークアップを結合したい場合、どうなるでしょうか?1つ以上のタグが、異なった意味で両方の言語に存在していたらどうなるでしょうか?例えば、あなたはHTMLに <table> タグを入力できます。機能を失うことなく、これらのタグをどのように使用しますか?

 解決策は、 ネームスペース (W3Cのサイトをみてください。 Namespaces in XML ))と呼ばれる拡張子をXMLで使用することです。ネームスペースは、特定のタグのセットとそれらの使用ルールに、Unique Global Identifier (URI)を関連付けます。特定のタグのためにネームスペースを宣言するには、ユニークな拡張子の値に xmlns 属性を設定してください。

 あなたはまたドキュメント内で使用するため、 ネームスペースの接頭語 を定義することができます。これをするには、 xmlns 属性の変更されたバージョンを使ってください。例えば、ネームスペースを示す http://somewhere.org/foo の、 foo という接頭語に関連付けるため、 xmlns:foo="http://somewhere.org/foo" のような属性を使うでしょう。そのときあなたは、適切な接頭語を加えることによって、そのネームスペースからどのタグが来るかを示すことができます。したがって、fooのネームスペースおける bar タグは <foo:bar> </foo:bar> のように書かれるでしょう。

 ディフォルトのネームスペースを使用すると、そのタグのどんな子も、同じネームスペースから来たと思われるでしょう。タグのすべての子に対してネームスペースが定義できます。特に ルートノード で使用するときに役に立ちます。

 CNXMLのバージョン0.5のためのネームスペース識別子は http://cnx.rice.edu/cnxml です。したがって、ドキュメントのディフォルトのネームスペースとして、CNXMLに申告するためには、 ドキュメント タグに属性を追加するでしょう。よって、MathMLのためのネームスペース識別子は http://www.w3.org/1998/Math/MathML 、だからMathMLネームスペースと接頭語 m を関連付けるには、 ドキュメント タグに xmlns:m="http://www.w3.org/1998/Math/MathML" という属性を追加してください。

 ネームスペースでは、同時に複数の言語でドキュメントを書くことができます。しかしながら、これらのドキュメントが有効であるように、それらはある言語のタグが、別の言語のタグの中に存在することを可能にする Document Type Definition (DTD)を持たなくてはなりません。よって、CNXMLドキュメントにMathMLを含めたいなら、MathMLがCNXMLタグ内に存在できるDTDが必要です。DTDがあれば、DOCTYPEを宣言できます。

 CNXMLのDOCTYPE宣言は以下の通りです。

<!DOCTYPE document PUBLIC "-//CNX//DTD CNXML 0.5//EN" "http://cnx.rice.edu/cnxml/0.5/DTD/cnxml_plain.dtd">

 CNXMLとMathMLのDOCTYPE宣言は以下の通りです。

<!DOCTYPE document PUBLIC "-//CNX//DTD CNXML 0.5 plus MathML//EN" "http://cnx.rice.edu/cnxml/0.5/DTD/cnxml_mathml.dtd">

 CNXMLとQMLのDOCTYPE宣言は以下の通りです。

<!DOCTYPE document PUBLIC "-//CNX//DTD CNXML 0.5 plus QML//EN" "http://cnx.rice.edu/cnxml/0.5/DTD/cnxml_qml.dtd">

 CNXML、QML、およびMathMLのDOCTYPE宣言は以下の通りです。

<!DOCTYPE document PUBLIC "-//CNX//DTD CNXML 0.5 plus MathML plus QML//EN""http://cnx.rice.edu/cnxml/0.5/DTD/cnxml_mathml_qml.dtd">

 CNXMLとMathMLを含む簡単なドキュメントです。CNXMLのネームスペースがディフォルトで、MathMLのネームスペースが接頭語 m を持っていることに注意してください。

<?xml version="1.0" standalone="no"?><!DOCTYPE document PUBLIC "-//CNX//DTD CNXML 0.5 plus MathML//EN" "http://cnx.rice.edu/cnxml/0.5/DTD/cnxml_mathml.dtd"><document xmlns="http://cnx.rice.edu/cnxml" xmlns:m="http://www.w3.org/1998/Math/MathML". . .><metadata xmlns:md="http://cnx.rice.edu/mdml/0.4"><md:version>2.14</md:version><md:created>2005/08/24 15:08:34.203 GMT-5</md:created><md:revised>2005/08/24 15:09:19.244 GMT-5</md:revised><md:authorlist><md:author id="selc"><md:firstname>Sarah</md:firstname><md:surname>Coppin</md:surname><md:email>coppin@alumni.rice.edu</md:email></md:author><md:author id="brentmh"><md:firstname>Brent</md:firstname><md:othername>Michael</md:othername><md:surname>Hendricks</md:surname><md:email>brentmh@rice.edu</md:email></md:author><md:author id="takaryo"><md:firstname>Hironori</md:firstname><md:surname>Takaryo</md:surname><md:email>s043105@ishikawa-nct.ac.jp</md:email></md:author></md:authorlist><md:maintainerlist><md:maintainer id="takaryo"><md:firstname>Hironori</md:firstname><md:surname>Takaryo</md:surname><md:email>s043105@ishikawa-nct.ac.jp</md:email></md:maintainer></md:maintainerlist><md:keywordlist><md:keyword>DTD</md:keyword><md:keyword>namespace</md:keyword><md:keyword>tutorial</md:keyword><md:keyword>XML</md:keyword></md:keywordlist><md:abstract>This module explains how to use XML namespaces and DTDs to combine multiple XML languages in the same document.</md:abstract></metadata><content><para id='p1'>This math says "3y".<m:math display='inline'><m:apply><m:times/><m:cn>3</m:cn><m:ci>y</m:ci></m:apply></m:math></para></content></document>

 よって、ネームスペースの使用を結合することと、慎重に書かれたDTDによって、あなたは複数のXML言語を使用するドキュメントを、同時に書くことができます。

Questions & Answers

I'm interested in biological psychology and cognitive psychology
Tanya Reply
what does preconceived mean
sammie Reply
physiological Psychology
Nwosu Reply
How can I develope my cognitive domain
Amanyire Reply
why is communication effective
Dakolo Reply
Communication is effective because it allows individuals to share ideas, thoughts, and information with others.
effective communication can lead to improved outcomes in various settings, including personal relationships, business environments, and educational settings. By communicating effectively, individuals can negotiate effectively, solve problems collaboratively, and work towards common goals.
it starts up serve and return practice/assessments.it helps find voice talking therapy also assessments through relaxed conversation.
miss
Every time someone flushes a toilet in the apartment building, the person begins to jumb back automatically after hearing the flush, before the water temperature changes. Identify the types of learning, if it is classical conditioning identify the NS, UCS, CS and CR. If it is operant conditioning, identify the type of consequence positive reinforcement, negative reinforcement or punishment
Wekolamo Reply
please i need answer
Wekolamo
because it helps many people around the world to understand how to interact with other people and understand them well, for example at work (job).
Manix Reply
Agreed 👍 There are many parts of our brains and behaviors, we really need to get to know. Blessings for everyone and happy Sunday!
ARC
A child is a member of community not society elucidate ?
JESSY Reply
Isn't practices worldwide, be it psychology, be it science. isn't much just a false belief of control over something the mind cannot truly comprehend?
Simon Reply
compare and contrast skinner's perspective on personality development on freud
namakula Reply
Skinner skipped the whole unconscious phenomenon and rather emphasized on classical conditioning
war
explain how nature and nurture affect the development and later the productivity of an individual.
Amesalu Reply
nature is an hereditary factor while nurture is an environmental factor which constitute an individual personality. so if an individual's parent has a deviant behavior and was also brought up in an deviant environment, observation of the behavior and the inborn trait we make the individual deviant.
Samuel
I am taking this course because I am hoping that I could somehow learn more about my chosen field of interest and due to the fact that being a PsyD really ignites my passion as an individual the more I hope to learn about developing and literally explore the complexity of my critical thinking skills
Zyryn Reply
good👍
Jonathan
and having a good philosophy of the world is like a sandwich and a peanut butter 👍
Jonathan
generally amnesi how long yrs memory loss
Kelu Reply
interpersonal relationships
Abdulfatai Reply
What would be the best educational aid(s) for gifted kids/savants?
Heidi Reply
treat them normal, if they want help then give them. that will make everyone happy
Saurabh
Got questions? Join the online conversation and get instant answers!
Jobilize.com Reply

Get Jobilize Job Search Mobile App in your pocket Now!

Get it on Google Play Download on the App Store Now




Source:  OpenStax, Connexions tutorial and reference (japanese version). OpenStax CNX. Aug 26, 2005 Download for free at http://cnx.org/content/col10298/1.9
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Connexions tutorial and reference (japanese version)' conversation and receive update notifications?

Ask