users@jaxb.java.net

Re: globalBindings and org.w3 generated classes

From: Kohsuke Kawaguchi <Kohsuke.Kawaguchi_at_Sun.COM>
Date: Thu, 30 Oct 2003 07:39:40 -0800

> Issue #1) If I add the following to my bindings file (used by XJC) it
> appears to be ignored
> <jaxb:globalBindings>
> <xjc:serializable />
> <jaxb:javaType name="java.util.Calendar"
> xmlType="oa:DateTimeAny"
> parseMethod="financing.ifservices.util.XMLUtil.parseCalendar"
> printMethod="financing.ifservices.util.XMLUtil.printCalendar"
> />
> </jaxb:globalBindings>

When using an external binding file, there's a bug where XJC fails to
report an error when the above is not wrapped in <jaxb:bindings>. I
suspect this as the cause.


> Issue #2) JAXB generation is creating classes in a package called
> org.w3._2001.xmlschema (and org.w3._2001.xmlschema.impl). I have tried to
> custom map this to my package names to no avail. Due to enterprise coding
> standards I am required to have any classes I use be in my assigned URI.
> Is there anyway to map the org.w3 classes to a different package?

Yes. Write the following schema file and add it to your compilation.

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
           targetNamespace="http://www.w3.org/2001/XMLSchema"
           xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
           jaxb:version="1.0">
  <xs:annotation><xs:appinfo>
    <jaxb:schemaBindings>
      <jaxb:package name="org.acme.any"/>
    </jaxb:schemaBindings>
  </xs:appinfo></xs:annotation>
</xs:schema>




regards,
--
Kohsuke Kawaguchi
Sun Microsystems                   kohsuke.kawaguchi_at_sun.com
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
For additional commands, e-mail: users-help_at_jaxb.dev.java.net