You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@daffodil.apache.org by Steve Lawrence <sl...@apache.org> on 2019/06/07 15:21:40 UTC

dfdl:nil* properties on xs:simpleType allowed?

In working on DAFFODIL_2096 (Add dfdlx extensions prefix), I sort of ran
into issues with short form properties not being validated
(DAFFODIL-598) and think I have come across a small update to the XML
Schema for DFDL to re-enable schema validation of dfdl attributes, but
still allow attributes from other namespaces.

I've got the change in and it has found many cases of incorrect
properties in our tests, so I think this is going to be a big help.
However, in one test case I found something that we support but I think
contradicts the spec.

We have something like this:

  <xs:simpleType name="type" dfdl:nilValue="NIL"
dfdl:lengthKind="delimited">
    <xs:restriction base="xs:string"/>
  </xs:simpleType>

  <xs:element name="e1" type="ex:type" nillable="true" />

In this example, dfdl:nilValue is provided on the xs:simpleType. The
specification from https://daffodil.apache.org/docs/dfdl/ says this
about dfdl:nilValue and other dfdl:nil* properties:

  Annotation: dfdl:element(simpleType)

I believe this syntax means the property is valid for dfdl:element's of
type simpleType, but not the xs:simpleType element itself.

Is this correct?

This is is what our XML Schema for DFDL enforces, but since it's not
currently enforce we do support getting the nilValue from the
xs:simpleType element.

So should the test be changed to move the nilValue property to the
xs:element or should the XML schema for DFDL be updated to allow the
property on xs:simpleType's?

Re: dfdl:nil* properties on xs:simpleType allowed?

Posted by "Beckerle, Mike" <mb...@tresys.com>.
You are correct. The property combining logic isn't (or wasn't) enforcing that the nil-related properties are only allowed on elements.


Personally I think this is a mistake. But it is what the spec says, so we should change our tests to comply.

________________________________
From: Steve Lawrence <sl...@apache.org>
Sent: Friday, June 7, 2019 11:21:40 AM
To: dev@daffodil.apache.org
Subject: dfdl:nil* properties on xs:simpleType allowed?

In working on DAFFODIL_2096 (Add dfdlx extensions prefix), I sort of ran
into issues with short form properties not being validated
(DAFFODIL-598) and think I have come across a small update to the XML
Schema for DFDL to re-enable schema validation of dfdl attributes, but
still allow attributes from other namespaces.

I've got the change in and it has found many cases of incorrect
properties in our tests, so I think this is going to be a big help.
However, in one test case I found something that we support but I think
contradicts the spec.

We have something like this:

  <xs:simpleType name="type" dfdl:nilValue="NIL"
dfdl:lengthKind="delimited">
    <xs:restriction base="xs:string"/>
  </xs:simpleType>

  <xs:element name="e1" type="ex:type" nillable="true" />

In this example, dfdl:nilValue is provided on the xs:simpleType. The
specification from https://daffodil.apache.org/docs/dfdl/ says this
about dfdl:nilValue and other dfdl:nil* properties:

  Annotation: dfdl:element(simpleType)

I believe this syntax means the property is valid for dfdl:element's of
type simpleType, but not the xs:simpleType element itself.

Is this correct?

This is is what our XML Schema for DFDL enforces, but since it's not
currently enforce we do support getting the nilValue from the
xs:simpleType element.

So should the test be changed to move the nilValue property to the
xs:element or should the XML schema for DFDL be updated to allow the
property on xs:simpleType's?