简体   繁体   English

XSD文档价值

[英]Xsd documentation value

how can I create xsd documentation programatically? 如何以编程方式创建XSD文档? Example: 例:

<xs:annotation>
<xs:documentation>Documentation</xs:documentation>
</xs:annotation>

I used: 我用了:

 XmlSchemaElement element = new XmlSchemaElement();
    XmlSchemaAnnotation annotation = new XmlSchemaAnnotation();
    XmlSchemaDocumentation doc = new XmlSchemaDocumentation();

    //doc.Value = "Documentation"; ??
    annotation.Items.Add(doc);
    element.Annotation = annotation;

but how do I set documentation value? 但是如何设置文档值? There is no such property in XmlSchemaDocumentation type. XmlSchemaDocumentation类型中没有此类属性。 Thanks! 谢谢!

I think you are missing a small thing, like 我认为您缺少一件小事,例如

annotation.Items.Add(doc);
doc.Markup = TextToNodeArray("Your text you need");

could you try this and see what if this helps any? 您可以尝试一下,看看有什么帮助吗?

refer otherwise to http://msdn.microsoft.com/en-us/library/system.xml.schema.xmlschemadocumentation.aspx which should give you pretty nice examples otherwise how to work with it. 否则,请参考http://msdn.microsoft.com/zh-cn/library/system.xml.schema.xmlschemadocumentation.aspx ,该书应为您提供很好的示例,否则将如何使用它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM