users@jaxb.java.net

Re: marshalling empty element

From: zzd <zzhao_at_cs.uno.edu>
Date: Thu, 7 Aug 2003 18:35:08 -0500

I have an element with attributes only and it is contained in another
element:
 <element name="Task">
  <complexType>
   <sequence>
    <element ref="mm:Log"/>
   </sequence>
  </complexType>
 </element>

 <element name="Log" type="mm:LogType">

 <complexType name="LogType">
  <sequence>
   <element ref="mm:TimeStamp" minOccurs="0" maxOccurs="unbounded"/>
  </sequence>
  <attribute name="Task" type="IDREF" use="required"/>
 </complexType>

 <element name="TimeStamp" type="mm:TimeStampType"/>

 <complexType name="TimeStampType">
  <attribute name="Sequence" type="int" use="required"/>
  <attribute name="Time" type="dateTime" use="required"/>
  <attribute name="Status" type="mm:StatusType" use="required"/>
 </complexType>

The element "TimeStamp" is marshalled correctly as a branch of content tree
rooted from "Task".
However, when I try to marshall each TimeStamp as global element, I get
nothing but the xml prolog,
when what I expected is a string like this: <TimeStamp Sequence="0"
Time="2003-08-07T18:27:00-6:00" Status="finished"/>.
For other empty elements in my schema, I observe the same behavior.
The complete schema is available at
http://jacob.chem.uno.edu/schemas/Micromag.xsd for your reference.

----- Original Message -----
From: "Kohsuke Kawaguchi" <Kohsuke.Kawaguchi_at_Sun.COM>
To: <users_at_jaxb.dev.java.net>
Sent: Thursday, August 07, 2003 3:16 PM
Subject: Re: marshalling empty element


>
> > How to marshall an individual empty element (with some attributes)?
>
> Could you elaborate? I'm not sure what the problem is.
>
> regards,
> --
> Kohsuke Kawaguchi 408-276-7063 (x17063)
> 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