[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: UML-to-RNG?
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 2011/6/15 Piotr BaÅski <bansp@o2.pl> Hi All,
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] |
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|