Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

JAXB xsd error

teachMySelfSep 10 2014 — edited Sep 29 2014

I am trying to create JAXB project. I have a schema file for a XML. I am getting several errors in the schema (xsd) file because of the way the xml structure.

One of my xml file elemnets is as follows.

<m:properties>

    <d:Id m:type="Edm.Int32">19</d:Id>

</m:properties>

and corresponding xsd is as follows.

<xs:element name="m:properties">

    <xs:complexType>

       <xs:sequence>

         <xs:element name="d:Id" type="xs:int">

               <xs:complexType>

                 <xs:attribute name="m:type" type="xs:string"></xs:attribute>

               </xs:complexType>

         </xs:element>

        </xs:sequence>

      </xs:complexType>

</xs:element>

Now since, this the tag/attribute names contain ":", I get following errors. And I am not able to compile my code.

Multiple annotations found at this line:

    - s4s-elt-invalid-content.1: The content of '#AnonType_d:UserIdm:propertiescontententryfeed' is invalid.

     Element 'attribute' is invalid, misplaced, or occurs too often.

    - s4s-att-invalid-value: Invalid attribute value for 'name' in element 'attribute'. Recorded reason: cvc-

     datatype-valid.1.2.1: 'm:type' is not a valid value for 'NCName'.

    - src-attribute.3.1: One of 'ref' or 'name' must be present in a local attribute declaration.

   

Can some one help me here.

Thanks

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 27 2014
Added on Sep 10 2014
4 comments
2,690 views