Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/281.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/xml/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
我怎样才能改变简单<;元素>;至<;元素>;在C#中有限制?_C#_Xml_Xsd - Fatal编程技术网

我怎样才能改变简单<;元素>;至<;元素>;在C#中有限制?

我怎样才能改变简单<;元素>;至<;元素>;在C#中有限制?,c#,xml,xsd,C#,Xml,Xsd,我有这样的XSD: <xs:complexType> <xs:sequence> <xs:element name="A" type="xs:string" minOccurs="0" /> <xs:element name="B" type="xs:string" minOccurs="0" /> <xs:element name="C" type="xs:string" minOccurs=

我有这样的XSD:

<xs:complexType>
   <xs:sequence>
       <xs:element name="A" type="xs:string" minOccurs="0" />
       <xs:element name="B" type="xs:string" minOccurs="0" />
       <xs:element name="C" type="xs:string" minOccurs="0" />
       <xs:element name="D" type="xs:string" minOccurs="0" />
        <xs:element name="A">
            <xs:simpleType>
                <xs:restriction base="xs:int">
                    <xs:minInclusive value="0"/>
                        <xs:maxInclusive value="24"/>
                    </xs:restriction>
                </xs:simpleType>
            </xs:element>
            <xs:element name="B">
                <xs:simpleType>
                    <xs:restriction base="xs:string">
                        <xs:maxLength value="40"/>
                        <xs:minLength value="1"/>
                    </xs:restriction>
                </xs:simpleType>
            </xs:element>

如何找到name=“A”的xs:element?(一)

然后以编程方式向其添加限制(2)

像这样:

<xs:complexType>
   <xs:sequence>
       <xs:element name="A" type="xs:string" minOccurs="0" />
       <xs:element name="B" type="xs:string" minOccurs="0" />
       <xs:element name="C" type="xs:string" minOccurs="0" />
       <xs:element name="D" type="xs:string" minOccurs="0" />
        <xs:element name="A">
            <xs:simpleType>
                <xs:restriction base="xs:int">
                    <xs:minInclusive value="0"/>
                        <xs:maxInclusive value="24"/>
                    </xs:restriction>
                </xs:simpleType>
            </xs:element>
            <xs:element name="B">
                <xs:simpleType>
                    <xs:restriction base="xs:string">
                        <xs:maxLength value="40"/>
                        <xs:minLength value="1"/>
                    </xs:restriction>
                </xs:simpleType>
            </xs:element>

我有一些XSD文件,其中的元素必须重写并使用新类型和相关限制进行更正,所以我需要首先找到元素,然后用正确的数据替换

有人能帮我怎么用C写吗