|
|
|
Hello sir,
I am a just starter and i was given the work to generate classes from the given xsd files. So i have no test cases, No code. I have generated classes from slmost all xsd files with the use of commands like... java org.exolab.castor.builder.SourceGeneratorMain -i IdentityProductTaxonomy.xsd -package com.dnb.IDP.Product.Identity.Vers1 My only problem is the contactInformation element which i have specifically highlighited in the last post. I have only label.xml or presentation.xml extra. else i am having nothing. "All 3 ContactInformation elements have diff namespace but while creating the java file it uses just element name to create a reference variable of ContactInformation class. Thus bcoz there are 3 ContactInformation element(even though with different namespace)...it will try to create 3 objects with name "_contactInformation" and that gives an error of "Duplicate name found as a class member " if somehow it takes namespace in consideration or can resolve the name conflicts then it may solve problem." I can understand that you are giving your precious time to help me and I am thankful to u for that but I donot have much more things than this and the problem i am facing doesnt require anything else except schema files. I have tried with binding.xml but problem I am facing is the same how to seprate different element Here. SO this is what i am having. If i remove 2 elements then it creates all classes ...problem comes when 3 elements with same elements are there because at the time of source creartion it creates member variable according to the name of the element and thus it will try to create 3 elements having name _contactInformation(according to naming conventions) od ContactInformation classesNow until I specifically mention the different packages somehow, I am not going to get the desired result. Still I am attaching 3 contactInformation classes which are generated and and whose object this source needs to use. Well, apparently, there's an XML schema missing: CommonTypesTaxonomy.xsd.
Here's my suggestion: how about attaching a set of XML schema files where you (and not me) limit the set of XML schema artefacts to what's really necessary to reproduce your problem. Then, and only then, I will look into this again. The alternative is to consider looking into professional services where you'll pay us for doing this. Alright, I finally managed to reproduce your problem, and I do acknowledge that Castor's code generator currently does not have support for more than one element reference with the same (local) name. I had a quick look at the existing source code, and I think it should be possible to add support for namespace qualification in a binding file (something currently is not supported). But .... this is not going to be an easy task. I'd estimate that it would take me (or any other committer) a few days to introduce this new feature. And this is beyond my personal capacity .. as I would be doing this in my spare time.
However, if you'd be willing to pay for this (professional support), I could provide you with an estimate etc. Attached two patch files that together form an initial (very early) patch for review. With these two patched applied I can get things to work fully. Please note that I have not tested against the CTF yet.
Updated and improved patch, tested against the XML CTF as well (with no errors).
I'd appreciate any feedback from the reporter or anybody listening in as well ..
Hi,
Thanks For ur kind reply. I have completed that work in castor and now no longer working in that but still u have helped in lot many ways and inspired me to reply to ppl who are in need. Thank you very much. Final patch for review (incl. CTF test case).
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
http://castor.org/how-to-submit-an-xml-bug.html
and follow the instructions provided there to provide me with a full test case incl. JUnit test case to start code generation, a minimal XML schema that exposes the error at discussion, castor.properties (if used), binding file (if used), etc. Castor is an open source project, and I am spending my private time here without being made. I think I can expect that you provide me with as much information as possible so that I can easily replay your problem without having to wonder which XML schema file I shall be using as starting point, etc.
Alternatively, please consider taking up professional services as explained at http://castor.org/professional-services.html
.