xsdjaxbxjccxml

cXML to java bindings issues


Issue: Unable to create java classes from cXML.dtd using java xjc

version I am using is 1.2.032

command used : xjc -dtd cXML.dtd

Error : parsing a schema... [ERROR] Property "Name" is already defined. Use <jaxb:property> to resolve th is conflict.

Issue 1 : Line number around 573 issue is with the "name" as its duplicate (element as well as attribute).

issue 2: ShippingPaymentMethod,TermsOfDeliveryCode,TransportTerms uses "value" which is causing duplicate definations.

Solution as I understand==

I need custom binding.xml .. I tried various ways but unable to create correct binding.xml to solve this issue. once I have correct xml I can use following command to create generated classes. xjc -b binding.xml -dtd cXML.dtd

What I help I need

  1. please provide correct binding.xml if possible
  2. Is there any alternate way to generate java mappings for this cXML
  3. Is there possibilities to have XSD and then have java mapping from XSD?

Please suggest.


Solution

  • Issue Resolved by myself. did following steps.. may be useful for others

    1. Renamed "name" element "ReturnData" in Cxml.dtd

    2. Renamed "value" attr from TransportTerms,ShippingPaymentMethod,and TermsOfDeliveryCode in Cxml.dtd

    3. Created java classes using
      xjc -dtd cXML.dtd

    4.in Generated java classes changed xml annotation back to original.

    So method names will be different but it will read and write correct XML.