XML Schema元素中的ref属性 [英] ref attribute in an XML Schema element

查看:1025
本文介绍了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.

推荐答案

我认为它试图告诉您,对于for和xs:element元素,您需要指定ref类型或有效的xmlns:xs属性,而您却没有做过.
I think it''s trying to tell you that for and xs:element element you need to specify either a ref type or a valid xmlns:xs attribute, and you''ve done neither.


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

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