2013-09-24 52 views
0

我正在嘗試修復JAXB從一組XSD生成類時發生的衝突。這裏的XML:JAXB綁定XPath錯誤

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" ...> 
    ... 
    <xs:simpleType name="List_OfferDimensionUOM"> 
     ... 
    </xs:simpleType> 
</xs:schema> 

和binding.xjb文件:

<jxb:bindings version="1.0" 
    xmlns:jxb="http://java.sun.com/xml/ns/jaxb" 
    xmlns:xs="http://www.w3.org/2001/XMLSchema"> 

    <jxb:bindings schemaLocation="OTA_Lists.xsd" node="/xs:schema"> 
     <jxb:bindings node="xs:simpleType[@name='List_OfferDistanceUOM']"> 
      <jxb:property name="List_OfferDistanceUOMList"/> 
     </jxb:bindings> 
    </jxb:bindings> 
</jxb:bindings> 

我試圖定義的XPath所需的元素的幾個不同的組合,和我不斷收到同樣的錯誤:

compiler was unable to honor this property customization. It is attached to a wrong place, or its inconsistent with other bindings. 

我已經搜索了幾個小時,現在正在尋找答案,並且找到了一點幫助。錯誤消息說它在錯誤的地方沒有意義,因爲我相當肯定我的XPath是有效的。另外,「其他綁定」沒有意義,因爲目前只有一個綁定。

回答

0

我發現了這個問題。這是我在這裏的一個地方。導致我到「List_OfferDimensionUOM」元素的堆棧跟蹤未指向問題的根源。之後的堆棧跟蹤指向正確的元素,並聲明:「這個錯誤與上述提到的」有關。 - _ -