Skip to content

Commit b6052b6

Browse files
committed
Block id attributes with fixed content for version 1.0. When checking
choice overall range use effectiveTotalRange instead of regular range.
1 parent a852a45 commit b6052b6

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

xmlschema/src/commonMain/kotlin/io/github/pdvrieze/formats/xmlschema/resolved/FlattenedGroup.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ sealed class FlattenedGroup(
300300
context: ResolvedComplexType,
301301
schema: ResolvedSchemaLike
302302
): FlattenedParticle? {
303-
if (!base.range.contains(range)) return null
303+
if (!base.effectiveTotalRange().contains(effectiveTotalRange())) return null
304304

305305
val baseIt = base.particles.iterator()
306306

xmlschema/src/commonMain/kotlin/io/github/pdvrieze/formats/xmlschema/resolved/ResolvedComplexType.kt

+3
Original file line numberDiff line numberDiff line change
@@ -930,6 +930,9 @@ sealed class ResolvedComplexType(
930930
for (use in attributes.values) {
931931
if (use.mdlAttributeDeclaration.mdlTypeDefinition == IDType) {
932932
require(idAttrName == null) { "Multiple attributes with id type: ${idAttrName} and ${use.mdlAttributeDeclaration.mdlQName}" }
933+
require(use.mdlValueConstraint !is ValueConstraint.Fixed) {
934+
"Fixed id attributes are not allowed in 1.0"
935+
}
933936
idAttrName = use.mdlAttributeDeclaration.mdlQName
934937
}
935938
}

0 commit comments

Comments
 (0)