我在从 XSD 自动生成的类中收到此错误“没有与此类关联的 XML 类型的文本内容。JAXB 问题”。你知道发生了什么吗?
源代码
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "linkType", propOrder = {
"content"
})
public class LinkType {
@XmlValue **THIS LINE HAS THE ERROR**
protected String content;
XSD
<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>
BR。