OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

relax-ng message

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


Subject: cross references


Hello,

I've some comments about key/keyref attributes on <data>.

I'm in the process of translating an UML Schema in a rng Schema in order to
validate an XML Instance before it will be loaded and converted in a Java
object Instance
corresponding to the UML Schema.

Basically all UML classes are translated into XML elements.
All object have a "name" attribute that should conform to a Java identifier,
so I've defined the following <data> pattern for the "name" attributes of
the elements:

<define name="fm.id">
 <data type="string">
  <param name="pattern">[0-9a-zA-Z_-]+</param>
 </data>
</define>

Then for all <element> pattern I can refer the type of the "name" attribute
like that:

<element name="activity">
 <attribute name="name">
  <ref name="fm.id"/>
 </attribute>
</element>

...

<element name="activation">
 <attribute name="name">
  <ref name="fm.id"/>
 </attribute>
</element>

...

<element name="graph">
 <attribute name="name">
  <ref name="fm.id"/>
 </attribute>
</element>

...

In fact the
	<define name="fm.id"> ... </define>
plays the role of a "typedef", sothat when the type for "name" attributes
changes there is no need to make the change on all the "name" attributes.

In the UML Schema there is activation->activity association (an activation
"launches" an activity).

So I have to create an "activity" attribute on the "activation" element to
translate the activation->activity association:

<element name="activation">
 <attribute name="name">
  <ref name="fm.id"/>
 </attribute>
 <attribute name="activity">
  <ref name="fm.id"/>
 </attribute>
</element>

Now it makes problem to put the key/keyref attribute <data> refered by all
attributes, as all these attributes will become potentiel key/keyref
attribute.

Franck.





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


Powered by eList eXpress LLC