Open hansonwj opened 1 year ago
@hansonwj
The following entities has an ID property attached to them:
Class => Id
ClassCourseAssignment => ClassId
ClassType => Id
Control => Id
Control => PunchingUnitId
Course => Id
Event => Id
Fee => Id
Map => Id
Organisation => Id
Person => Id
PersonCourseAssignment => EntryId
PersonEntry => Id
PersonResult => EntryId
PersonStart => EntryId
Service => Id
ServiceRequest => Id
SimpleCourse => Id
TeamEntry => Id
TeamMemberCourseAssignment => EntryId
TeamMemberResult => EntryId
TeamMemberStart => EntryId
TeamResult => EntryId
TeamStart => EntryId
Given the xsd the following class was generated (for c#):
namespace IOF.XML.V3 {
[Serializable()]
[DebuggerStepThrough()]
[DesignerCategory("code")]
[XmlType(Namespace = "http://www.orienteering.org/datastandard/3.0")]
public partial class Id {
[XmlAttribute("type")]
public string Type { get; set; }
[XmlText()]
public string Value { get; set; }
}
}
So each id property has both an value property and a type property which should hopefully be enough to allow you to attach the id required to specific entities.
@hansonwj Can you please review the list and see if anything entity is missing the requested id (array)?
In c# you should be able to write an extention method to extract the ID in a clean way...
Hi @nzmangan apologies for not being clearer.
My issue is not that the Id elements don't exist in the spec, but that it is not mandatory to provide an Id in most cases. For example, in the Person element [IOF.xsd:458], the minOccurs for the Id element is set at 0
@hansonwj
I am struggling to see what difference it would make the minimum value 1 as it would still be down to each software to implement such feature. I would not be surprised if 0% of the applications out there is not validating the generated xml against the xsd, so even if we do change this I am not sure how many application would enforce such change.
I guess in theory you can argue that you can tell the developers that they do not conform to the standard but I am not sure what leverage you would have. There is plenty of software used that are not dealing well with missing xml element / null values. There is also a possibility that people would just generate random numbers instead which I guess is even less helpful.
I do agree with what you are trying to achieve and yes IOF should probably ensure the specs are showing best practice if IOF values your proposal.
It would be useful if the spec included a mandatory guid on each element, to help with maintaining data between systems.