xml – 元素中命名的复杂类型和匿名复杂类型之间的差异

前端之家收集整理的这篇文章主要介绍了xml – 元素中命名的复杂类型和匿名复杂类型之间的差异前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
有什么区别……

<xsd:element name=”add”>
<xsd:complexType>
    <xsd:sequence>
        <xsd:element name="x" type="xsd:float"/>
        <xsd:element name="y" type="xsd:float"/>
    </xsd:sequence>
</xsd:complexType>
</xsd:element>

和…

<xsd:complexType name=”add”>
    <xsd:sequence>
        <xsd:element name="x" type="xsd:float"/>
        <xsd:element name="y" type="xsd:float"/>
    </xsd:sequence>
</xsd:complexType>

两者都显示为:

<add>
    <x type="xsd:float">1.00</x>
    <y type="xsd:float">2.00</x>
</add>

在SOAP信封中……两个定义之间是否存在明确的区别?

解决方法

嗨,如果此文档在SOAP信封中显示为根元素,则应使用元素类型,而complexType类型不能显示为根元素,它们通常出现在子元素中/不在根元素中.

猜你在找的XML相关文章