[xsd-users] Extract common type definitions to a separate header

Yury Zaytsev yury.zaytsev at traveltainment.de
Tue Apr 21 04:15:52 EDT 2015


Hi Boris,

On Fri, 17 Apr 2015, Boris Kolpackov wrote:

> Yes, and since now I have the power to travel back in time, I
> went ahead and implemented it, see the --generate-xml-schema
> and --extern-xml-schema. In fact, I've also added a warning when
> --file-per-type is used without --extern-xml-schema. Since I
> went back in time, you should have seen by now. Hm, must be
> something wrong with my time machine...

I'm sorry for the lame question and thanks for the pointer.

Indeed, I've noticed the warning, and tried to implement the support for 
--generate-xml-schema / --extern-xml-schema into my build system. However, 
originally, I failed to make it work, and then concluded that I 
misunderstood the documentation & these options serve some other purpose, 
so I quickly forgot about them.

Upon a second reading (after gaining more experience with XSD), the 
documentation makes much more sense to me. It works now, and indeed I was 
able to cut down a couple of megabytes of generated source code.

I would suggest to add a statement to the documentation of 
--generate-xml-schema along the following lines:

"Note that the XSD compiler should be generally invoked with the same set 
of options in the --generate-xml-schema mode as would be used to compile 
the actual schema later with --extern-xml-schema. Failure to do so might 
cause compilation errors and/or malfunction of the generated code."

While this is obvious in retrospect, at first I've missed some, which 
resulted in confusing compilation issues.

Also, another thing that would have probably helped is to have a simple 
hello example, which only includes the commands to be executed, i.e.

     xsd ...
     xsd ...
     c++ ...

I've tried to trace back the make logic in your blog post introducing the 
--file-per-type mode, and at first it was overwhelming, even though now it 
perfectly makes sense.

All the best,

-- 
Dr. Yury V. Zaytsev
Senior Software Developer
IT Data Production

TravelTainment GmbH
Carlo-Schmid-Straße 12
52146 Würselen/Aachen, Germany
yury.zaytsev at traveltainment.de

http://www.traveltainment.de

Amtsgericht Aachen, HRB 15873
Geschäftsführer: Bernhard Steffens (Vorsitzender),
Dr. Oliver Rengelshausen



More information about the xsd-users mailing list