I am also having no success with using the <package> element to handle something like the last example in Erik's msg. I have a bunch of schemas that do relative includes of a common schema that lives in its own directory on the filesystem.
Ideally, I do not want to regenerate the Java class for this common schema every time I process an including schema. However, I could live with the common schema's class being regenerated each time, as long as it is always put into the same Java package of my choosing, overwriting the class already generated for it. I thought I could use the <package> element to do this. As it is, I now have multiple copies of the same common Java class in all the packages associated with the various including schemas. How do I deal with this? Thanks, Lisa "Ostermueller, Erik" wrote: > > I wrote: > > Also, is the <package> node in any way a replacement for > > the property org.exolab.castor.builder.nspackages? > When you generate code, the answer is yes. > > > How about for the SourceGenerator -package command line > > parameter? > Again, when you generate code, the answer is yes, as long as you > put the same targetNamespace in both your schema and the binding file. > > I have another question, though. This ns-package mapping would > be very helpful when unmarshalling. Is there any code that inspects > the bindingfile during unmarshalling? > > I want it to detect a ns in an instance doc, locate the corresponding > java package in the binding file and then unmarshall the data. > > Also, I still haven't answered my original question: > > The binding file html doc says the <package> element allows you "to define the > mapping between a schemaLocation attribute and a Java package". > > Does this mean that the following binding file will place > all generated objects for Customer.xsd into the 'vo' package? > It's not working for me. > > <cbf:binding xmlns:cbf="http://www.castor.org/SourceGenerator/Binding" > defaultBindingType='type'> > <cbf:package> > <cbf:name>vo</cbf:name> > <cbf:schemaLocation>./Customer.xsd</cbf:schemaLocation> > </cbf:package> > </cbf:binding> > > Thanks, > > Erik > > ----------------------------------------------------------- > If you wish to unsubscribe from this mailing, send mail to > [EMAIL PROTECTED] with a subject of: > unsubscribe castor-dev ----------------------------------------------------------- If you wish to unsubscribe from this mailing, send mail to [EMAIL PROTECTED] with a subject of: unsubscribe castor-dev
