[relaxng-user] association of RELAX NG with a document
David Tolpin
dvd at davidashen.net
Fri Oct 24 11:07:14 ICT 2003
> On Fri, 2003-10-24 at 00:51, John Cowan wrote:
> > David Tolpin scripsit:
> >
> > > In simpler words, the people who designed the
> > > technology don't see a consistent way to formally express an
> > > association that already exists, or didn't implement it yet.
> >
> > It's part of the general problem of specifying appropriate XML
> > processing; an RNG-specific solution is neither particularly
> > general nor, IMHO, particularly useful.
>
> I would divide the problem of specifying appropriate XML processing for
> a document into:
>
> (a) how to specify the process to be performed
>
> (b) how to locate the appropriate processing specification
>
> I see (b) as a special case of the problem of how to specify rules that,
> given an XML document, find a related resource. This is problem that
> the XML vocabulary that I've designed for nXML mode is intended to
> solve. It's not specific to RELAX NG or for that matter to schemas.
> You could use the same vocabulary to describe how to find the XSLT
> stylesheet to use to display an XML document.
The approach designed for nXML is good. However, it has traps.
I agree that the approach can be convenietly used to assist the user
in choosing the right associations (a schema, a stylesheet, etc). But after
the association is chosen, it should be somehow attached to the document,
at least, in some cases.
It is my decision that document X uses schema Y for validation. Once I made
this decision, all later processing should be based on that, and any change
in association should be expressed explicitly.
With the approach described, changes in the map can cause changes in associations;
and it can come completely unexpected to the user. Consider a system where the map
is a system-wide resource.
Providing a rule in the file that associates the document's URI with a resource does not
help either. The association should persist if I change the name of the document.
The fact that I renamed my document from users-guide.dbx to user-guide.dbx should not
lead to any change in the associations to schemas and stylesheets. It is a property
of the document as an entity to be valid against a schema and processable by a stylesheet,
nor of its file name, or its root element, or its root element's namespace. If I misspell
the root element or the namespace, I want an error message saying that the name or namespace
are misspelled, not that the documented is invalid with respect to a schema selected according
to a misspelled URL.
Thus, for me the only reasonable choice is still to use the DOCTYPE declaration for all
associations and only rely on other characteristics for interactive hints (a list of DOCTYPEs
that should be good for this document).
David Tolpin
http://davidashen.net/
More information about the relaxng-user
mailing list