users@jaxb.java.net

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

From: Wolfgang Laun <wolfgang.laun_at_gmail.com>
Date: Wed, 30 May 2012 19:13:52 +0200

On 30/05/2012, Andy Davidson <andy_davidson_at_apple.com> wrote:
> 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.

What makes you think so? Please provide xjc version, error messages,
source file?

> 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>
>

Hardly, this isn't even well formed up to the truncated end.

>
> eclipse has no knowledge about the jaxb types.

There are no JAXB types. Do you mean the XML schema for JAXB binding
files? If so, why should Eclipse have any knowledge about it?

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

Do you have an XML Schema aware plugin for handling XML files?
Otherwise, just rely on xjc to find the errors. The diagnostics are
(most of the time) sufficient.


>
> 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"

The second URL looks good.

>
> 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.

What did not work?

>
> I have a similar problem with the xjc types.

There's no such thing, or, rather, what do you think that "xjc types" are?

-W

>
> Any suggestions would be greatly appreciated.
>
> Andy
>
>
>