You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@forrest.apache.org by Dave Brondsema <da...@brondsema.net> on 2004/02/20 02:36:51 UTC

problems with relaxng & dtds

I was working on moving creating a seperate DTD file for skinconfig.  I did 
that and set up the skinconf.xml files to use it.  However, forrest's build 
and 'forrest site' had some problems:

1) <jing> is used to validate skinconfig files agains the .rnc file we have for 
it.  When I added the DTD declaration at the top, it attempted to download the 
file (i'm behind a proxy and the files not there, and most importantly we don't 
want it to do that anyway).  So I changed it to use <xmlvalidate> with an 
<xmlcatalog> and it worked fine.  So here's the real question: why have relaxng 
schemas at all?  Most editors use DTDs (some support schema now) and I don't 
know of any that support relaxng.  So we want DTDs as a form of unique 
identification and versioning; and because editors support them better than 
other validation formats.  So what are the advantages of having either just 
relaxng or both relaxng and DTDs.

2) <xmlproperty> is used to load the skinconfig file.  When I added the DTD 
declaration to the skinconfig file, it attempted to download the DTD file.  
Again, not good.  Turning validation off made no difference.  And the 
<xmlproperty> task does not support an <xmlcatalog> subelement.  I filed an 
enhancement request (http://issues.apache.org/bugzilla/show_bug.cgi?id=27053).  
I made some code changes to <xmlpropety> so that it supports <xmlcatalog>, but 
it didn't seem to use the catalog.  Any ideas?



-- 
Dave Brondsema 
dave@brondsema.net 
http://www.brondsema.net - personal 
http://www.splike.com - programming 
http://csx.calvin.edu - student org 

Re: problems with relaxng & dtds

Posted by David Crossley <cr...@apache.org>.
Dave Brondsema wrote:
> I was working on moving creating a seperate DTD file for skinconfig.  I did 
> that and set up the skinconf.xml files to use it.  However, forrest's build 
> and 'forrest site' had some problems:
> 
> 1) <jing> is used to validate skinconfig files agains the .rnc file we have for 
> it.  When I added the DTD declaration at the top, it attempted to download the 
> file (i'm behind a proxy and the files not there, and most importantly we don't 
> want it to do that anyway).  So I changed it to use <xmlvalidate> with an 
> <xmlcatalog> and it worked fine.  So here's the real question: why have relaxng 
> schemas at all?  Most editors use DTDs (some support schema now) and I don't 
> know of any that support relaxng.  So we want DTDs as a form of unique 
> identification and versioning; and because editors support them better than 
> other validation formats.  So what are the advantages of having either just 
> relaxng or both relaxng and DTDs.
> 
> 2) <xmlproperty> is used to load the skinconfig file.  When I added the DTD 
> declaration to the skinconfig file, it attempted to download the DTD file.  
> Again, not good.  Turning validation off made no difference.  And the 
> <xmlproperty> task does not support an <xmlcatalog> subelement.  I filed an 
> enhancement request (http://issues.apache.org/bugzilla/show_bug.cgi?id=27053).  
> I made some code changes to <xmlpropety> so that it supports <xmlcatalog>, but 
> it didn't seem to use the catalog.  Any ideas?

A while ago Jeff Turner mentioned the DoctypeChanger on xml-commons
mailing list. This is a way to temporarily remove the document type
declaration from the xml instance.
http://marc.theaimsgroup.com/?l=xml-commons-dev&m=101156885310495

--David




Re: problems with relaxng & dtds

Posted by Arnaud SAHUGUET <sa...@lucent.com>.
Dave Brondsema wrote:

>I was working on moving creating a seperate DTD file for skinconfig.  I did 
>that and set up the skinconf.xml files to use it.  However, forrest's build 
>and 'forrest site' had some problems:
>
>1) <jing> is used to validate skinconfig files agains the .rnc file we have for 
>it.  When I added the DTD declaration at the top, it attempted to download the 
>file (i'm behind a proxy and the files not there, and most importantly we don't 
>want it to do that anyway).  So I changed it to use <xmlvalidate> with an 
><xmlcatalog> and it worked fine.  So here's the real question: why have relaxng 
>schemas at all?  Most editors use DTDs (some support schema now) and I don't 
>know of any that support relaxng.  So we want DTDs as a form of unique 
>identification and versioning; and because editors support them better than 
>other validation formats.  So what are the advantages of having either just 
>relaxng or both relaxng and DTDs.
>
>  
>
I don't know the details of forrest and how it uses either DTDs or RelaxNG.
I can give my view on RelaxNG. It is a very nicely designed schema 
language for XML. It is simple to understand and to implement. But since 
we are just users of already existing validators, this does not really 
matter.
 From a forrest point of view, RelaxNG permits to have more modular 
schemas with backward compatibility for validation. You can extend 
RelaxNG grammars without having to create some special place holders 
(like entities).

Another interesting aspect of RelaxNG is that its creators do not like 
the idea of having in the document a reference to the schema it relates 
to. A given document may be compliant to multiple schemas at the same 
time, expressed in different schema languages. For instance, the way 
nxml (RelaxNG emacs validator by James Clark) is implemented is by 
having a schema file which maps name spaces or root element or file 
extensions to schemas.
So basically the validator reads the beginning of the file and figures 
out which schema to use based on namespaces, element names, etc.

As for editors, there is nxml for emacs.
There is also a couple of them available at www.relaxng.org/#editors

regards,

Arnaud