mx::core does not validate that xs:ID values are unique at the document level as required by the XSD specification. Every id is modeled as Token (src/private/mx/core/generated/Note.h:113, ScorePart.h:38). There is no document-wide uniqueness table.
Solving this requires a decision about whether parsing a document that violates this should fail with an error or have some graceful recovery (which probably requires a reporting mechanism). Furthermore, when building a document, how would we handle a violation when an attribute is being added to the document that violates the uniqueness table. Heretofore, our aversion to non-infallible functions has not been too problematic, but with this and #393, we are straying into areas where the document can be more easily screwed up. An immediate error response for trying to insert a duplicate ID into the score is probably a better interface than an error later on a write or validate function.
Edit: an LLM session has swayed me toward an error-on-write instead of fail-fast.
mx::coredoes not validate thatxs:IDvalues are unique at the document level as required by the XSD specification. Every id is modeled asToken(src/private/mx/core/generated/Note.h:113,ScorePart.h:38). There is no document-wide uniqueness table.Solving this requires a decision about whether parsing a document that violates this should fail with an error or have some graceful recovery (which probably requires a reporting mechanism). Furthermore, when building a document, how would we handle a violation when an attribute is being added to the document that violates the uniqueness table. Heretofore, our aversion to non-infallible functions has not been too problematic, but with this and #393, we are straying into areas where the document can be more easily screwed up. An immediate error response for trying to insert a duplicate ID into the score is probably a better interface than an error later on a write or validate function.
Edit: an LLM session has swayed me toward an error-on-write instead of fail-fast.