我被提供了一個XSD文件來填充XML中的值,我正在生成提交給Web服務的值。查詢XSD的值?
XSD定義包含註釋和其他信息的枚舉值。最好的描述方法是展示一些XSD。
<?xml version="1.0" encoding="utf-16" ?>
<xs:schema xmlns="http://MyCompany/Schemas" xmlns:b="http://schemas.microsoft.com/BizTalk /2003" elementFormDefault="qualified" targetNamespace="http://MyCompany/Schemas" id="NAICSTypes" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:simpleType name="NAICSType">
<xs:restriction base="xs:int">
<xs:enumeration value="111110">
<xs:annotation>
<xs:appinfo>2007 NAICS Title</xs:appinfo>
<xs:documentation xml:lang="en-us">Soybean Farming</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="111120">
<xs:annotation>
<xs:appinfo>2007 NAICS Title</xs:appinfo>
<xs:documentation xml:lang="en-us">Oilseed (except Soybean) Farming</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="111130">
<xs:annotation>
<xs:appinfo>2007 NAICS Title</xs:appinfo>
<xs:documentation xml:lang="en-us">Dry Pea and Bean Farming</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="111140">
<xs:annotation>
<xs:appinfo>2007 NAICS Title</xs:appinfo>
<xs:documentation xml:lang="en-us">Wheat Farming</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="111150">
<xs:annotation>
<xs:appinfo>2007 NAICS Title</xs:appinfo>
<xs:documentation xml:lang="en-us">Corn Farming</xs:documentation>
</xs:annotation>
</xs:enumeration>
從本質上講,我需要做的是提供一個值,如111150,並取回「玉米農場」在C#
任何建議的結果?
我想,早一點。我收到錯誤「警告:無法生成類,因爲沒有發現複雜類型的頂級元素 」。可能是因爲頂部的「SimpleType」定義。不過謝謝。 – SpaceCowboy74