Content deleted Content added
Rkieferbaum (talk | contribs) m v2.04 - Fix errors for CW project (Reference list missing) |
|||
Line 6:
== Namespace names ==
A ''namespace name'' is a [[uniform resource identifier]] (URI). Typically, the URI chosen for the namespace of a given XML vocabulary describes a resource under the control of the author or organization defining the vocabulary, such as a [[uniform resource locator|URL]] for the author's Web server. However, the namespace specification does not require nor suggest that the namespace URI be used to retrieve information; it is simply treated by an XML parser as a string. For example, the document at http://www.w3.org/
Although the term ''namespace URI'' is widespread, the W3C Recommendation refers to it as the ''namespace name''. The specification is not entirely prescriptive about the precise rules for namespace names (it does not explicitly say that parsers must reject documents where the namespace name is not a valid [[Uniform Resource Identifier]]), and many XML parsers allow any character string to be used. In version 1.1 of the recommendation, the namespace name becomes an [[Internationalized Resource Identifier]], which licenses the use of non-ASCII characters that in practice were already accepted by nearly all XML software. The term ''namespace URI'' persists, however, not only in popular usage, but also in many other specifications from W3C and elsewhere.
Line 12:
Following publication of the Namespaces recommendation, there was an intensive debate about how a relative URI should be handled, with some intensely arguing that it should simply be treated as a character string, and others arguing with conviction that it should be turned into an absolute URI by resolving it against the base URI of the document.<ref>{{cite web|title=News from the trenches|first=Leigh|last=Dodds|date=24 May 2000|url=https://www.xml.com/pub/a/2000/05/24/deviant/index.html |publisher=O'Reilly Media, Inc.}}</ref> The result of the debate was a ruling from W3C that relative URIs were deprecated.<ref>{{citation|title=W3C XML Plenary decision on relative URI references in namespace declarations|first=Dan|last=Connolly|date=11 Sep 2000}}</ref>
The use of URIs taking the form of URLs in the http scheme (such as ''http://www.w3.org/
== Namespace declaration ==
Line 19:
For example, the following declaration maps the "xhtml:" prefix to the XHTML namespace:
<pre><nowiki>xmlns:xhtml="http://www.w3.org/
Any element or attribute whose name starts with the prefix "xhtml:" is considered to be in the XHTML namespace, if it or an ancestor has the above namespace declaration.
Line 25:
It is also possible to declare a default namespace. For example:
<pre><nowiki>xmlns="http://www.w3.org/
In this case, any element without a namespace prefix is considered to be in the XHTML namespace, if it or an ancestor has the above default namespace declaration.
Line 48:
*[[Namespace]]
==
<references/>
==External links==
*[http://www.w3.org/TR/REC-xml-names/ Namespaces in XML 1.0 (Third Edition)]
*[http://www.w3.org/TR/
*[https://developer.mozilla.org/en-US/docs/Web/SVG/Namespaces_Crash_Course Namespaces Crash Course (Mozilla Developer Network)]
{{W3C standards}}
Line 60:
<!--Interwikies-->
{{DEFAULTSORT:
<!--Categories-->
[[Category:XML]]
[[ja:Extensible Markup Language#XML名前空間]]
|