我使用JAXB注释和schemagenmaven插件来创建xsd。我需要用wsdl2py处理xsd来创建Python的客户机。但是当我在类中继承时,schemagen创建了这样的东西:
<xs:complexType name="b">
<xs:complexContent>
<xs:extension base="a">
<xs:sequence>
<xs:element name="field1" type="xs:string"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
对于班级:
^{pr2}$问题是wsdl2py不理解xs:complexContent和xs:extension。所以我希望生成没有继承的xsd。在
提前谢谢
这是
wsdl2py
而不是JAXB的一个缺点,但是使用XSLT或XQuery很容易修复。快速尝试在XSLT中修复此问题:注意:这只适用于扩展,而不是限制,并且使用了一个
wsdl2py
可能支持也可能不支持的嵌套序列(应该很容易修复)。 目前,它只支持内容模型,但是可以很容易地扩展到复制属性和属性组。在而且,样式表只在扩展元素与基元素在同一个模式文件中时才起作用。在
祝你好运!在
相关问题 更多 >
编程相关推荐