On Tue, 2008-03-11 at 12:23 -0400, G. Ken Holman wrote:
> At 2008-03-11 10:39 -0400, John Cowan wrote:
> >David Tolpin scripsit:
> > > Hi,
> > >
> > > > Is there any tool that will "compile" a composite rng by merging
> in the
> > > > external refs?
> > > >
> > >
> > > http://ftp.davidashen.net/incelim/
> >
> >Coolness. This should of course be linked from relaxng.org, but...
> 
> ... but has been added to http://www.relax-ng.org


Ach... it seems to work pretty well, but doesn't solve my trouble since
trang can't handle embedded grammars.


One niggle - it inserts <rng:div> tags where it does the inclusions -
which messes up oxygenxml since it doensn't recognize those tags.I think
they're legal since the rng tools should just ignore those; probably
just an oxygenxml quirk.


So the idea of breaking up the schema into modular parts that could be
used standalone or in combinations won't work.

Right?

This is my first schema, so maybe i'm just doing something stupid...

see below for an example.

brad



<grammar 
    xmlns="http://relaxng.org/ns/structure/1.0";
    xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0";
    datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes";>
     <start>
        <element name="Experiment">
            <a:documentation>This is a specification of a format for the
exchange of analytical ultracentrifuge experiments.
                It includes all the information necessary to reproduce
an experiment and the data acquired during the
experiment.</a:documentation>
            <ref name="Experiment"/>
        </element>
     </start>
    
    <define name="Experiment">
        <element name="GUID">
            <a:documentation>This is a globally unique identifier (a 16
byte string). It is intended
                to uniquely identify an experiment independent of where
the experiment was created. </a:documentation>
            <data type="hexBinary">
                <param name="length">16</param>
            </data>
        </element>
        
...
        
        <externalRef href="Instrument.rng"/>

...

    </define>
    
</grammar>

where Instrument.rng is :

<?xml version="1.0" encoding="UTF-8"?>
<grammar 
  xmlns="http://relaxng.org/ns/structure/1.0";
  xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0";
  datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes";>
    <start>
        <element name="Instrument">
            <a:documentation>This is a description of the physical
instrument used to acquire data during an experiment. </a:documentation>
            <ref name="Instrument-content"/>
        </element>
    </start>
    
    <define name="Instrument-content">
        <a:documentation>This is a description of the physical
instrument used to acquire data for an experiment. 
            An experiment may only contain data from a single
instrument.</a:documentation>
        <element name="Name">
            <a:documentation>The user specified name of this instrument.
E.g. (XLA-1) </a:documentation>
            <data type="token"/>
        </element>

    </define>
    
</grammar>


Reply via email to