users@jaxb.java.net

XJC plus catalog file plus bindings problem

From: Enrico Boldrini <boldra_at_gmail.com>
Date: Wed, 12 Mar 2008 16:58:49 +0100

I am not able to compile schemas using both a catalog file and a binding
file.
Here is the simple project that I'm using:

file schema_b.xsd
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema
    targetNamespace="http://example.org/B"
    xmlns:a="http://example.org/A"
    xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:import namespace="http://example.org/A" schemaLocation="
http://www.xyxyxyyy.com/schema.xsd"/>
    <xs:element name="foobar" type="a:SomeComplexType"/>
</xs:schema>

file others/schema_a.xsd
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema
    targetNamespace="http://example.org/A"
    xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:complexType name="SomeComplexType"/>
</xs:schema>

file bindings.xsd
<?xml version="1.0" encoding="UTF-8"?>
<jxb:bindings version="1.0" xmlns:jxb="http://java.sun.com/xml/ns/jaxb"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    schemaLocation="http://java.sun.com/xml/ns/jaxb
http://java.sun.com/xml/ns/jaxb/bindingschema_1_0.xsd"/>

file catalog.cat
--
    If the <catalog/> parameter isn't working, this link to schema A is
    not recognized and the test will fail because of a missing schema.
--
PUBLIC "http://example.org/A" "others/schema_a.xsd"
This works:
xjc src/main/resources/schema_b.xsd -catalog src/main/resources/catalog.cat
Adding the bindings doesn't work:
xjc src/main/resources/schema_b.xsd -catalog src/main/resources/catalog.cat
-b src/main/resources/bindings.xjb
parsing a schema...
[ERROR] www.xyxyxyyy.com
unknown location
Failed to parse a schema.
Is it a bug?
Best Regards,
Enrico