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: [relax-ng] Re: [relax-ng-comment] RELAX NG DTD, RELAXNG2DTD?



> First, congratulations for publication of the 1.0 spec.

Thanks.

> 2. I found an XSLT stylesheet that converts RELAX schemas to DTDs at
> http://www.geocities.co.jp/SiliconValley-Bay/4639/relax2dtd.htm. Has
anyone
> ever done something that converts a RELAX NG schema to a DTD? Again, the
> lack of being able to model everything in an RNG schema would be a
> limitation, but when describing your own documents in RNG, it would be
handy
> to be able to hand off a DTD to a client or other business partner who was
> sticking with XML 1.0 DTDs.

I think this would be very useful, as would being able to convert a RELAX NG
schema to W3C XML Schema.  However, this is not a straightforward problem to
solve.  There are two goals one might have:

1. It is highly desirable to preserve the definitional structure of the
RELAX NG schema.  I want to get a DTD with parameter entities corresponding
to the definitions in the RELAX NG schema. This also includes preserving
multiple file structure.

2. It is highly desirable to be able to deal somehow with all the features
of RELAX NG schema that don't translate directly into DTDs. There are two
parts:

(a) Transform it into a form that DTDs can support (eg rearrange definitions
in an order that is legal for an XML DTD) whilst preserving the RELAX NG
semantics.

(b) Approximate it, that is, produce a DTD that will allow everything that
the RELAX NG schema allows but will not prohibit everything that the RELAX
NG schema prohibits.  For example, if the RELAX NG schema specifies a
multiple content models for an element, transform it to use a single content
model that is a choice between all of the possible content model.

Both 1 and 2 are each by themselves quite hard.  Some features of 2 are very
non-trivial to deal with, depending on  whether you want to get the best
possible approximation.  (For example, consider the problem of making
non-deterministic content models deterministic.)

However, trying to do both 1 and 2 *at the same time* seems to be very hard.
Whether 1 or 2 is more important seems to depend on the purpose of the
conversion.  If a human is going to read the converted DTD, 1 is essential;
but if the DTD is just going to be used as input to a program (like an XML
editor), 2 is the important thing.

Any thoughts on what you would want from a RELAX NG to DTD converter?  I
think the same questions apply to a RELAX NG to W3C Schema converter.

James




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


Powered by eList eXpress LLC