2013-07-29 30 views
1

我已经编写了一个.xsd模式(以下),与雅虎的YQL yahoo.finance.quote table 一起使用。但是当我使用XJC到架构中我碰到下面的错误绑定:JAXB绑定错误,“内容必须匹配...?”

[ERROR] s4s-elt-must-match.1: The content of 'query' must match (annotation?, (simpleType | complexType)?, (unique | key | keyref)*)). A problem was found starting at: attribute. 
    line 35 of file: 

这里是玛:

<?xml version="1.0" encoding="UTF-8"?> 

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:yahoo="http://www.yahooapis.com/v1/base.rng"> 
    <xsd:element name="query"> 
    <xsd:complexType> 
     <xsd:sequence> 
     <xsd:element name="results" minOccurs="0" maxOccurs="1"> 
      <xsd:complexType> 
      <xsd:sequence> 
       <xsd:element name="quote" minOccurs="0" maxOccurs="unbounded"> 
       <xsd:complexType> 
        <xsd:sequence> 
        <xsd:element name="AverageDailyVolume" minOccurs="0" maxOccurs="1" type="xsd:int"/> 
        <xsd:element name="Change" minOccurs="0" maxOccurs="1" type="xsd:decimal"/> 
        <xsd:element name="DaysLow" minOccurs="0" maxOccurs="1" type="xsd:decimal"/> 
        <xsd:element name="DaysHigh" minOccurs="0" maxOccurs="1" type="xsd:decimal"/> 
        <xsd:element name="YearLow" minOccurs="0" maxOccurs="1" type="xsd:decimal"/> 
        <xsd:element name="YearHigh" minOccurs="0" maxOccurs="1" type="xsd:decimal"/> 
        <xsd:element name="MarketCapitalization" minOccurs="0" maxOccurs="1" type="xsd:normalizedString"/> 
        <xsd:element name="LastTradePriceOnly" minOccurs="0" maxOccurs="1" type="xsd:decimal"/> 
        <xsd:element name="DaysRange" minOccurs="0" maxOccurs="1" type="xsd:string"/> 
        <xsd:element name="Name" minOccurs="0" maxOccurs="1" type="xsd:string"/> 
        <xsd:element name="Symbol" minOccurs="0" maxOccurs="1" type="xsd:normalizedString"/> 
        <xsd:element name="Volume" minOccurs="0" maxOccurs="1" type="xsd:int"/> 
        <xsd:element name="StockExchange" minOccurs="0" maxOccurs="1" type="xsd:normalizedString"/> 
        </xsd:sequence> 
        <xsd:attribute name="symbol" type="xsd:normalizedString" use="required"/> 
       </xsd:complexType> 
       </xsd:element> 
      </xsd:sequence> 
      </xsd:complexType> 
     </xsd:element> 
     </xsd:sequence> 
     <xsd:attribute name="count" type="xsd:int" use="required"/> 
     <xsd:attribute name="created" type="xsd:normalizedString" use="required"/> 
     <xsd:attribute name="lang" type="xsd:normalizedString" use="required"/> 
    </xsd:complexType> 
    </xsd:element> 
</xsd:schema> 

任何人都可以,请给我解释一下什么是错误。特别是和/或纠正手段它?谢谢。

回答

2

我会想象这个问题是你在“complexType”定义之外复制的3个属性(count,created,lang)(在文件底部)。

+0

哎呀应该使用复制粘贴,对不起,实际文件只包含这些属性一次。我会在我的问题中解决这个问题。 – MCMeyersman

相关问题