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

 


Help: OASIS Mailing Lists Help | MarkMail Help

relax-ng-comment message

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


Subject: Re: [relax-ng-comment] Re: Circular includes/imports in RELAX NG



> > I am working on a scenario in which a number of modules
> > make reference to parts of each other; and they do not fall into a
> > natural hierarchy.
> >
> > Example:
> > -------------------------------------------------------------
> > <grammar xmlns="http://relaxng.org/ns/structure/1.0";
> >                 xmlns:a="http://.../a_namespace
> >                 xmlns:b="http://.../b_namespace>
> >
> > <define name="a:thing1">  ...  </define>
> >
> > <define name="a:thing2">
> >     ...
> >     <ref name="b:thing1"/>
> >     ...
> > </define>
> >
> > </grammar>
> > -------------------------------------------------------------
> > <grammar xmlns="http://relaxng.org/ns/structure/1.0";
> >                 xmlns:a="http://.../b_namespace
> >                 xmlns:b="http://.../a_namespace>
> >
> > <define name="b:thing1">    ...    </define>
> >
> > <define name="b:thing2">
> >     ...
> >     <ref name="a:thing1"/>
> >     ...
> > </define>
> >
> > </grammar>
> > -------------------------------------------------------------
> >
> > In XSD I am able to tell the two schemas about each other using
> > the XSD <import> facility.
> >
> > Is there a RELAX NG equivalent, or work-arounds?

In RELAX NG, definitions are named by a local name alone, not by a namespace
URI + local name.  If you have two modules which reference each other and do
not fall into a hierarchy, then both those modules need to share the same
grammar.  Thus the best you can do in your scenario is to have a root schema
that includes schemas a and b, and then manually manage the names of
definitions in a and b to ensure there is no conflict (or adopt some
convention to ensure no conflict).  I recognize this is not ideal and would
like to have something better in RELAX NG 2.0 (though I haven't been able to
come up with a good solution yet).

> > [ I am currently using MSV as my primary validator and
> > JING as a secondary validator. ]
> >
> > BTW [Conformance issue]:
> >     MSV and JING seem to differ in their handling of namespaces
> >     and of whitespace pre- and post- regular expressions.  I'll
> >     try to come up with some simple examples soon.

If you are reporting a bug in Jing, then I don't mind if the example is
complex.

James






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


Powered by eList eXpress LLC