Book a Demo

Author Topic: Assertions on simple/complex types - Conditional requird elements (XML 1.1 only)  (Read 3899 times)

Huub

  • EA Novice
  • *
  • Posts: 9
  • Karma: +0/-0
    • View Profile
Hi,

Does anyone know a way how to model a constraining rule between attributes and elements in Enterprise Architect? More specifically at the moment, I am trying to model conditional required elements in an XSDComplexType, very simpilar to this case here:
https://stackoverflow.com/questions/33504061/conditional-required-elements-in-an-xsd

To address these and other usage scenarios, XML Schema 1.1 provides more expressive constraints through assertions. Assertions are similar to those available in other schema languages such as Schematron and RelaxNG. Other example XSD's here:
http://www.datypic.com/books/defxmlschema/chapter14.html
« Last Edit: April 11, 2018, 05:21:41 pm by Huub »

Huub

  • EA Novice
  • *
  • Posts: 9
  • Karma: +0/-0
    • View Profile
I round tripped an example and apparently EA does not support XML Schema 1.1. Generally v1.1 has not been widely adopted. E.g.  .NET does not support XML schema 1.1 (only 1.0).
Some XML frameworks available but all have quite high prices, see:
https://social.msdn.microsoft.com/Forums/vstudio/en-US/c56fb485-cd6e-4bf3-b111-6aaff8c8008d/xsd-11-and-net-frameworks?forum=netfxbcl

In XML 1.0 validations on 'referential integrity' of xml data against an xsd are possible:
one can define a key (either using xsd:key or xsd:unique) and then reference it using an xsd:keyref
However, EA does explicitly not support this. See:
http://www.sparxsystems.com/forums/smf/index.php/topic,6837.0.html
« Last Edit: April 11, 2018, 05:58:59 pm by Huub »