You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by "Peter N. Lundblad" <pe...@famlundblad.se> on 2005/09/28 11:10:46 UTC
RELAX NG schema for svn log --xml [was: Re: --xml on all svn commands]
On Wed, 28 Sep 2005, Lieven Govaerts wrote:
> Quoting Julian Reschke <ju...@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
them).
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
stuff.
Opinions?
Regards,
//Peter
Re: [PROPOSAL] Re: RELAX NG schema for svn log --xml [was: Re: --xml on all svn commands]
Posted by Daniel Rall <dl...@finemaltcoding.com>.
On Thu, 29 Sep 2005, Lieven Govaerts wrote:
...
> Just wanted to add that trang seems to be Java software. For me that's ok,
> but it may be an unexpected requirement for some XML developers.
>
> As a Subversion user I'd prefer the DTD & XSD files to be included in the
> release tarballs.
Lundblad and I were just talking about this on IRC, and concur.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: [PROPOSAL] Re: RELAX NG schema for svn log --xml [was: Re: --xml on all svn commands]
Posted by Lieven Govaerts <lg...@mobsol.be>.
Quoting "Peter N. Lundblad" <pe...@famlundblad.se>:
> >
> > >>If you only store the .rnc file in the repository, how do you propose
> > >>users get the XSD/DTD files? Can the trang tool you mention be added to
> > >>the official build procedure?
> > >
> > > It could, but only if trang is available. Adding that as a required
> > > dependency isn't an option, of course. But then it is pretty easy to run
> > > trang yourself. Would it be enough if we documented (in the FAQ?) how to
> > > get other chema languages from the .rnc files?
> >
> > I think if we made it easy, e.g. by providing a Makefile target that would
> do
> > it if "trang" is installed, might be sufficient. It's not unreasonable to
> > expect XML developers to install an XML utility like "trang".
> >
>
> that's OK with me. Do we want to make it even easier and add them to the
> release tarballs? It's another (small) burden on the RM.
>
> Regards,
> //Peter
>
Just wanted to add that trang seems to be Java software. For me that's ok,
but it may be an unexpected requirement for some XML developers.
As a Subversion user I'd prefer the DTD & XSD files to be included in the
release tarballs.
Lieven.
----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: [PROPOSAL] Re: RELAX NG schema for svn log --xml [was: Re: --xml
on all svn commands]
Posted by Julian Foad <ju...@btopenworld.com>.
Peter N. Lundblad wrote:
> On Thu, 29 Sep 2005 kfogel@collab.net wrote:
>
>>So Peter, you're saying the DTDs can be generated from the RNCs? In
>>that case, I think this satisfies Julian's "master format" request...
>
> Yep. [...]
>
> If it is OK, I'll add the RNC schemas in a new directory
> subversion/clients/cmdline/schema and hope for concensus to remove the old
> DTDs. I'll add rules to the build system to generate DTD, XML Schema and
> RNG (RELAX NG XML syntax for xmllint validation).
These RNCs and the DTDs generated from them by "make schema" are really good.
I've looked at them and tested them. Thanks for this work, especially for
taking care to transfer all the relevant comments and to factor out as many
parts as possible.
I'm happy for the original DTDs directory to be deleted now.
- Julian
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: [PROPOSAL] Re: RELAX NG schema for svn log --xml [was: Re: --xml
on all svn commands]
Posted by "Peter N. Lundblad" <pe...@famlundblad.se>.
On Thu, 29 Sep 2005 kfogel@collab.net wrote:
> So Peter, you're saying the DTDs can be generated from the RNCs? In
> that case, I think this satisfies Julian's "master format" request...
>
Yep. And, since I didn't attach the autogenerated DTDs to the mail with
the schemas (as I thought), here I attach them. I'm in the process of
factorizing common stuff out, so this is two files at the moment.
If it is OK, I'll add the RNC schemas in a new directory
subversion/clients/cmdline/schema and hope for concensus to remove the old
DTDs. I'll add rules to the build system to generate DTD, XML Schema and
RNG (RELAX NG XML syntax for xmllint validation).
Regards,
//Peter
Re: [PROPOSAL] Re: RELAX NG schema for svn log --xml [was: Re: --xml on all svn commands]
Posted by kf...@collab.net.
"Peter N. Lundblad" <pe...@famlundblad.se> writes:
> Good, you object until you see a concensus and there can be no consensus
> until you stop objecting:-) Seriously, I don't see the point of keeping
> the DTDs when they can be generated automatically.
Oh, come on, Julian's meaning was perfectly clear :-).
So Peter, you're saying the DTDs can be generated from the RNCs? In
that case, I think this satisfies Julian's "master format" request...
-Karl
--
www.collab.net <> CollabNet | Distributed Development On Demand
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: [PROPOSAL] Re: RELAX NG schema for svn log --xml [was: Re: --xml
on all svn commands]
Posted by "Peter N. Lundblad" <pe...@famlundblad.se>.
On Wed, 28 Sep 2005, Julian Foad wrote:
> Peter N. Lundblad wrote:
> > [Note to other committers: I'm going to replace the existing DTDs with RNC
> > schemas if no one objects.]
>
> I object until I see a consensus for getting rid of the DTDs.
>
Good, you object until you see a concensus and there can be no consensus
until you stop objecting:-) Seriously, I don't see the point of keeping
the DTDs when they can be generated automatically.
> Would you care to point me in the direction of a program that I can use
> instead of "xmllint" (which I've been using for DTDs) to check data
> against RNCs? Preferably one that's available as a SuSE Linux RPM.
>
You can use jing (see thaiopensource.com), or you can even use xmllint
--relaxng. The latter only support the XML syntax, but you can use trang
to convert.
> By all means add RNCs, though if we're going to have more than one kind of
> DTD/schema then it would be nice if there were one master format and an
> auto-conversion to any other formats.
>
That's the point of the previous mail in this thread (but I realize that
maybe you didn't follow this (recurring) discussion until my "stimulator
note":-).
>
> >>If you only store the .rnc file in the repository, how do you propose
> >>users get the XSD/DTD files? Can the trang tool you mention be added to
> >>the official build procedure?
> >
> > It could, but only if trang is available. Adding that as a required
> > dependency isn't an option, of course. But then it is pretty easy to run
> > trang yourself. Would it be enough if we documented (in the FAQ?) how to
> > get other chema languages from the .rnc files?
>
> I think if we made it easy, e.g. by providing a Makefile target that would do
> it if "trang" is installed, might be sufficient. It's not unreasonable to
> expect XML developers to install an XML utility like "trang".
>
that's OK with me. Do we want to make it even easier and add them to the
release tarballs? It's another (small) burden on the RM.
Regards,
//Peter
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: [PROPOSAL] Re: RELAX NG schema for svn log --xml [was: Re: --xml
on all svn commands]
Posted by Julian Foad <ju...@btopenworld.com>.
Peter N. Lundblad wrote:
> [Note to other committers: I'm going to replace the existing DTDs with RNC
> schemas if no one objects.]
I object until I see a consensus for getting rid of the DTDs.
Would you care to point me in the direction of a program that I can use instead
of "xmllint" (which I've been using for DTDs) to check data against RNCs?
Preferably one that's available as a SuSE Linux RPM.
By all means add RNCs, though if we're going to have more than one kind of
DTD/schema then it would be nice if there were one master format and an
auto-conversion to any other formats.
I have no personal desire to keep DTDs, it's just that I haven't yet seen a
consensus to get rid of them. People might even feel that they're part of "the
product" now and we ought to keep them for compatibility.
>>If you only store the .rnc file in the repository, how do you propose
>>users get the XSD/DTD files? Can the trang tool you mention be added to
>>the official build procedure?
>
> It could, but only if trang is available. Adding that as a required
> dependency isn't an option, of course. But then it is pretty easy to run
> trang yourself. Would it be enough if we documented (in the FAQ?) how to
> get other chema languages from the .rnc files?
I think if we made it easy, e.g. by providing a Makefile target that would do
it if "trang" is installed, might be sufficient. It's not unreasonable to
expect XML developers to install an XML utility like "trang".
- Julian
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
[PROPOSAL] Re: RELAX NG schema for svn log --xml [was: Re: --xml on
all svn commands]
Posted by "Peter N. Lundblad" <pe...@famlundblad.se>.
[Note to other committers: I'm going to replace the existing DTDs with RNC
schemas if no one objects.]
On Wed, 28 Sep 2005, Lieven Govaerts wrote:
> Quoting "Peter N. Lundblad" <pe...@famlundblad.se>:
>
> > 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.
> >
> Looks very good indeed.
>
Nice to hear!
> The xsd file is perfect for me, everything that I have in my version is in yours
> too. On top of that yours is already uptodate with the trunk/1.3 branch ( and
> has annotations ).
>
Yeah, the annotations come from the ## comments, which are treated
somewhat like docstirngs in our header files (they are a shorthand for a
general annotation syntax.)
> The original .rnc file seems to be a mixture between dtd & xsd, maybe I should
> take some time to study RelaxNG, looks interesting.
>
They are mostly like extended DTDs, but the datatypes are borrowed from
SML Schema. (You can plug in whatever "datatype library" you like, but in
practice this is what's used).
This is the big benefit of using RELAX NG, namely the learning curveffor
people just wanting to add a filed to the output, without wanting to learn
a schema language. Basically, RNC is just regular expressions, which most
programmers know.
> If you only store the .rnc file in the repository, how do you propose
> users get the XSD/DTD files? Can the trang tool you mention be added to
> the official build procedure?
>
It could, but only if trang is available. Adding that as a required
dependency isn't an option, of course. But then it is pretty easy to run
trang yourself. Would it be enough if we documented (in the FAQ?) how to
get other chema languages from the .rnc files?
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: RELAX NG schema for svn log --xml [was: Re: --xml on all svn commands]
Posted by Lieven Govaerts <lg...@mobsol.be>.
Quoting "Peter N. Lundblad" <pe...@famlundblad.se>:
> 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
> them).
>
> 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
> stuff.
>
> Opinions?
>
> Regards,
> //Peter
Looks very good indeed.
The xsd file is perfect for me, everything that I have in my version is in yours
too. On top of that yours is already uptodate with the trunk/1.3 branch ( and
has annotations ).
The original .rnc file seems to be a mixture between dtd & xsd, maybe I should
take some time to study RelaxNG, looks interesting.
If you only store the .rnc file in the repository, how do you propose users get
the XSD/DTD files? Can the trang tool you mention be added to the official
build procedure?
regards,
Lieven.
----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org