Skip to content

ID uniqueness is not constrained by mx::core. #397

Description

@webern

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    coreAffects the mx::core layerdesignNot a simple fix. Requires design decisions.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions