Hi again, After additional code examination, I can answer one of my own questions:
Five of the classes have different names than the ones source generator would give based on mapping.xsd. For four of them (class, field, mapping, key-generator), I imagine that it is to prevent collisions with classes of the same name in other packages. For the other one (cache-type), I can't guess why.3) What's the difference? Why was/is there a need for the source-generator-specific version?
Since the difference is easy to describe, I wrote an XSLT stylesheet that can generate a new mapping.xsd_sg from the current mapping.xsd. It is attached as mapping-to-sg.xsl.
mapping-to-sg.xsl
Description: Binary data
As I was finishing that up, I realized that this was just the sort of problem that the source generator binding file was intended to solve, so I wrote a binding file to do the renaming. It is attached, too, as mapping-sg-binding.xml.
mapping-sg-binding.xml
Description: Binary data
It would be nice if one or the other of these could be integrated into the build process. (I'm not suggesting necessarily that the mapping-file objects be regenerated by the source generator at every build -- perhaps the mapping-file objects could be regenerated as a simultaneous test of the source generator and the mapping schema? Or something.)
I suppose that changes to the syntax of the mapping file are rare (so maybe this wouldn't be high priority), but fixing this would make it easier to ensure that the mapping-file objects are in sync with the published schema (and vice versa). It would also make it clearer which (the source or the schema) is the canonical definition. As a side benefit, it would obviate my first two questions :). How about it?
Rhett
=====================================================
| Rhett Sutphin
| Research Assistant (Software)
| Coordinated Laboratory for Computational Genomics
| and the Center for Macular Degeneration
| University of Iowa - Iowa City, IA 52242 - USA
| 4111 MEBRF - email: [EMAIL PROTECTED]
=====================================================
On Friday, December 20, 2002, at 12:38 PM, Rhett Sutphin wrote:
Hi,
I am working on an enhancement to castor
(http://castor.exolab.org/list-archive/msg21626.html) that involves
changing the mapping schema. I see in the source that the Java objects
that reflect the mapping (those in org.exolab.castor.mapping.xml) are
generated with source generator, presumably from
src/main/org/exolab/castor/mapping/mapping.xsd_sg.
When I try to apply source generator to that schema (after making my
changes) it tells me this:
The following namespace "http://www.w3.org/2000/10/XMLSchema"
is no longer supported. Please update to the W3C XML Schema
Recommendation.
According to the CVS log, mapping.xsd_sg is still being maintained
(which is why I presumed it was the one to use). So my questions are:
1) Is mapping.xsd_sg still used to generate the
org.exolab.castor.mapping.xml classes? If so, how?
2) Or should I just use change and use mapping.xsd? Or are changes
now to be made directly to the existing source files?
3) What's the difference? Why was/is there a need for the
source-generator-specific version?
Thanks,
Rhett
