Results 1 to 2 of 2
  1. #1
    mafyou is offline Member
    Join Date
    Feb 2012
    Posts
    10
    Rep Power
    0

    Default JAXB type help!!!

    Hi all, I really need some help here... I'm creating a schema at the moment and I'm stuck in defining custom classes. So take the code down below:

    Java Code:
    <?xml version="1.0" encoding="UTF-8"?>
    
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    			xmlns:geo="http://geoEditor"
                xmlns:jxb="http://java.sun.com/xml/ns/jaxb"
                jxb:version="2.0">                           
                
    <xsd:element name="case" type="Case"/>
    
    <xsd:complexType name="Case">
    
      <xsd:sequence>
        <xsd:element name="planType" type="xsd:string"/>
        <xsd:element name="positions" type="xsd:string"
        			maxOccurs="unbounded"/>
      </xsd:sequence>
      
    
    </xsd:complexType>
    
    </xsd:schema>
    I want the positions element to be of type "PositionType". Position type is defined in the geo.xsd. How do I make it so I can do the type="geo:PositionType" so that it will show up in the Java file that positions is of type PositionType...

  2. #2
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,450
    Rep Power
    18

    Default Re: JAXB type help!!!

    You've already given an xmlns for 'geo', so just change the type of positions.
    Please do not ask for code as refusal often offends.

Similar Threads

  1. Replies: 4
    Last Post: 08-01-2011, 10:29 AM
  2. jaxb and xml exstenstion
    By Daniela in forum XML
    Replies: 0
    Last Post: 07-28-2011, 06:41 PM
  3. Jaxb
    By Paul Richards in forum XML
    Replies: 1
    Last Post: 08-03-2009, 09:56 PM
  4. JAXB Marshalling
    By akbar4ums in forum XML
    Replies: 1
    Last Post: 12-20-2008, 04:39 AM
  5. Custom XML to Java Type Binding using JAXB
    By surajkumar in forum XML
    Replies: 0
    Last Post: 09-02-2008, 12:32 PM

Posting Permissions

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