users@jaxb.java.net

Marhalling ingores top level element and creates invalid XML

From: <Brian.Scott_at_mainline.com>
Date: Wed, 7 Jan 2004 11:32:52 -0500

Hello friends. I have encountered a situation wherein after creating a
jaxb created object and marshall it, the resultant XML does not include the
first tag of the definition. Taking the output and trying to unmarshall it
throws an exception with the not unexpected claim that 'unexpected root
element . . . . '. I'm attaching my .xsd and the XML that is created at
marshall time. In fact, I can validate the object before marshalling and
not have an exception thrown, but the XML returned is not well formed.
Can anyone help?

Thank you!

.XSD file:

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:globals="
http://my.client/globals" elementFormDefault="unqualified"
attributeFormDefault="unqualified">
  <xs:import namespace="http://my.client/globals" schemaLocation="
http://my.client/schemas/globals.xsd"/>
  <xs:element name="alertControlCenterOfOutage">
     <xs:complexType>
       <xs:sequence>
          <xs:element name="transactionId" type="globals:transactionId"/>
          <xs:element name="accountId" type="globals:relaxedAccountId"/>
          <xs:element name="address" type="xs:string" nillable="true"/>
          <xs:element name="zipCode" type="globals:zipCode"/>
          <xs:element name="phoneNumber" type="globals:phoneNumber"/>
          <xs:element name="accountStatus" type="xs:string"/>
          <xs:element name="customerName" type="xs:string"/>
          <xs:element name="premiseId" type="globals:relaxedPremiseId"/>
          <xs:element name="meterNumber" type="xs:string"/>
          <xs:element name="servicePoint" type="xs:string"/>
          <xs:element name="gisServicePointId" type="xs:normalizedString"/>
       </xs:sequence>
     </xs:complexType>
  </xs:element>
</xs:schema>

XML Provided at marshalling time:

<transactionId>0205210089</transactionId>
<accountId>012312312</accountId>
<address>123 Main Street</address>
<zipCode>99999</zipCode>
<phoneNumber>3231231233</phoneNumber>
<accountStatus/>
<customerName>person, general</customerName>
<premiseId>210391239</premiseId>
<meterNumber>8932610</meterNumber>
<cisServicePoint>9724519</cisServicePoint>
<gisServicePointId/>




This e-mail and files transmitted with it are confidential, and are
intended solely for the use of the individual or entity to whom this e-mail
is addressed. If you are not the intended recipient, or the employee or
agent responsible to deliver it to the intended recipient, you are hereby
notified that any dissemination, distribution or copying of this
communication is strictly prohibited. If you are not one of the named
recipient(s) or otherwise have reason to believe that you received this
message in error, please immediately notify sender by e-mail, and destroy
the original message. Thank You.




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
For additional commands, e-mail: users-help_at_jaxb.dev.java.net