【发布时间】:2012-03-30 13:35:32
【问题描述】:
我在http://msdn.microsoft.com/en-us/library/ms996486.aspx 上发现了这篇关于 WSDL 的非常有用的文章,正如某处另一篇文章中关于 SO 所推荐的那样。
不过,我想知道,如果这个例子没有错误。
这是(简化的)架构:
<xs:schema
targetNamespace="http://example.org/math/types/"
xmlns="http://example.org/math/types/"
>
<xs:complexType name="MathInput">
<xs:sequence>
<xs:element name="x" type="xs:double"/>
<xs:element name="y" type="xs:double"/>
</xs:sequence>
</xs:complexType>
<xs:element name="Add" type="MathInput"/>
</xs:schema>
这是实例(包含在 SOAP 中):
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
>
<SOAP-ENV:Body>
<m:Add xmlns:m="http://example.org/math/types/">
<x>3.14159265358979</x>
<y>3.14159265358979</y>
</m:Add>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
我的不确定性在于
[更新] XML 实例是否会根据给定的 Schema 进行验证?
【问题讨论】:
标签: xml validation namespaces xsd prefix