XML.orgXML.org
FOCUS AREAS |XML-DEV |XML.org DAILY NEWSLINK |REGISTRY |RESOURCES |ABOUT
OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
Re: [xml-dev] UML-to-RNG?

Dear Stephen,

Thanks for the reply. The UML-text-syntax to RNC path is news to me, and
rather exciting. I was sure that unless someone creates XML from UML
via, say, Java, the only path (not the most reasonable perhaps but one
forced by practical considerations) is to export UML to XMI and then
manipulate the XMI, being practically tied to the output of a single
tool and the whim of its developers, because of XMI's less-than-complete
stability. So indeed, I idealised the picture in my previous message, to
make it more compact.

I am now wondering what the status of Martin Fowler's UML representation
syntax is, will google around, many thanks!

  Piotr

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
> 
> 
> 
> 2011/6/15 Piotr Bański <bansp@o2.pl <mailto: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


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 1993-2007 XML.org. This site is hosted by OASIS