On 06/15/2011 05:16 PM, Stephen D Green wrote:
> Piotr
>
> I plead guilty to using UML (not strictly, since there was no
> requirement for OOD)
> to model a markup language, OASIS TAML (Test Assertion Markup Language)[1]
>
> - the model is found at
>
http://www.oasis-open.org/committees/download.php/42179/testassertionsmodel-1.0-csd-04-May15.pdf
>
> - the markup is in a separate spec at
>
http://www.oasis-open.org/committees/download.php/42478/testassertionmarkuplanguage-1.0-csd-05-Jun07.pdf
>
> (it's all due for public review, by the way, on the way, hopefully to
> becoming
> an OASIS standard, subject to the process and vote of course)
>
> and the technical committee (after I left, as it happened) were persuaded to
> use RelaxNG Compact to define inline the elements of the markup in the spec
> (even though there was also a normative XSD schema for the markup).
>
> To be honest though, there are a few divergences from your described
> (perhaps idealised) process of going from UML to RNG:
> 1. I think the TC didn't actually generate the RNG from the UML
> 2. there was an intermediary stage in that the UML is good for diagrams
> but we had to devise our own textual formal definitions based on the UML
>
> e.g.
>
> prescription {
> content : string (0..1)
> level : string (0..1) (allowed values include: mandatory|preferred|
> permitted)
> }
>
> I based this initially on a text representation syntax of UML by Martin
> Fowler.
> This nicely converts to RelaxNG but I'm not sure exactly how the TC did it.
>
> e.g the above could have the corresponding RNG(compact):
>
> element taml:prescription { prescription_def }
> prescription_def =
> attribute level { "mandatory" | "preferred" | "permitted" }?,
> attribute * - taml:* { text }*,
> text
>
>
> You'd see from the markup spec though that the end result XSD schema
> for this 'prescription' element is
> 1. a lot more complex and
> 2. not very much like the UML (well, our text representation of the UML)
>
> ...
> <xs:element name="prescription" type="prescription_type" minOccurs="0"/>
> ...
> <xs:complexType name="prescription_type">
> <xs:simpleContent>
> <xs:extension base="xs:normalizedString">
> <xs:attribute name="level" type="prescriptionLevelCode_type"/>
> <xs:anyAttribute namespace="##other" processContents="skip"/>
> </xs:extension>
> </xs:simpleContent>
> </xs:complexType>
> <xs:simpleType name="prescriptionLevelBaseCode_type">
> <xs:restriction base="xs:normalizedString">
> <xs:enumeration value="mandatory"/>
> <xs:enumeration value="permitted"/>
> <xs:enumeration value="preferred"/>
> </xs:restriction>
> </xs:simpleType>
> <xs:simpleType name="prescriptionLevelCode_type">
> <xs:union memberTypes="prescriptionLevelBaseCode_type
> codeExtension_type"/>
> </xs:simpleType>
> <xs:simpleType name="prescriptionLevelBaseCode_type">
> <xs:restriction base="xs:normalizedString">
> <xs:enumeration value="mandatory"/>
> <xs:enumeration value="permitted"/>
> <xs:enumeration value="preferred"/>
> </xs:restriction>
> </xs:simpleType>
>
>
>
>
>
> [1] see
http://www.oasis-open.org/committees/tc_home.php?wg_abbrev=tag
>
> ----
> Stephen D Green
>
>
>