AU - xsi:nil="true" disapears as soon as I assign nilReason

Added by An Crabbe about 3 years ago

I am transforming data to the INSPIRE schema AdministrativeUnits 4.0. But there seems to be a problem with an attribute named residenceOfAuthority.

When not transforming any data to the attribute, the resulting GML contains this - as expected:

<au:residenceOfAuthority xsi:nil="true"/>

As soon as I add a nilReason -, the resulting GML looks like this:

<au:residenceOfAuthority nilReason="unknown">
<au:ResidenceOfAuthority/>

The xsi:nil="true" has disapeard but should still be there. Any idea what could cause this?

I double checked with another attribute name.GeographicalName.language and there it seems to work fine:

<au:name>

<gn:GeographicalName>

<gn:language nilReason="unknown" xsi:nil="true"></gn:language>

Thank you!


Replies (5)

RE: AU - xsi:nil="true" disapears as soon as I assign nilReason - Added by Simon Templer about 3 years ago

Hi An,

you are right, the xsi:nil should still be there even if you have a nilReason and there is no value for the property.

Is there any relation that targets residenceOfAuthority? It could be that in this case it is populated with an empty string, e.g. through a Rename from a source that is an empty string (instead of "null" / "no value").

Best regards,
Simon

RE: AU - xsi:nil="true" disapears as soon as I assign nilReason - Added by An Crabbe about 3 years ago

No, there is no mapping to any of the other attributes or properties. Only nilReason is filled out with a one-sided ASSIGN statement (see image).

There is an extra issue though. Filling out the nilReason generates an instance validation warning (see second image), saying I should fill out some more obligated field(s).

So maybe the validator doesn't recognizes nilReason properly, and therefore still wants me to fill out the other obligated fields. Maybe it has to do with the source schema? But I am no expert in reading those..

assign.jpg - assign (24.2 kB)

warning.jpg - warning (20.4 kB)

RE: AU - xsi:nil="true" disapears as soon as I assign nilReason - Added by Simon Templer about 3 years ago

Hi An,

then I think this is a bug when there are complex properties with a nilReason. This is something that requires special treatment and awareness of nilReason.

The xsi:nil="true" should be there if no child element is present. However, I'm not quite sure how to deal with it if there is a reference in the href attribute present that points to a ResidenceOfAuthority at another location. In that case no value is present at that position, but it is referenced. What do you think would be appropriate in that case? Having xsi:nil or not?

I filed a corresponding bug ticket, thank you very much for letting us know.

Best regards,
Simon

RE: AU - xsi:nil="true" disapears as soon as I assign nilReason - Added by An Crabbe about 3 years ago

Hi Simon,

Thank you for the response. As fare as I can tell - I'm not expert on schema's at all - the xsi:nil should be there if nothing is filled out or if the nilReason and nothing else is filled out. As soon as another value is given it shouldn't be there anymore.

As to your questions:

(1) I'm not sure what you mean with ' if there is a reference in the href attribute present that points to a ResidenceOfAuthority at another location'. As a user of the schema, I cannot reference a ResidenceOfAuthority at another location since it is a data type and not a feature type and therefore it has no id?

(2) If it would be possible though I suppose it should be treated as if it were filled out anyway. But I guess that is more hypothetically since I don't think that is possible.

Ann

RE: AU - xsi:nil="true" disapears as soon as I assign nilReason - Added by Simon Templer almost 3 years ago

Thanks again for reporting this, Ann. It took us some time to finally get to work on this, but this is now fixed1 and will be part of the next version.

Best,
Simon

[1] https://github.com/igd-geo/hale/commit/fe4ced8485de0ad01719b0f6f8745bc852f57065

(1-5/5)