users@jaxb.java.net

Re: Better xs:duration support?

From: Kohsuke Kawaguchi <Kohsuke.Kawaguchi_at_Sun.COM>
Date: Thu, 24 Jul 2003 11:44:11 -0700

Malachi de AElfweald <malachi_at_EOTI.ORG> wrote:
> What is the correct way for me to bind this class in my XSD so that the
> autogenerated classes return an XSDuration object, and take one as a
> parameter?

Excellent question to leave in the archive. Here is what you should do:

<xs:schema ...>
  <xs:annotation><xs:appinfo>
    <jaxb:globalBindings>
      <jaxb:javaType
          xmlType="xs:duration"
          name="com.temporalwave.util.XSDuration"
          parseMethod="new"
          printMethod="toString" />
    </jaxb:globalBindings>
  </xs:appinfo></xs:annotation>

  ...

</xs:schema>

regards,
--
Kohsuke Kawaguchi                  408-276-7063 (x17063)
Sun Microsystems                   kohsuke.kawaguchi_at_sun.com