XML.orgXML.org
FOCUS AREAS |XML-DEV |XML.org DAILY NEWSLINK |REGISTRY |RESOURCES |ABOUT
OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
Re: [xml-dev] What XML Schema data type is even less meaningful thanthe "string" data type?

xsd:anyType

On Mon, May 10, 2021 at 8:57 AM Roger L Costello <costello@mitre.org> wrote:
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


_______________________________________________________________________

XML-DEV is a publicly archived, unmoderated list hosted by OASIS
to support XML implementation and development. To minimize
spam in the archives, you must subscribe before posting.

[Un]Subscribe/change address: http://www.oasis-open.org/mlmanage/
Or unsubscribe: xml-dev-unsubscribe@lists.xml.org
subscribe: xml-dev-subscribe@lists.xml.org
List archive: http://lists.xml.org/archives/xml-dev/
List Guidelines: http://www.oasis-open.org/maillists/guidelines.php



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 1993-2007 XML.org. This site is hosted by OASIS