0
我正在写下一些XSD文件,以便在应用程序和SharePoint之间进行webservice通信。我试图让我的参数为“必需”,但即使我将minOccurs设置为1,也可能未指定它们。如何在XSD创建中添加“需要”字段?
我该如何解决这个问题?下面是我的XSD之一:
<?xml version="1.0" encoding="utf-8"?>
<xs:schema id="RemoveGroup"
targetNamespace="http://tempuri.org/RemoveGroup.xsd"
elementFormDefault="qualified"
xmlns="http://tempuri.org/RemoveGroup.xsd"
xmlns:mstns="http://tempuri.org/RemoveGroup.xsd"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
>
<xs:element name="RemoveGroup">
<xs:complexType>
<xs:sequence>
<xs:element name="tt_group_id" type="xs:long" />
<xs:element name="tt_network_id" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
我希望有办法不写下来的houndred “如果(input.Parameter!= NULL)” ...
没有错误......当参数传递为null或未传递时,只是没有错误发生......所以我必须控制我的代码..我已阅读规范并告诉minOccurs =“1”是默认值.. – 2012-02-20 11:46:37
实际上,在一个真实的序列中 - 解析器应该只需要一个元素的实例 – 2012-02-20 12:17:02
请参阅update – 2012-02-20 12:22:20