本文介绍了Dataset.WriteXmlSchema没有扩展的属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Dataset.WriteXmlSchema保存数据集的架构.

我正在得到这样的结果

<?xml version ="1.0" ; standalone =是"?>
< xs chema id = "NewDataSet"; xmlns =" xmlns:xs ="http://www.w3.org/2001/XMLSchema" xmlns:msdata =" urn chemas-microsoft-com :xml-msdata>
< xs:element name ="" NewDataSet" msdata:IsDataSet ="true". msdata:UseCurrentLocale ="true">
<xs:complexType> <br> <xs:choice minOccurs ="0". maxOccurs =无界">
xs:element name =客户"> xs equence>
< xs:element name =< OwnerTitle" type =" xs tring"minOccurs ="0". />
< xs:element name =" OwnerName" type =" xs tring"minOccurs ="0". />
< xs:element name =" VIN" type =" xs tring"minOccurs ="0". />
< xs:element name ="InitialMailingSent"; type =" xs tring"minOccurs ="0". />
< xs:element name ="ResponseReceived" type =" xs tring"minOccurs ="0". />
< xs:element name ="IgnoreDate" type =" xs tring"minOccurs ="0". />
< xs:element name ="RTSDate" type =" xs tring"minOccurs ="0". />
< xs:element name ="AmendDate" type =" xs tring"minOccurs ="0". />
< xs:element name ="RecontactDate" type =" xs tring"minOccurs ="0". />
< xs:element name =" ReContact" type =" xs tring"minOccurs ="0". />
< xs:element name =" CommentMailingSent"; type =" xs tring"minOccurs ="0". />
< xs:element name =" NoContactDate" type =" xs tring"minOccurs ="0". />
< xs:element name =  NoQuestionnaireDate" type =" xs tring"minOccurs ="0". />
< xs:element name =" NoPromoDate" type =" xs tring"minOccurs ="0". />
< xs:element name =" OwnerCompanyName" ;; type =" xs tring"minOccurs ="0". />
< xs:element name =" CompanyPositionDepartment" type =" xs tring"minOccurs ="0". />
< xs:element name =" OwnerAddr1" type =" xs tring"minOccurs ="0". />
< xs:element name =" OwnerAddr2" type =" xs tring"minOccurs ="0". />
< xs:element name ='State' type =" xs tring"minOccurs ="0". />
< xs:element name =" Ownerpostcode" type =" xs tring"minOccurs ="0". />
< xs:element name =" ContactPhone" type =" xs tring"minOccurs ="0". />
< xs:element name =" ContactFax" type =" xs tring"minOccurs ="0". />
< xs:element name =" ContactMobile" type =" xs tring"minOccurs ="0". />
< xs:element name =" ContactEmail" type =" xs tring"minOccurs ="0". />
< xs:element name ="RegistrationNo" type =" xs tring"minOccurs ="0". />
< xs:element name ="URN" type =" xs tring"minOccurs ="0". />
< xs:element name =" FirstName" type =" xs tring"minOccurs ="0". />
< xs:element name ="LastName" type =" xs tring"minOccurs ="0". />
< xs:element name ='Source' type =" xs tring"minOccurs ="0". />
< xs:element name =" SourceId" type =" xs tring"minOccurs ="0". />
< xs:element name =" FileType" type =" xs tring"minOccurs ="0". />
< xs:element name =" FileSeqNo" type =" xs tring"minOccurs ="0". />
< xs:element name ="Country" type =" xs tring"minOccurs ="0". />
</xs equence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
</xs:element>
</xs chema>

上面的结果没有任何扩展属性,例如注释,限制,出现等...

我想要一个像下面这样的结果

(下面只有一个记录用于示例)

<?xml version ="1.0" encoding ="UTF-8"?>
< xsd chema xmlns:xsd =" http://www.w3.org/2001/XMLSchema>
< xsd impleType name = 组织的Name2">
< xsd:annotation>
< xsd 文档xml:lang =" EN>机构名称2</xsd ocumentation>
</xsd:annotation>
< xsd:restriction base =""xsd tring"<< xsd:maxLength value ="8"/>
< xsd:whiteSpace value ="preserve"固定="true"/>
</xsd:restriction>
</xsd impleType>


