users@jaxb.java.net

trouble editing xjb file in eclipse. does not not about jaxb and xjc types.

From: Andy Davidson <andy_davidson_at_apple.com>
Date: Wed, 30 May 2012 08:30:39 -0700

Hi

I started working on a project that uses an xjb bind file. It looks like this file was written a long time ago and has some bugs. I am using eclipse

The original file starts out with

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<jaxb:bindings version="2.0"
        targetNamespace="http://www.apple.com/ist/retail/pos/common/pojo"
            xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
        xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc"
            xmlns:xs="http://www.w3.org/2001/XMLSchema"
        xmlns:pos="http://www.Apple.com/LAVA"
        jaxb:extensionBindingPrefixes="xjc">

        <jaxb:
                <jaxb:globalBindings>
                        <xjc:simple />
                        <xjc:serializable uid="-1" />
                </jaxb:globalBindings>


eclipse has no knowledge about the jaxb types.

How should I convert the file so that eclipse is able to validate it?

I found a couple of example that looked sort of like

    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
           xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
         xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc" jaxb:extensionBindingPrefixes="xjc" jaxb:version="2.0"
                 targetNamespace="http://www.apple.com/ist/retail/pos/common/pojo"
                   xmlns:pos="http://www.Apple.com/LAVA">
                   

eclipse still has no knowledge about the jaxb types. I assume I need to add a schemaLocation attribute. What should the value be?

I am not sure how to set the schemaLocation. I tried adding a xsi:schemaLocation attribute

                   xsi:schemaLocation="http://java.sun.com/xml/ns/jaxb http://java.sun.com/xml/ns/jaxb/bindingschema_2_0.xsd"

I also tried adding an import tag.
                <xs:import namespace="http://java.sun.com/xml/ns/jaxb" schemaLocation="http://java.sun.com/xml/ns/jaxb/bindingschema_2_0.xsd" />

Still did not work.

I have a similar problem with the xjc types.

Any suggestions would be greatly appreciated.

Andy