我有以下xml 文件:
<?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]
有人可以帮忙吗?
答案 0 :(得分:2)
schemaLocation
属性必须包含架构的命名空间和架构定义文件的路径,separated by whitespace。
此外,我不肯定这是一个错误,但我不知道为什么你会在子节点而不是根节点上声明schemaLocation
。