Wow... that's a fast reply... I changed the schema to add minOccurs="0" and now it works perfectly... thank you!
Aleks El jue, 08-12-2005 a las 13:28 -0800, Ramesh Bobba escribió: > The defaults are 1 and 1 not 0 and 1 > > Regards, > > Ramesh K Bobba > Sr. Software Engineer > Transera Communications Inc. > 10101 N. DeAnza Blvd., Suite 100 > Cupertino, CA 95014 > (w)408.873.1984x108 > (f)408.873.7412 > (c)510.579.0001 > > -----Original Message----- > From: AMIE project developers [mailto:[EMAIL PROTECTED] > Sent: Thursday, December 08, 2005 1:22 PM > To: [email protected] > Subject: javax.xml.bind.UnmarshalException: Unexpected end element > > Hi all, > > I am using JaxMe for a web application, and when I was trying to > unmarshall the contents of an XML file into a Java Object, I get this > exception: > javax.xml.bind.UnmarshalException: Unexpected end element: > '{http://amie/system/common/generated/usersSchema}User' > > Any ideas? I don't really know if it's because the XML does not contain > all the fields specified in the schema... the default values are > minOccurs="0" and maxOccurs="1", aren't they? > > I am sure that it will be some stupid thing I forgot... but I have been > dealing with it for hours... > > Thank you in advance for your reply! > > Aleks > > > > Well, this is my XML file... > <Users xmlns='http://amie/system/common/generated/usersSchema' > xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'> > <User> > <shortname>admin</shortname> > <password></password> > </User> > </Users> > > > > And this is the schema... > --------------------------------------------------------------------- > <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" > xmlns:ns="http://amie/system/common/generated/usersSchema" > > targetNamespace="http://amie/system/common/generated/usersSchema" > elementFormDefault="qualified"> > > > <xsd:element name="Users" type="ns:UserListType"> > <xsd:unique name="Users-uniqueness"> > <xsd:selector xpath="ns:User"/> > <xsd:field xpath="ns:shortname"/> > </xsd:unique> > </xsd:element> > > <xsd:complexType name="UserListType"> > <xsd:sequence> > <xsd:element name="User" type="ns:UserType" > maxOccurs="unbounded"/> > </xsd:sequence> > </xsd:complexType> > > <xsd:complexType name="UserType"> > <xsd:sequence> > <xsd:element name="shortname" type="xsd:string" > minOccurs="1"/> > <xsd:element name="password" type="xsd:string" > minOccurs="1"/> > <xsd:element name="fullname" type="xsd:string"/> > <xsd:element name="email" type="xsd:string" > maxOccurs="unbounded"/> > <xsd:element name="privileges" type="ns:UserPrivileges" > maxOccurs="unbounded"/> > </xsd:sequence> > </xsd:complexType> > > <xsd:complexType name="UserPrivileges"> > <xsd:sequence> > <xsd:element name="appId" type="xsd:string" minOccurs="1"/> > <xsd:element name="level" type="xsd:string" minOccurs="1"/> > </xsd:sequence> > </xsd:complexType> > > </xsd:schema> > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
