Results 1 to 1 of 1

Thread: JAXB Binding

  1. #1
    Fusebox is offline Member
    Join Date
    Jun 2010
    Rep Power

    Default JAXB Binding


    I tried to parse a schema using XJC and got the following errors:
    [ERROR] Property "Title" is already defined.
    line 1185 of file:/C:/Users/Lenovo/Desktop/XSD%20Generated%20Java%20Classes/XS

    [ERROR] The following location is relevant to the above error
    line 1227 of file:/C:/Users/Lenovo/Desktop/XSD%20Generated%20Java%20Classes/XS

    [ERROR] Property "MiOrMoOrMn" is already defined.
    line 132 of file:/C:/Users/Lenovo/Desktop/XSD%20Generated%20Java%20Classes/XSD

    [ERROR] The following location is relevant to the above error
    line 138 of file:/C:/Users/Lenovo/Desktop/XSD%20Generated%20Java%20Classes/XSD
    So I read that I should write an external bindings file. The relevant journalpublishing3.xsd snippet is:

    Java Code:
      <xs:element name="bio">
            <xs:element minOccurs="0" ref="sec-meta"/>
            <xs:element minOccurs="0" ref="label"/>
    [B][COLOR="Red"]        <xs:element minOccurs="0" ref="title"/>[/COLOR][/B]
            <xs:choice minOccurs="0" maxOccurs="unbounded">
              <xs:element ref="address"/>
              <xs:element ref="alternatives"/>
              <xs:element ref="array"/>
              <xs:element ref="boxed-text"/>
              <xs:element ref="chem-struct-wrap"/>
              <xs:element ref="fig"/>
              <xs:element ref="fig-group"/>
              <xs:element ref="graphic"/>
              <xs:element ref="media"/>
              <xs:element ref="preformat"/>
              <xs:element ref="supplementary-material"/>
              <xs:element ref="table-wrap"/>
              <xs:element ref="table-wrap-group"/>
              <xs:element ref="disp-formula"/>
              <xs:element ref="disp-formula-group"/>
              <xs:element ref="p"/>
              <xs:element ref="def-list"/>
              <xs:element ref="list"/>
              <xs:element ref="tex-math"/>
              <xs:element ref="mml:math"/>
              <xs:element ref="related-article"/>
              <xs:element ref="related-object"/>
              <xs:element ref="disp-quote"/>
              <xs:element ref="speech"/>
              <xs:element ref="statement"/>
              <xs:element ref="verse-group"/>
            <xs:element minOccurs="0" maxOccurs="unbounded" ref="sec"/>
            <xs:choice minOccurs="0" maxOccurs="unbounded">
              <xs:element ref="fn-group"/>
              <xs:element ref="glossary"/>
              <xs:element ref="ref-list"/>
          <xs:attribute name="id" type="xs:ID"/>
          <xs:attribute name="rid" type="xs:IDREFS"/>
          <xs:attribute name="content-type"/>
          <xs:attribute name="specific-use"/><xs:attribute ref="xlink:type"/>
          <xs:attribute ref="xlink:href"/>
          <xs:attribute ref="xlink:role"/>
    [COLOR="Red"][B]      <xs:attribute ref="xlink:title"/>[/B][/COLOR]
          <xs:attribute ref="xlink:show"/>
          <xs:attribute ref="xlink:actuate"/>
    Where I've denoted the relevant lines in red.

    I'm not quite sure why the XJC compiler thinks that "xlink:title" and "title" are the same, but I'm assuming it has something to do with the colon being a break character. There is a schema included with the zip I dowloaded called "xlink.xsd" Is the compiler missing the reference to the external file? That would be strange since journalpublishing3.xsd includes a declaration:

    Java Code:
     <xs:import namespace="" schemaLocation="xlink.xsd"/>
    My question is: If I write an external binding to change the ref property for one of these, will I have to change the original name that these are a reference to, and will I have to change all the references to it as well? How do I go about fixing these errors?
    Last edited by Fusebox; 06-11-2010 at 11:46 PM.

Similar Threads

  1. Replies: 0
    Last Post: 05-04-2010, 11:10 PM
  2. Jaxb
    By Paul Richards in forum XML
    Replies: 1
    Last Post: 08-03-2009, 10:56 PM
  3. JAXB Marshalling
    By akbar4ums in forum XML
    Replies: 1
    Last Post: 12-20-2008, 05:39 AM
  4. Custom XML to Java Type Binding using JAXB
    By surajkumar in forum XML
    Replies: 0
    Last Post: 09-02-2008, 01:32 PM
  5. JAXB Unmarshalling
    By prateek in forum XML
    Replies: 0
    Last Post: 07-10-2008, 07:53 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts