XML 스키마 (W3C): 두 판 사이의 차이

내용 삭제됨 내용 추가됨
편집 요약 없음
15번째 줄:
|date=2012-02-04}}</ref>는 여러 [[XML schema|XML schema languages]] 중 하나이다. 이는 W3C 권고를 만족하는 첫 번째 [[XML]] 스키마 전용 언어이다. Because of confusion between XML Schema as a specific W3C specification, and the use of the same term to describe schema languages in general, 사용자 커뮤니티 일부에서는 이 언어를 '''WXS'''라 칭하는데, 이는 W3C XML Schema의 앞 글자를 딴 것이다. 다른 이들은 XML Schema Definition의 약자인 '''XSD'''를 쓰기도 한다.<ref>See [http://www.w3.org/standards/xml/schema Schema - W3C]</ref><ref>See [http://www.w3.org/TR/xmlschema11-1/ W3C XML Schema Definition Language (XSD) 1.1 Part 1: Structures]</ref> 버전 1.1에서 W3C는 XSD를 선호되는 이름으로 정했으며, 이 문서에서도 그것을 따른다.
 
다른 모든 XML 스키마 언어처럼, XSD는 XML 문서가 그 스키마에 대하여 '유효'한 것으로 여겨지기 위해 반드시 지켜야 하는 규칙들의 집합을 표현하는 데 쓰인다. However,그러나 unlike다른 most대부분의 other스키마 schema언어들과 languages달리, XSDXSD는 was문서의 also유효성 designed검증을 with통해 the intent that determination of a document's validity would produce a collection of information adhering to specific특정 [[자료형]]s.들에 Such종속적인 a정보들의 post-validation묶음을 ''[[XML만들어 Information내자는 Set|infoset]]''의도로 can be useful in the development of XML document processing software, but the schema language's dependence on specific data types has provoked criticism설계되었다.<!--as documented in the PSVI section below-->
 
==History==
In its appendix of references, the XSD specification acknowledges the influence of [[Document Type Definition|DTD]]s and other early XML schema efforts such as [[DDML]], [[Schema for Object-Oriented XML|SOX]], XML-Data, and [[XDR Schema|XDR]]. It has adopted features from each of these proposals but is also a compromise among them. Of those languages, XDR and SOX continued to be used and supported for a while after XML Schema was published. A number of [[Microsoft]] products supported XDR until the release of [[MSXML]] 6.0 (which dropped XDR in favor of XML Schema) in December 2006.<ref>{{cite web|url=http://msdn.microsoft.com/en-us/library/ms761410%28v=VS.85%29.aspx|title=Removal of XDR Schema Support in MSXML 6.0|accessdate=2010-09-19}}</ref> [[Commerce One]], Inc. supported its SOX schema language until declaring bankruptcy in late 2004.
 
The most obvious features offered in XSD that are not available in XML's native [[Document Type Definition]]s (DTDs) are [[XML Namespace|namespace]] awareness and datatypes, that is, the ability to define element and attribute content as containing values such as integers and dates rather than arbitrary text.
 
The XSD 1.0 specification was originally published in 2001, with a second edition following in 2004 to correct large numbers of errors. XSD 1.1 became a [[World Wide Web Consortium#W3C_Recommendation_.28REC.29|W3C Recommendation]] in [http://www.w3.org/News/2012#entry-9412 April 2012].
 
==Schemas and Schema Documents==
스키마 문서는 네임스페이스(namespace)로 조직화된다: 모든 이름이 달린 스키마 구성 요소는 target namespace에 속하며, 그 target namespace는 스키마 문서 전체의 속성 중 하나이다. 스키마 문서는 네임스페이스가 같은 다른 스키마 문서를 ''include''할 수 있다. 또한 다른 네임스페이스의 스키마 문서를 ''import''할 수 있다.
Technically, a '''schema''' is an abstract collection of metadata, consisting of a set of '''schema components''': chiefly element and attribute declarations and complex and simple type definitions. These components are usually created by processing a collection of '''schema documents''', which contain the source language definitions of these components. In popular usage, however, a schema document is often referred to as a schema.
 
Schema documents are organized by namespace: all the named schema components belong to a target namespace, and the target namespace is a property of the schema document as a whole. A schema document may ''include'' other schema documents for the same namespace, and may ''import'' schema documents for a different namespace.
 
When어떤 an인스턴스 instance문서를 document어떤 is스키마에 validated대하여 against유효성 a schema검증할 (a process known as ''assessment''라 한다), the유효성 schema검증에 to사용될 be스키마는 used유효성 for검증 validation엔진에게 can인자로 either주어질 be수도 supplied있고, as인스턴스 a문서 parameter자체에서 to직접 the참조될 validation수도 engine,있다. or인스턴스 it문서가 can참조할 be때는 referenced directly가지 from특별한 the애트리뷰트를 instance document using two special attributes사용하는데, <code>xsi:schemaLocation</code> and <code>xsi:noNamespaceSchemaLocation</code>이 그것이다. (The latter mechanism requires the client invoking validation to trust the document sufficiently to know that it is being validated against the correct schema.관습적으로 "xsi" is the conventional prefix for the namespace "http://www.w3.org/2001/XMLSchema-instance"를 가리키는 접두어로 쓰인다.)
 
XML Schema 문서는 대개 확장자로 ".xsd"를 갖는다. XSD에 대한 고유의 [[Internet media type|Internet Media Type]]은 아직 등록되지 않았다. 따라서 RFC 3023에 따라 "application/xml" 혹은 "text/xml"을 사용해야 한다.
줄 48 ⟶ 39:
* An '''element particle''' similarly represents the relationship of a complex type and an element declaration, and indicates the minimum and maximum number of times the element may appear in the content. As well as element particles, content models can include '''model group''' particles, which act like non-terminals in a grammar: they define the choice and repetition units within the sequence of permitted elements. In addition, '''wildcard''' particles are allowed, which permit a set of different elements (perhaps any element provided it is in a certain namespace).
 
Other다른 more specialized특수화된 components include구성요소들로 annotations, assertions, notations, and스키마 the전체에 대한 정보를 포함하는 '''schema component''' which contains information about the schema as a whole있다.
 
==Types==
줄 136 ⟶ 127:
XML 파일 구조에 대한, 사람이 읽을 수 있는 문서를 만드는 데 쓰일 수 있다. 이는 특히 저자가 annotation 엘리먼트를 사용했을 때 유용하다. 문서 생성에 규격화된 표준은 존재하지 않는다. 하지만 몇 가지 툴이 나와 있다. [[Xs3p]] stylesheet가 그것으로, 고품질의 읽을 수 있는 HTML과 인쇄물을 생성한다.
 
==Criticism비판==
Although XML Schema is successful in that it has been widely adopted and largely achieves what it set out to, it has been the subject of a great deal of severe criticism, perhaps more so than any other W3C Recommendation.
Good summary of the criticisms are provided by <ref>[[James Clark (XML expert)|James Clark]] summary of ''XML Schema'' criticisms, and promotion of [[RELAX NG]] as an alternative,
줄 142 ⟶ 133:
 
General problems:
* 너무 복잡해서(명세가 매우 기술적인 용어로 수백 페이지가 넘는다) 비전문가가 쓰기 어렵다. 하지만 많은 비전문가들도 자료형을 기술하는 데 스키마가 필요하다. W3C 권고 자체는 극도로 읽기 어렵다. 대부분의 사용자는 [http://www.w3.org/TR/xmlschema-0/ W3Cs XML Schema Primer]가 이해하기 쉽다고 한다.
* it is too complicated (the spec is several hundred pages in a very technical language), so it is hard to use by non-experts &mdash; but many non-experts need schemas to describe data formats. The W3C Recommendation itself is extremely difficult to read. Most users find [http://www.w3.org/TR/xmlschema-0/ W3Cs XML Schema Primer] much easier to understand.
 
* XSD느 formal mathematical specification이 전혀 없다(이는 Schema에 대해 추론하는 것을 어렵게 만든다. 예를 들어 스키마를 변조하는 것이 하위호환성이 있다는 것을 증명하는 것).
* XSD lacks any formal mathematical specification. (This makes it difficult to reason about schemas, for example to prove that a modification to a schema is backwards compatible)
 
* There are many surprises in the language, for example that restriction of elements works differently from restriction of attributes.