Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

XML namespace issue with xjb binding file

I have the following xml file:

<?xml version="1.0" encoding="UTF-8"?>
<bindings xmlns="http://java.sun.com/xml/ns/jaxb" 
          xmlns:xs="http://www.w3.org/2001/XMLSchema" 
          targetNamespace="http://java.sun.com/xml/ns/jaxb"
          version="2.1">
    <bindings xs:schemaLocation="Inbound.wsdl#wsdl:types" node="/schema">
        <bindings node="//complexType[@name='TradeIdWithRef']">
            <bindings node=".//attribute[@name='_value']">
                <property name="ValueAttribute"/>
            </bindings>
        </bindings>
        <bindings node="//complexType[@name='Bank']">
            <bindings node=".//attribute[@name='_value']">
                <property name="ValueAttribute"/>
            </bindings>
        </bindings>
        <bindings node="//complexType[@name='Bid']">
            <bindings node=".//attribute[@name='_value']">
                <property name="ValueAttribute"/>
            </bindings>
        </bindings>
        <bindings node="//complexType[@name='addMarketExRequest']">
            <bindings node=".//attribute[@name='_value']">
                <property name="ValueAttribute"/>
            </bindings>
        </bindings>
        <bindings node="//complexType[@name='Offer']">
            <bindings node=".//attribute[@name='_value']">
                <property name="ValueAttribute"/>
            </bindings>
        </bindings>
        <bindings node="//complexType[@name='Price']">
            <bindings node=".//attribute[@name='_value']">
                <property name="ValueAttribute"/>
            </bindings>
        </bindings>
        <bindings node="//complexType[@name='Delta']">
            <bindings node=".//attribute[@name='_value']">
                <property name="ValueAttribute"/>
            </bindings>
        </bindings>
    </bindings>
</bindings>

However I always get the following error upon xml validation:

cvc-elt.1: Cannot find the declaration of element 'bindings'. [5]

Can anyone please help?

like image 888
balteo Avatar asked Oct 21 '22 13:10

balteo


1 Answers

The schemaLocation attribute must contain the namespace of your schema and the path to the schema definition file, separated by whitespace.

Also, I'm not positive it's an error, but I don't know why you would declare schemaLocation on a child node instead of the root.

like image 186
Alex Wittig Avatar answered Oct 23 '22 04:10

Alex Wittig