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] [OT] Re: [xml-dev] Lessons learned from the XML experiment

>> 
>> "Can", of course.  Well, sort of.  The interesting question isn't "can", but
>> "is it a good idea?".  There's no general answer to that - it all depends on
>> what you want to do and in what context.
> 
> Is it a better idea than using the string "null"? Other solutions
> include special attributes or a distinct element. Are there still more
> that are simple to express in XML the Syntax?
> 
> Does XML lack something that would make using the command string
> "null" preferable to one of these other options in some context?
> 

The relational database community of course had its fun with this one, with proposals for five different kinds of null with different semantics. And we can do the same in XML.

Normally my instinct is to use absence of an element to mean either (a) this book has no author, or (b) the author of this book is not known. There are a few vocabularies where the difference between these two statements is important, for example genealogy, but this is fairly unusual. If such distinctions are important to you, there are at least two other formulations available to you: you can have an element where the tags are present but the content is empty, or you can add the attribute xsl:nil="true". So there are three representations of nullity available to you, and in true XML tradition you can assign whatever meaning you like to each of the three. If you need more than three, you can of course define your own attributes.

In genealogy, where partial information is the norm, you need to be able to say things like <number-of-children>5</number-of-children> followed by a list of three children, implying that you know there were five children but you only have information about three of them. Generally here absence means "no information available". The use of a keyword such as "null" is pretty useless in such situations. Indeed, I've never found a use case for xsi:nil.

Anyone who uses the string "null" with a special meaning in a place where a surname might appear is either incompetent, or desperately trying to work around the constraints of a badly designed schema.

Michael Kay
Saxonica



[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