[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Why does XML Schema allow elements with complex type tobe

  • From: Rick Jelliffe <rjelliffe@allette.com.au>
  • To: xml-dev <xml-dev@lists.xml.org>
  • Date: Fri, 12 Jul 2019 23:37:34 +1000

Re:  Why does XML Schema allow elements with complex type tobe
And to the question of what other  languages all nillability, the answer is none. It was supposed to correspond to nullability, but then when it was pointed out it did not match, it was named nillable. (I regret this was not nillible and nillibility. Like the Beverley Nillibillies.)

I think one of the few scenarios that was in place is where you have a record update format. Say like
 update ::= record*
  record ::= data,  @key
  data ::= whatever*,  $nillible

So your update has entries for all records in the new database. If there is no record sent with a key for record in the current darabase, delete that record. If it is an unknown key, create the record. If the item is nilled, leave it alone if it is present,  or otherwise generate an error. Otherwise update with the new information. 

This way gets rid of the need for a verb based protocol, and provides some refundancy catches some integrity errors, such as where a previous create or delete went missing. But mainly for compression, so you dont send data you know has not changed.

I think it should be removed, and replaced by conditionals.


Don't shoot me!
Cheers
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]


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.