users@jaxb.java.net

Re: Using xjc:simple and xjc:treatRestrictionLikeNewType together?

From: Hello! hello <prosp4300_at_gmail.com>
Date: Sat, 13 Aug 2011 02:16:25 +0800

Try following binding file
Add -extension option to xjc

xjc -extension
http://svn.code.sf.net/p/opensdmx/svn/java/trunk/opensdmx-domain-21/sdmx21xsd/SDMXCommon.xsd-b
binding.xjb

<jaxb:bindings version="1.0"
    xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
    xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc"
    xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <jaxb:bindings schemaLocation="
http://svn.code.sf.net/p/opensdmx/svn/java/trunk/opensdmx-domain-21/sdmx21xsd/SDMXCommon.xsd"
node="/xs:schema">
       <jaxb:globalBindings generateIsSetMethod="false"
generateElementClass="true">
            <xjc:simple/>
      </jaxb:globalBindings>

    <jaxb:schemaBindings>
    <jaxb:package name="org.opensdmx.domain.v2_1.common" />
    </jaxb:schemaBindings>

    <!-- targetNamespace="
http://www.sdmx.org/resources/sdmxml/schemas/v2_1/common -->
    <jaxb:bindings node="/xs:schema">
    <xjc:treatRestrictionLikeNewType/>
    </jaxb:bindings>
  </jaxb:bindings>
</jaxb:bindings>


2011/8/9 VanIngen, Erik (FIPS) <Erik.VanIngen_at_fao.org>

> Dear Jaxb,****
>
> ** **
>
> In my custom binding file I am trying to use simple and
> treatRestrictionLikeNewType together. I notice that that does not work. Is
> there a way to get them working together, being both effective?****
>
> ** **
>
> ** **
>
> This is one of my experiments:****
>
> ** **
>
> <jaxb:globalBindings xmlns:xjc=*"http://java.sun.com/xml/ns/jaxb/xjc
> "* xmlns:jaxb=*"http://java.sun.com/xml/ns/jaxb"*****
>
> generateIsSetMethod=*"false"* generateElementClass=*"true"*>**
> **
>
> <xjc:simple/>****
>
> </jaxb:globalBindings>****
>
> ** **
>
> <!-- targetNamespace="
> http://www.sdmx.org/resources/sdmxml/schemas/v2_1/common -->****
>
> <jaxb:bindings xmlns:xs=*"http://www.w3.org/2001/XMLSchema"*****
>
> schemaLocation=*"
> http://svn.code.sf.net/p/opensdmx/svn/java/trunk/opensdmx-domain-21/sdmx21xsd/SDMXCommon.xsd
> "* node=*"/xs:schema"*>****
>
> <xjc:treatRestrictionLikeNewType/>****
>
> <jaxb:schemaBindings>****
>
> <jaxb:package name=*"org.opensdmx.domain.v2_1.common"*
> />****
>
> </jaxb:schemaBindings>****
>
> </jaxb:bindings>****
>
> ** **
>
> ** **
>
> Kind Regards,
> Erik****
>