XSD 문자열 데이터 유형
문자열 데이터 유형은 문자열을 포함하는 값에 사용됩니다.
문자열 데이터 유형
문자열 데이터 유형에는 문자, 줄 바꿈, 캐리지 리턴 및 탭 문자가 포함될 수 있습니다.
다음은 스키마에서 문자열 선언의 예입니다.
<xs:element name="customer" type="xs:string"/>
문서의 요소는 다음과 같습니다.
<customer>John Smith</customer>
또는 다음과 같이 보일 수 있습니다.
<customer> John Smith </customer>
참고: 문자열 데이터 유형을 사용하는 경우 XML 프로세서는 값을 수정하지 않습니다.
NormalizedString 데이터 유형
normalizedString 데이터 유형은 String 데이터 유형에서 파생됩니다.
normalizedString 데이터 유형에는 문자도 포함되지만 XML 프로세서는 줄 바꿈, 캐리지 리턴 및 탭 문자를 제거합니다.
다음은 스키마에서 normalizedString 선언의 예입니다.
<xs:element name="customer" type="xs:normalizedString"/>
문서의 요소는 다음과 같습니다.
<customer>John Smith</customer>
또는 다음과 같이 보일 수 있습니다.
<customer> John Smith </customer>
참고: 위의 예에서 XML 프로세서는 탭을 공백으로 바꿉니다.
토큰 데이터 유형
토큰 데이터 유형은 문자열 데이터 유형에서도 파생됩니다.
토큰 데이터 유형에는 문자도 포함되지만 XML 프로세서는 줄 바꿈, 캐리지 리턴, 탭, 선행 및 후행 공백, 여러 공백을 제거합니다.
다음은 스키마에서 토큰 선언의 예입니다.
<xs:element name="customer" type="xs:token"/>
문서의 요소는 다음과 같습니다.
<customer>John Smith</customer>
또는 다음과 같이 보일 수 있습니다.
<customer> John Smith </customer>
참고: 위의 예에서 XML 프로세서는 탭을 제거합니다.
문자열 데이터 유형
아래의 모든 데이터 유형은 문자열 데이터 유형에서 파생됩니다(문자열 자체 제외)!
Name | Description |
---|---|
ENTITIES | |
ENTITY | |
ID | A string that represents the ID attribute in XML (only used with schema attributes) |
IDREF | A string that represents the IDREF attribute in XML (only used with schema attributes) |
IDREFS | |
language | A string that contains a valid language id |
Name | A string that contains a valid XML name |
NCName | |
NMTOKEN | A string that represents the NMTOKEN attribute in XML (only used with schema attributes) |
NMTOKENS | |
normalizedString | A string that does not contain line feeds, carriage returns, or tabs |
QName | |
string | A string |
token | A string that does not contain line feeds, carriage returns, tabs, leading or trailing spaces, or multiple spaces |
문자열 데이터 유형에 대한 제한 사항
문자열 데이터 유형에 사용할 수 있는 제한 사항:
- 열거
- 길이
- 최대 길이
- 최소 길이
- 패턴(NMTOKENS, IDREFS 및 ENTITIES는 이 제약 조건을 사용할 수 없음)
- 공백