[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

RELAX NG schema for svn log --xml [was: Re: --xml on all svn commands]

From: Peter N. Lundblad <peter_at_famlundblad.se>
Date: 2005-09-28 13:10:46 CEST

On Wed, 28 Sep 2005, Lieven Govaerts wrote:

> Quoting Julian Reschke <julian.reschke@gmx.de>:
> > erymuzuan wrote:
> > > May interupt on a few things or two, xml output is really useful ,
> > > especially for those who doing automated build, in our case
> > > combination of NAnt and CruiseControl. Having to parse string output
> > > is never been pretty. Well I know for the fact for those writing
> > > something on top of subversion , they are better off with subversion C
> > > library or language binding for Java or phython. but for those quick
> > > and dirty batch script, build script is not always possibble.
> > >
> > > The second thing is to replace dtd with xsd, there's much better tool
> > > support and it's lot more xpath friendly. I would like volunteer to
> > > work on the xsd schema with those who look at this as a good way to
> > > go. may be write patch for the implementation too.
> >
> > How is XSD more "xpath" friendly? And *if* DTD isn't going to be
> > sufficient (why exactly?), why not RelaxNG?
> >
> The main disadvantage of DTD's is the lack of declaration of the data types,
> every piece of data is a string and that's it. That may not be important
> for users reading the generated xml, but it sure is for applications
> reading and parsing the xml.
> The big advantage of DTD files is simplicity, it's very easy to read and
> understand.
Lets' combine those benefits and we get RELAX NG. Attached are schemas for
the log ouput:
- .rnc: RELAX NG compact syntax
- .rng: RELAX NG XML syntax (for comparison)
- .xsd: W3C XML Schema

To get the .rnc file, I took log.dtd and put it through trang (a schema
converter from James Clark). Then I fixed it up and extended it with
datatypes and constraints not expressible in the DTD (such as an optional
group of attributes: either both copyfrom-path and copyfrom-rev or none of

To get the .xsd file, I just had to convert it with trang - no manual
work. I'm no XSD expert, but it looks like the results are satisfying.

My point is that we could store .rnc in the repository (or .rng if we
like, but that's less human-friendly) and get both DTDs and XML Schema
automatically. RELAX NG is appropriate because:
- It is simple and easy to read and write (part because it to some extent
uses similar syntax to the DTD)
- It is the most expressive of the languages.
- You can map to all the other languages from a common source, with some
approximations where the target language is less expressive.

Note that the provided .rnc file is not perfect. If we wan to go this
route, we should take the chance to modularize it by factoring out common



To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Received on Wed Sep 28 13:12:50 2005

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.