Java JAXB库:没有与此类关联的XML类型的文本内容

Java JAXB库:没有与此类关联的XML类型的文本内容,java,xml,jaxb,Java,Xml,Jaxb,在从XSD自动生成的类中,我得到了这样一个错误“没有与这个class.JAXB问题相关联的XML类型的文本内容”。你知道发生了什么事吗 源代码 XSD Atom链接构造在格式规范的第3.4节中定义。 BR.您看到的错误消息是Eclipse验证异常: 没有与此类关联的XML类型的文本内容 您可以忽略此异常,因为它是编辑器异常而不是编译器异常:尝试生成一个xml与xsd进行比较,以了解内容是什么?我认为JAXB无法生成XSD中未定义的变量。我这样做了,结果类似乎是正确的。事实上,在另一台PC上,

在从XSD自动生成的类中,我得到了这样一个错误“没有与这个class.JAXB问题相关联的XML类型的文本内容”。你知道发生了什么事吗

源代码

XSD


Atom链接构造在格式规范的第3.4节中定义。

BR.

您看到的错误消息是Eclipse验证异常:

没有与此类关联的XML类型的文本内容


您可以忽略此异常,因为它是编辑器异常而不是编译器异常:

尝试生成一个xml与xsd进行比较,以了解内容是什么?我认为JAXB无法生成XSD中未定义的变量。我这样做了,结果类似乎是正确的。事实上,在另一台PC上,同一个工作区没有出现此错误。我曾尝试使用较低版本的Eclipse(Indigo而不是Juno),但现在我没有出现此错误,所以我认为您是对的,这只是编辑器的一个例外。谢谢
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "linkType", propOrder = {
    "content"
})
public class LinkType {
    @XmlValue **THIS LINE HAS THE ERROR**
    protected String content;
<xs:complexType name="linkType" mixed="true">
    <xs:annotation>
        <xs:documentation>
            The Atom link construct is defined in section 3.4 of the format spec.
        </xs:documentation>
    </xs:annotation>
    <xs:attribute name="href" use="required" type="xs:anyURI"/>
    <xs:attribute name="rel" type="xs:string" use="optional"/>
    <xs:attribute name="type" use="optional" type="xs:string"/>
    <xs:attribute name="hreflang" use="optional" type="xs:NMTOKEN"/>
    <xs:attribute name="title" use="optional" type="xs:string"/>
    <xs:attribute name="length" use="optional" type="xs:positiveInteger"/>
    <xs:attributeGroup ref="atom:commonAttributes"/>
</xs:complexType>