XML 스키마 포함 요소
❮ 완전한 XML 스키마 참조
정의 및 사용
include 요소는 동일한 대상 네임스페이스를 가진 여러 스키마를 문서에 추가하는 데 사용됩니다.
요소 정보
- 상위 요소: 스키마
통사론
<include
id=ID
schemaLocation=anyURI
any attributes
>
(annotation?)
</include>
(? 기호는 요소가 포함 요소 내에서 0번 또는 1번 발생할 수 있음을 선언합니다.)
Attribute | Description |
---|---|
id | Optional. Specifies a unique ID for the element |
schemaLocation | Required. Specifies the URI to the schema to include in the target namespace of the containing schema |
any attributes | Optional. Specifies any other attributes with non-schema namespace |
실시예 1
포함된 스키마의 경우 포함된 파일은 모두 동일한 대상 네임스페이스를 참조해야 합니다. 스키마 대상 네임스페이스가 일치하지 않으면 포함이 작동하지 않습니다.
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="https://www.w3schools.com/schema">
<xs:include schemaLocation="https://www.w3schools.com/xml/customer.xsd"/>
<xs:include schemaLocation="https://www.w3schools.com/xml/company.xsd"/>
..
..
..
</xs:schema>
❮ 완전한 XML 스키마 참조