[xsd-users] License and Portability

Boris Kolpackov boris at codesynthesis.com
Mon Jul 4 12:57:16 EDT 2011


Hi Peter,

Peter Backes <rtc at cdl.uni-saarland.de> writes:

> The XSD compiler generates the source code by systematic transformations
> from the schema.  In fact, that is just what a compiler is supposed to
> do. No code is copied from the XSD compiler source code.

For any schema that you compile with XSD I can trace for you every
bit of generated code back to the XSD compiler source code, with
the exception of class/function names, which is what comes from the
schema. In fact, that's essentially what the XSD compiler does: it
takes bits of source code (embedded into it) and parameterizes them
with names that come from the schema.


> Of course, XSD generates the code according to certain programming 
> idioms and makes use of some basic code snippets that are present in 
> the XSD compiler.  But these are not copyrighted.  They lack 
> originality and/or copyrightability: You cannot claim a copyright a 
> programming idiom or pattern or on basic code snippets.

This is a very strong statement. XSD outputs large chunks of non-trivial
code (e.g., parsing code) that I am pretty sure is copyrightable. Also,
if you believe that XSD consists of just a bunch of basic idioms thrown
together, then I am sure you will be able to implement a replacement in
an evening or two ;-).


> Nor is there any assembler code in the input you pass to the GCC C 
> compiler.  In fact, compilers are translators.  What you pass as the 
> input is in a different language from what it gives you as output.  
> This is exactly the idea.

There is a difference. When you pass a program in C++, it already
contains the "logic" or "execution plan". Assembly is just another
representation of that logic. If there is a loop in C++, there is
a loop in assembly, etc. I don't think you will disagree that XSD-
generated C++ code is not just another representation of the XML
Schema. While, for example, an auto-generated from XML Schema
Relax NG would in fact be just another representation.


> All that matters is that all the output is determined by the input 
> completely.  There is no piece of copyrightable code that is inserted 
> regardless of the input.  (Contrary to bison, which does copy 
> substantial pieces of code from its own source code into the output; 
> irrespective of what the input is.)  Please correct me if I got this 
> wrong, but it was my impression from looking at the generated code.

It is wrong. There are substantial chunks of the generated code that
do not depend on the input (e.g., code generated for built-in types).

But I also do not agree with your statement re "if the output is 
determined by the input...". I haven't seen this definition in the
GPL FAQ either. But even if we use this test, XSD output is not
determined only by the XML Schema. It is also determined by what
"patterns" (C++ code) are inside the XSD compiler.

Let's change this problem slightly and see if you still think I am 
wrong. Let's say I wrote an implementation of an algorithm in C++
that uses preprocessor macros to specify some parameters. So in
order to obtain the actual algorithm implementation, you have to
pre-process my code with some macro definitions. Do you think that
because the output is "directed" by your macro definitions that the
result pre-processed code is not copyrightable?

Boris



More information about the xsd-users mailing list