[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]
Re: [xml-dev] UML-to-RNG?
- From: Stephen D Green <stephengreenubl@gmail.com>
- To: =?UTF-8?Q?Piotr_Ba=C5=84ski?= <bansp@o2.pl>
- Date: Wed, 15 Jun 2011 16:16:44 +0100
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
- the markup is in a separate spec at
(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>
----
Stephen D Green
2011/6/15 Piotr Bański
<bansp@o2.pl>
Hi All,
With apologies to those who participate in the RNG-Users list, I would
like to repeat here a question that has yielded no answers there for
nearly two weeks -- something that may obviously suggest that the matter
is closed, but I'd love to make sure that I haven't missed any leads.
It just seems a pity not to see any competition, and consequently no
option to choose, between RELAX NG and XML Schema as far as the
serialization of UML models is concerned. I'd be very curious to know if
the reason is principled or maybe rather of the "just because" sort.
Thanks,
Piotr
-------- Original Message --------
Subject: [rng-users] UML-to-RNG
Date: Thu, 02 Jun 2011 22:43:49 +0200
Hello All,
I've been wondering: whenever I seem to read about UML models getting
mapped to XML, the target is either an instance, or XSD.
Both James Clark [1] and Eric van der Vlist [2] mention that RNG appears
to be a good[1]/perfect[2] target for mapping from UML, much better than
XSD.
[1]: http://www.thaiopensource.com/relaxng/design.html
[2]: http://books.xmlschemata.org/relaxng/relax-CHP-14-SECT-3.html
And hence my question: has anyone actually employed this kind of mapping
and if so, may I please have a reference to a report on that or a link
to a live project that uses UML->RNG mapping? Tried googling, failed...
Many thanks in advance,
Piotr
_______________________________________________________________________
XML-DEV is a publicly archived, unmoderated list hosted by OASIS
to support XML implementation and development. To minimize
spam in the archives, you must subscribe before posting.
[Un]Subscribe/change address: http://www.oasis-open.org/mlmanage/
Or unsubscribe: xml-dev-unsubscribe@lists.xml.org
subscribe: xml-dev-subscribe@lists.xml.org
List archive: http://lists.xml.org/archives/xml-dev/
List Guidelines: http://www.oasis-open.org/maillists/guidelines.php
[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]