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] Why does XML Schema allow elements with complex type tobe nillable?

I don't think you should use nillible for the case of someone who has no middle name. That is simple optionality.

nillible is for a more esoteric purpose: where whether that person has a middle name or not has not been disclosed. This may because you don't know, the client didn't ask, or you dont want to tell. 

Think "elision" or "incomplete data". Think partial record transmission, rather than Java or database nulls.

In Australia, we have legal cases that are suppressed by courts. Ordinary suppression you cannot give details of the judgment or sonduct. Total suppression you cannot even mention the case exists. 

If you request a suppressed case from some online database, you might get 
<case xsi:nill="true" .../>
(or whatever the syntax is) but if you request a totally suppressed case you should get a 400 or 500 error (or whatever they use for a query that srlects nothing.)

Is this a good thing for a schema language to have? ... ...
Rick

On Thu, 11 Jul. 2019, 23:17 Costello, Roger L., <costello@mitre.org> wrote:

Hi Folks,

 

XML Schema allows elements with simple type to be nillable. For example, for the real world use case of some people not having a middle name, I declare a nillable <MiddleName> element:

 

<xsd:element name="MiddleName" nillable="true" type="xsd:string" />

 

Then I can create XML instance documents for people that do not have a middle name:

 

<Name>

    <FirstName>John</FirstName>

    <MiddleName xsi:nil="true"></MiddleName>

    <LastName>Doe</LastName>

</Name>

 

Nice!

 

XML Schema also allows elements with complex type to be nillable. Thus, I could declare the <Name> element to be nillable:

 

<xsd:element name="Name" nillable="true">

    <xsd:complexType>

        <xsd:sequence>

            <xsd:element name="FirstName" type="xsd:string" />

            <xsd:element name="MiddleName" nillable="true" type="xsd:string" />

            <xsd:element name="LastName" type="xsd:string" />

        </xsd:sequence>

    </xsd:complexType>

</xsd:element>

 

And then I can create XML instance documents with <Name> elements having a nil value:

 

<Name xsi:nil="true" />

 

Why?

 

Why did the XML Schema working group allow elements with complex type to be nillable?

 

Did the XML Schema working group examine other real world data formats and discover that some of them allow regions with complex content to be nillable? If yes, what are those other real world data formats that allow regions with complex content to be nillable?

 

/Roger



[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