Re: [xml] Making sequence entries option in .xsd files.

On 06/06/2016 07:52 PM, Steve Underwood wrote:

In the .xsd file for the DLMS Smart Grid protocol I find the following section:


By the protocol definition, the first 3 items in that sequence should be optional. The minOccurs="0" elements cause items 1 and 3 to be correctly treated as optional. However, the parser in libxml2 2.9.3 treats the second item as a required element. Shouldn't the default setting act in a similar way to a minOccurs="0" element, in making the item optional? Is it always necessary to have minOccurs="0" present when default="something" is present, in order to actually implement the default?

I have been reading the XSD spec again, and it seems to me the line
in the above XSD definition needs minOccurs="0" adding to it to make the element optional. I can't find anything in the spec that says default="xx" has any effect other than to set a default value.

Can anyone confirm or refute this?


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]