-1

我正在使用 JAXB 解析我的 xml 架构(xsd)。我有一个 complexType 如下:

<xsd:complexType name="PromotionalInfo">
    <xsd:attribute name="promotionName" type="xsd:string" use="required"/>
    <xsd:attribute name="blackOutDates" type="DateList"/>
    <xsd:attribute name="amount" type="xsd:float" use="required"/>
    <xsd:attribute name="endDate" type="com:Date"/>
    <xsd:attribute name="startDate" type="com:Date"/>
    <xsd:attribute name="purchaseEndDate" type="com:Date"/>
    <xsd:attribute name="purchaseStartDate" type="com:Date"/>
    <xsd:attribute name="promoType" type="xsd:string" use="required"/>
    <xsd:attribute name="shortMarketingText" type="FiftyLimString" use="required"/>
    <xsd:attribute name="numNightsRequired" type="xsd:int"/>
    <xsd:attribute name="numNightsFree" type="xsd:int"/>
    <xsd:attribute name="termsAndConditions" type="ThousandLimString"/>
    <xsd:attribute name="customerFulfillmentRequirements" type="ThousandLimString"/>
</xsd:complexType>

<xsd:simpleType name="DateList" id="DateList">
    <xsd:list itemType="com:Date"/>
</xsd:simpleType>

现在的问题是,Jaxb 正在创建的我的 PromotionInfo 类具有 List 类型而不是 List 类型的 DateList 对象。有谁知道这是否是 JAXB 编译器中的错误,如果是,那么在我的情况下是否有解决方法?

谢谢!

4

1 回答 1

0

我通过查看bindingSchema.xsd发现对于 xs:list 我们的类型不能是 xsd:date 类型。

于 2009-06-10T21:52:12.310 回答