2012-07-30 77 views
0

我試圖從PMML 3.0創建C#對象架構使用Xsd2Code(Xsd2Code)(PMML 3.0 Schema),但我得到的是以下錯誤:錯誤轉換PMML的XML Schema(XSD)到C#對象使用Xsd2Code

Error: Multiple definition of element 'http://www.dmg.org/PMML-3_0:Array' causes the content model to become ambiguous. A content model must be formed such that during validation of an element information item sequence, the particle contained directly, indirectly or implicitly therein with which to attempt to validate each item in the sequence in turn can be uniquely determined without examining the content or attributes of that item, and without any information about the items in the remainder of the sequence.

我很確定這個規範是正確的。我也試過VS的xsd.exe,但沒有成功。

是否有任何其他方式來做這種轉換?

感謝您的幫助!

回答

1

我發現這個老問題:XSD sequence shows as abiguous!,所以我檢查了XSD http://www.dmg.org/v3-0/pmml-3-0.xsd,我發現這部分:

<xs:element name="ContStats"> 
    <xs:complexType> 
     <xs:sequence> 
     <xs:element ref="Extension" minOccurs="0" maxOccurs="unbounded" /> 
     <xs:element minOccurs="0" maxOccurs="unbounded" ref="Interval" /> 
     <xs:group minOccurs="0" ref="INT-ARRAY" /> 
     <xs:group minOccurs="0" maxOccurs="2" ref="NUM-ARRAY" /> 
     </xs:sequence> 
     <xs:attribute name="totalValuesSum" type="NUMBER" /> 
     <xs:attribute name="totalSquaresSum" type="NUMBER" /> 
    </xs:complexType> 
    </xs:element> 

就像在我聯繫的問題的答案,如果驗證發現一個陣列」不知道它是INT-ARRAY還是最大的2個NUM-ARRAY之一。

我不知道是否有辦法在不修改xsd的情況下執行此轉換。

+0

謝謝!我將嘗試修改.xsd並查看它是否有效。 – MattheW 2012-07-30 16:59:48