本文介绍了XML Schema元素中的ref属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨!

创建新的XMLSchemaElement时,将使用空字符串创建"ref"属性.

以下C#代码用于创建XML模式:

Hi!

While creating a new XMLSchemaElement, "ref" attribute is being created with an empty string.

Following C# code is being used to create an XML Schema:

XmlSchema xsd = new XmlSchema();
 XmlSchemaElement xsdele = new XmlSchemaElement();
 xsdele.Name = "Feedbacks";
 xsdele.SchemaTypeName = new XmlQualifiedName("string", "http://www.w3.org/2001/XMLSchema");
 xsd.Items.Add(xsdele);
 //Write the new schema to a file using XmlWriter....



上面的代码导致上述元素的以下模式片段:



The above code results in the following schema snippet for the above element:

<xs:element name="Feedbacks" ref="" xmlns:xs="#unknown" />



该代码在.NetCF2.0上有效(不创建"ref"属性),但是在移植到.NetCF3.5时会添加"ref"属性.

我们在这里缺少什么吗?您能帮忙吗?
感谢您的时间.



The code works on .NetCF2.0 (without creating "ref" attribute), but the "ref" attribute is being added when ported to .NetCF3.5.

Are we missing something here? Can you pl help?
Appreciate your time.

regards.

推荐答案


这篇关于XML Schema元素中的ref属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-07 01:11