Stylus Studio XML Editor

Table of contents

Appendices

H Analysis of the Unique Particle Attribution Constraint (non-normative)

Analysis of the Unique Particle Attribution Constraint (non-normative)

A specification of the import of [Unique Particle Attribution] which does not appeal to a processing model is difficult. What follows is intended as guidance, without claiming to be complete.

Two non-group particles overlap if

or
  • They are both element declaration particles one of which is in the other's substitution group.

or or

A content model will violate the unique attribution constraint if it contains two particles which overlap and which either

or

Two particles may valid adjacent information items if they are separated by at most epsilon transitions in the most obvious transcription of a content model into a finite-state automaton.

A precise formulation of this constraint can also be offered in terms of operations on finite-state automaton: transcribe the content model into an automaton in the usual way using epsilon transitions for optionality and unbounded maxOccurs, unfolding other numeric occurrence ranges and treating the heads of substitution groups as if they were choices over all elements in the group, but using not element QNames as transition labels, but rather pairs of element QNames and positions in the model. Determinize this automaton, treating wildcard transitions as opaque. Now replace all QName+position transition labels with the element QNames alone. If the result has any states with two or more identical-QName-labeled transitions from it, or a QName-labeled transition and a wildcard transition which subsumes it, or two wildcard transitions whose intentional intersection is non-empty, the model does not satisfy the Unique Attribution constraint.