Author Topic: Generate XML schema - XSD Simple type - ISO TC211  (Read 1873 times)


  • EA Novice
  • *
  • Posts: 7
  • Karma: +1/-0
    • View Profile
Generate XML schema - XSD Simple type - ISO TC211
« on: June 14, 2016, 11:35:37 pm »

I'm trying to implement a new XSD simple type "NonEmptyString", with at least one character (minLength set at 1, plus a pattern), under the UML Profile for INSPIRE directive.

I tried by creating a new class, setting its stereotype to type, then generalizing from the CharacterString type in INSPIRE specifications (ISO TC211 repository), and adding a minLength attribute with default value set to 1.  ==> FAIL. Creates the class, but with an attribute named minLength.

I tried that, generalizing from the "string" element in the UML profile for XML schema, and creating a class with the type XSDSimpleType as a stereotype, and setting the type to string, then under the UML menu, setting the minLength tag value at 1 (thus doing a restriction). ==> FAIL. Does not create the class at all.

Many thanks for any hypothesis you may have to provide. :)


  • EA Novice
  • *
  • Posts: 18
  • Karma: +0/-0
    • View Profile
Re: Generate XML schema - XSD Simple type - ISO TC211
« Reply #1 on: June 16, 2016, 12:19:57 pm »

It's been a few years since I last 'profiled', but you asked for hypotheses so... my read is the first method (generalize from CharacterString) gets you closest to the desired result:
1. new class (achieved)
2. restrict inherited attributes (not achieved).

Instead of adding 'minLength' as a new attribute, suggest add a constraint or deal with it by assertion. That tips us into the world of OCL or Schematron.

I seem to recall both INSPIRE and the old CSIRO SEEGRID/WaterML/GeoSciML people had guidance/blogs/discussion papers with examples and things to consider when extending the geospatial profiles.