hi,

after a brand relaunch, some of our public xml schemas have to be 'relaunched' 
as well. and yeah, let's publish them both in parallel for compatibility 
reasons.

so in addition to something not as simple as

<xs:schema xmlns:xs="..." targetNamespace="http://www.oldbrand.com/a"; 
xmlns:a="http://www.oldbrand.com/a";>
  <xs:element name="A"> 
    <xs:complexType>
      <xs:sequence>
        <xs:element name="Child" type="a:CustomType"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  ...
<xs:schema>

there will also be a version

<xs:schema xmlns:xs="..." targetNamespace="http://www.newbrand.com/a"; 
xmlns:a="http://www.newbrand.com/a";>
  <xs:element name="A"> 
    <xs:complexType>
      <xs:sequence>
        <xs:element name="Child" type="a:CustomType"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  ...
<xs:schema>


so far so good.

we are using castor 1.0.5 (we won't upgrade to the hottest castor release until 
it's absolutely necessary) and we generate the corresponding objects with the 
castor sourcecode generator using a simple binding file. until now all that is 
done for one schema only. in the business logic we use the static unmarshal 
method of unmarshaller.

i am not sure, how i can handle the second schema preferably on 'castor level', 
without having to double not so little business code instead. i want to bind 
the 'newbrand' schema to the exact same classes that where generated for the 
'oldbrand' schema, without losing the validation features of castor for either 
of them.

i am afraid that won't work easily, because generating classes also freezes the 
respective namespace in a field of the classdescriptor. i think, i needed a 
list of acceptable namespaces...

what i have tried without success so far is:
 * using the 'org.exolab.castor.builder.nspackages' property specifying the 
same package for both targetnamespaces
   it does not work, because the latter generation run simply overrides the 
classes generated during the first run.
 * setting a custom 'xmlclassdescriptorresolverimpl' that overrides the 
'resolveByXMLName' method on an unmarshaller instance
   it seems to be called never, however.

further, i could think of dropping the code generation and using two similar 
xml mapping files instead - one mapping file for each of the schemas binding to 
the same set of handwritten business object classes.


ok, this one's odd. i have no idea, whether i am close to a solution or it's 
not supported anyway. however, does anyone have an idea how to deal with the 
problem?
thanks and regards,

Reinhard

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Zusätzliche Pflichtangaben von Kapitalgesellschaften gem. § 14 UGB:
FN166941b | Handelsgericht Wien | Firmensitz Wien


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to