Hans, Note RELAX NG answers below:

> My first question is rng-related. I know rng supports id/idref, but I'm
> not sure what it takes to invoke that. For example, the activity_id
> attribute of administrative_task should be an idref to the activity
> element with that id.

RELAX NG's implementation of ID/IDREF/IDREFS is modular. Jing supports it.

For example:

<attribute name="id"/>

Must be of type ID (note arrows):


<attribute name="id">
 <data type="ID"/>    <<============


  <define name="administrative_task">
    <element name="administrative_task">
      <attribute name="activity_id">
       <data type="IDREF"/>  <<==============

Since there is at most one ID, the IDREF will resolve to that single, unique
ID, or the validator will generate an error.

See http://www.oasis-open.org/committees/relax-ng/compatibility.html#id for
a how-to
and http://www.thaiopensource.com/relaxng/jing.html to validate.

Jing, by the way, means "true" in Thai.

> Second, does the name of the definition need to be different than the
> name of the element? For example, is the following valid?
> <define name="foo">
>   <element name="foo">
>     <empty/>
>   </element>
> </define>

Looks like you have a good start and are having fun!


It is okay if named definitions and elements that have the same name. This
will validate, no problem.

gdmxml mailing list

Reply via email to