2014-02-27 19 views
3

我有以下XML文件XML命名空間問題與XJB綁定文件

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

但是我總是在XML驗證以下錯誤:

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

任何人都可以請幫助?

+1

模式是什麼樣的? – keshlam

回答

2

schemaLocation屬性必須包含您的模式的命名空間和路徑模式定義文件separated by whitespace

此外,我不是積極的這是一個錯誤,但我不知道爲什麼你會聲明子節點schemaLocation而不是根。