[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]
What XML Schema data type is even less meaningful than the "string"data type?
- From: Roger L Costello <costello@mitre.org>
- To: "xml-dev@lists.xml.org" <xml-dev@lists.xml.org>
- Date: Mon, 10 May 2021 12:52:32 +0000
Hi Folks,
I just had a eureka moment.
Most XSD data types indicate something meaningful about the data. Consider:
- Ascribing to a data item the "date" type tells you a lot about the data item; namely, the data item is a date value such as 2021-05-10.
- Ascribing to a data item the "boolean" type tells you a lot about the data item; namely, the data item is a boolean value such as true.
- Ascribing to a data item the "integer" type tells you a lot about the data item; namely, the data item is an integer value such as 41.
Conversely, ascribing to a data item the "string" type tells you nothing about the data item other than it consists of a series of bytes that can be interpreted as characters. That's not very meaningful since just about every data item in an XML document can be interpreted as characters.
But, but, but, ...
I just realized that there is a data type that is even less meaningful. Do you know what XSD data type tells you even less than the "string" type? Scroll down to see the answer...
Answer: The "hexBinary" type. It is the most meaningless data type -- ever! All it says is that the data is a series of bytes. Hmph! Every data item is a series of bytes. So, "hexBinary" tells you nothing about the data.
Note: meaningless does not mean useless. Treating a data item as a series of bytes is sometimes useful. For example, you might want to treat the metadata in a camera image (when the picture was taken, was a flash used, f-stop, shutter speed, etc.) as dates, booleans, decimals, integers, but you might want to treat the image data itself as a long series of uninterpreted bytes, i.e., as hexBinary.
/Roger
[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]