我应该怎么办?数据集中要进行的任何更改?

我在哪里缺少??????
I was saving the schema of a dataset using Dataset.WriteXmlSchema.

I am getting the result like this

<?xml version="1.0" standalone="yes"?>
<xschema id="NewDataSet" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urnchemas-microsoft-com:xml-msdata">
<xs:element name="NewDataSet" msdata:IsDataSet="true" msdata:UseCurrentLocale="true">
<xs:complexType>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="Customers">
<xs:complexType>
<xsequence>
<xs:element name="OwnerTitle" type="xstring" minOccurs="0" />
<xs:element name="OwnerName" type="xstring" minOccurs="0" />
<xs:element name="VIN" type="xstring" minOccurs="0" />
<xs:element name="InitialMailingSent" type="xstring" minOccurs="0" />
<xs:element name="ResponseReceived" type="xstring" minOccurs="0" />
<xs:element name="IgnoreDate" type="xstring" minOccurs="0" />
<xs:element name="RTSDate" type="xstring" minOccurs="0" />
<xs:element name="AmendDate" type="xstring" minOccurs="0" />
<xs:element name="RecontactDate" type="xstring" minOccurs="0" />
<xs:element name="ReContact" type="xstring" minOccurs="0" />
<xs:element name="CommentMailingSent" type="xstring" minOccurs="0" />
<xs:element name="NoContactDate" type="xstring" minOccurs="0" />
<xs:element name="NoQuestionnaireDate" type="xstring" minOccurs="0" />
<xs:element name="NoPromoDate" type="xstring" minOccurs="0" />
<xs:element name="OwnerCompanyName" type="xstring" minOccurs="0" />
<xs:element name="CompanyPositionDepartment" type="xstring" minOccurs="0" />
<xs:element name="OwnerAddr1" type="xstring" minOccurs="0" />
<xs:element name="OwnerAddr2" type="xstring" minOccurs="0" />
<xs:element name="State" type="xstring" minOccurs="0" />
<xs:element name="Ownerpostcode" type="xstring" minOccurs="0" />
<xs:element name="ContactPhone" type="xstring" minOccurs="0" />
<xs:element name="ContactFax" type="xstring" minOccurs="0" />
<xs:element name="ContactMobile" type="xstring" minOccurs="0" />
<xs:element name="ContactEmail" type="xstring" minOccurs="0" />
<xs:element name="RegistrationNo" type="xstring" minOccurs="0" />
<xs:element name="URN" type="xstring" minOccurs="0" />
<xs:element name="FirstName" type="xstring" minOccurs="0" />
<xs:element name="LastName" type="xstring" minOccurs="0" />
<xs:element name="Source" type="xstring" minOccurs="0" />
<xs:element name="SourceId" type="xstring" minOccurs="0" />
<xs:element name="FileType" type="xstring" minOccurs="0" />
<xs:element name="FileSeqNo" type="xstring" minOccurs="0" />
<xs:element name="Country" type="xstring" minOccurs="0" />
</xsequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
</xs:element>
</xschema>

The above result doesn't have any extended properties like Annotation, Restrictions, Occurrence etc...

I want a resule like the one below

(Only one record below for sample)

<?xml version="1.0" encoding="UTF-8"?>
<xsdchema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:element name="BusinessPartner" type="BusinessPartnerType" />
<xsdimpleType name="Name2ofOrganization">
<xsd:annotation>
<xsdocumentation xml:lang="EN">Name 2 of orgnaization </xsdocumentation>
</xsd:annotation>
<xsd:restriction base="xsdtring">
<xsd:maxLength value="8"/>
<xsd:whiteSpace value="preserve" fixed="true"/>
</xsd:restriction>
</xsdimpleType>



What should i do ? Any changes to be made in dataset ?

Where am i missing??????

推荐答案


这篇关于Dataset.WriteXmlSchema没有扩展的属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-25 06:10