XmlRootAttribute.DataType 속성

정의

XML 루트 요소의 XSD 데이터 형식을 가져오거나 설정합니다.

public:
 property System::String ^ DataType { System::String ^ get(); void set(System::String ^ value); };
public string DataType { get; set; }
member this.DataType : string with get, set
Public Property DataType As String

속성 값

String

XSD(XML 스키마 문서) 데이터 형식입니다.

설명

다음 표에서는 .NET에 해당하는 XSD 단순 데이터 형식을 나열합니다.

XSD base64BinaryhexBinary 데이터 형식의 경우 구조 배열 Byte 을 사용하고 속성이 "base64Binary" 또는 "hexBinary"로 설정된 경우 적절하게 적용 XmlRootAttribute DataType 합니다. XSD timedate 데이터 형식의 경우 형식을 DateTime 사용하고 집합을 XmlRootAttribute DataType "date" 또는 "time"에 적용합니다.

문자열에 매핑되는 모든 XSD 형식에 대해 해당 DataType 속성 집합을 XmlRootAttribute XSD 형식에 적용합니다. 그러나 이는 serialization 형식을 변경하지 않고 멤버에 대한 스키마만 변경합니다.

참고

속성은 대/소문자를 구분하므로 정확히 XSD 데이터 형식 중 하나로 설정해야 합니다.

참고

이진 데이터를 XML 요소로 전달하는 것이 XML 특성으로 전달하는 것보다 더 효율적입니다.

XML 데이터 형식에 대한 자세한 내용은 XML 스키마 2부: Datatypes라는 World Wide Web 컨소시엄 문서를 참조하세요.

XSD 데이터 형식 .NET 데이터 형식
anyURI String
base64Binary Byte 개체의 배열
boolean Boolean
byte SByte
날짜 DateTime
dateTime DateTime
decimal Decimal
double Double
엔터티 String
엔터티 String
float Single
gDay String
gMonth String
gMonthDay String
gYear String
gYearMonth String
hexBinary Byte 개체의 배열
ID String
IDREF String
IDREFS String
int Int32
정수 String
language String
long Int64
Name String
NCName String
negativeInteger String
NMTOKEN String
NMTOKENS String
normalizedString String
nonNegativeInteger String
nonPositiveInteger String
NOTATION String
positiveInteger String
QName XmlQualifiedName
recurringDate String
duration String
문자열 String
short Int16
time DateTime
token String
unsignedByte Byte
unsignedInt UInt32
unsignedLong UInt64
unsignedShort UInt16

적용 대상