[relaxng-user] association of RELAX NG with a document

James Clark jjc at jclark.com
Fri Oct 24 01:54:40 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.

> > If I
> > pretend that a document is valid against a RNG schema, how would I
> > formally express it in a standard way? 
> 
> How about this:
> 
> <?xml version="1.0"?>
> <rdf:RDF
>   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
>   xmlns:rngspec="http://www.relaxng.org/spec-20011203.html#/">
>   <rdf:Description about="http://davidashen.net/document.xml">
>     <rngspec:validity rdf:resource="http://www.davidashen.net/schema.rng"/>
>   </rdf:Description>
> </rdf:RDF>

Although it's important to be able to individually specify the schema to
use for a particular document, it's also convenient to be able to
specify rules that apply to classes of document.  For example, on my
system I have a rule that says when the namespace URI of the document
element is http://relaxng.org/ns/structure/1.0, then the schema is
/home/jjc/schema/relaxng.rnc.

James



More information about the relaxng-user mailing list