xjc没有为<xsd:any> </xsd:any>生成相应的类成员

时间:2014-03-31 02:00:57

标签: jaxb xjc

以下是我正在使用的架构部分:

<xsd:complexType name="ContentType" mixed="true">
      <xsd:annotation>
         <xsd:documentation><![CDATA[ 
            The content type is a broad base type allowing any content.
         ]]></xsd:documentation>
      </xsd:annotation>
      <xsd:complexContent>
         <xsd:extension base="BaseContentType">
            <xsd:sequence>
               <xsd:any minOccurs="0" maxOccurs="unbounded" namespace="##any" processContents="lax"
               />
            </xsd:sequence>
            <xsd:attribute name="orientation" type="OrientationEnum" use="optional"
               default="portrait">
               <xsd:annotation>
                  <xsd:documentation><![CDATA[
                  The @orientation attribute is used to specify a "landscape" 
                  orientation for the published form. This is primarily used
                  for schedules or for tables.                  
                  ]]></xsd:documentation>
               </xsd:annotation>
            </xsd:attribute>
         </xsd:extension>
      </xsd:complexContent>
   </xsd:complexType>

绑定文件:

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

    <jxb:bindings schemaLocation="../xsd/USLM-1.0.xsd">
        <jxb:bindings
            node="//xsd:group[@name='NoteStructure']">
            <jxb:property name="NoteStructure3" />
        </jxb:bindings>
    </jxb:bindings>


</jxb:bindings>

用于将架构转换为java对象的xjc命令:     xjc -d out -p test -b binding.xml schema.xsd

但为ContentType生成的类并没有任何类成员。生成的类如下:

@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "ContentType")
@XmlSeeAlso({
    HeadingType.class,
    NoteType.class,
    QuotedContentType.class,
    ColumnType.class,
    PType.class
})
public class ContentType
    extends BaseContentType
{

    @XmlAttribute(name = "orientation")
    protected OrientationEnum orientation;

    /**
     * Gets the value of the orientation property.
     * 
     * @return
     *     possible object is
     *     {@link OrientationEnum }
     *     
     */
    public OrientationEnum getOrientation() {
        if (orientation == null) {
            return OrientationEnum.PORTRAIT;
        } else {
            return orientation;
        }
    }

    /**
     * Sets the value of the orientation property.
     * 
     * @param value
     *     allowed object is
     *     {@link OrientationEnum }
     *     
     */
    public void setOrientation(OrientationEnum value) {
        this.orientation = value;
    }

}

我做错了什么?

0 个答案:

没有答案