OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   RE: [xml-dev] Optional elements and restrictions

[ Lists Home | Date Index | Thread Index ]

.

 

I am hearing that it is best practice to allow both scenarios – the “empty element” and the “omitted element” – in documents that are provided.  

 

 

I don't think there is any consensus on this.

 

My own preference is to model absent or not-applicable data by omitting the relevant element or attribute, using elements/attributes that exist but have an empty string as their value only for cases where this has some real meaning.

 

There is of course a third way to represent absent information, namely to use the xsi:nil attribute, but I've never met anyone who thinks that is a good idea.

 

Michael Kay

http://www.saxonica.com/





 

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

Copyright 2001 XML.org. This site is hosted by OASIS