XSD Data TypesLesson 101Free preview
XSD Misc
This lesson is part of XML · All levels
Summary
In addition to text, numbers, and dates, XML Schema has mixed types: xs:boolean for true/false, xs:hexBinary and xs:base64Binary for binary data, xs:anyURI for links, and xs:duration for time intervals. There are also special types such as xs:ID, xs:IDREF, and xs:NMTOKEN to maintain the relationship between the elements. Selecting the right type makes validation more rigorous without the need for additional rules.
Key points
- xs:boolean only accepts true, false, 1, or 0
- xs:hexBinary uses hexadecimal pairs, xs:base64Binary using base64
- xs:anyURI for addresses such as https://contoh.com/data.xml (https://contoh.com/data.xml)
- xs:ID must be unique in one document and xs:IDREF must designate it
- xs:NMTOKEN receives a name token without a space
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.