免费工具/扩展,用于将XSD转换为带有工作注释的C#
是否有XSD2Code或xsd.exe的任何工具或版本可以生成C#实体以及来自XSD2Code的注释免费工具/扩展,用于将XSD转换为带有工作注释的C#,c#,xsd,xsd.exe,xsd2code,C#,Xsd,Xsd.exe,Xsd2code,是否有XSD2Code或xsd.exe的任何工具或版本可以生成C#实体以及来自XSD2Code的注释 XSD2Code和xsd.exe都会忽略注释(对于XSD2Code,EnableSummaryComment就是不太好用),我不想花时间分析和更改它们背后的源代码……有人知道是否有任何完全可用和免费的替代方案吗?你有没有一个例子来说明你想要的是什么?例如,使用XSD2代码 <xs:attribute name="Test" use="optional"> <xs:ann
XSD2Code和xsd.exe都会忽略注释(对于XSD2Code,EnableSummaryComment就是不太好用),我不想花时间分析和更改它们背后的源代码……有人知道是否有任何完全可用和免费的替代方案吗?你有没有一个例子来说明你想要的是什么?例如,使用XSD2代码
<xs:attribute name="Test" use="optional">
<xs:annotation>
<xs:documentation>Test data number when combined with schema name provides the stub response.</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:minLength value="1"/>
<xs:maxLength value="50"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
测试数据编号与架构名称组合时提供存根响应。
产生这个
/// <summary>
/// Test data number when combined with schema name provides the stub response.
/// </summary>
[System.Xml.Serialization.XmlAttributeAttribute()]
public string Test { get; set; }
//
///测试数据编号与架构名称组合时提供存根响应。
///
[System.Xml.Serialization.XmlAttributeAttribute()]
公共字符串测试{get;set;}
你在追求不同的东西吗?你有没有一个例子来说明你在追求什么?例如,使用XSD2代码
<xs:attribute name="Test" use="optional">
<xs:annotation>
<xs:documentation>Test data number when combined with schema name provides the stub response.</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:minLength value="1"/>
<xs:maxLength value="50"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
测试数据编号与架构名称组合时提供存根响应。
产生这个
/// <summary>
/// Test data number when combined with schema name provides the stub response.
/// </summary>
[System.Xml.Serialization.XmlAttributeAttribute()]
public string Test { get; set; }
//
///测试数据编号与架构名称组合时提供存根响应。
///
[System.Xml.Serialization.XmlAttributeAttribute()]
公共字符串测试{get;set;}
您想要的是不同的东西吗?我刚刚用XSD2代码和下面的xsd测试了这一点。xsd2code似乎只支持在生成的C#代码中显示属性的注释
演示xs:annotation xs:documentation块显示在xsd2code生成的C#代码中。
注:
-xsd.exe不支持批注。使用NETFX 4.5.1工具进行测试。
-XSD2代码仅用于属性。测试版本为3.4.0.32990。
信息根。
复杂的根类型。
元素的任何顺序。
元素中的测试数据。
属性中的可选测试数据。
XSD的结尾。
我刚刚用xsd2code和下面的xsd测试了这一点。xsd2code似乎只支持在生成的C#代码中显示属性的注释
演示xs:annotation xs:documentation块显示在xsd2code生成的C#代码中。
注:
-xsd.exe不支持批注。使用NETFX 4.5.1工具进行测试。
-XSD2代码仅用于属性。测试版本为3.4.0.32990。
信息根。
复杂的根类型。
元素的任何顺序。
元素中的测试数据。
属性中的可选测试数据。
XSD的结尾。
支持对元素、属性和类型进行注释。它还根据限制和开放源代码生成XML文档。完全披露:我是主要作者
//
///复杂的根类型。
///信息根。
///
[System.CodeDom.Compiler.GeneratedCodeAttribute(“XmlSchemaClassGenerator”、“1.0.0.0”)]
[System.SerializableAttribute()]
[System.Xml.Serialization.XmlTypeAttribute(“根”,命名空间=”http://example.org/annotations")]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute(“代码”)]
[System.Xml.Serialization.XmlRootAttribute(“根”,命名空间=”http://example.org/annotations")]
公共部分类根
{
///
///
///元素中的测试数据。
///
///最小长度:1。
///最大长度:50。
///
[System.ComponentModel.DataAnnotations.MinLengthaAttribute(1)]
[System.ComponentModel.DataAnnotations.MaxLengthaAttribute(50)]
[System.Xml.Serialization.XmlElementAttribute(“TestElement”,命名空间=”http://example.org/annotations")]
公共字符串TestElement{get;set;}
///
///
///属性中的可选测试数据。
///
///最小长度:1。
///最大长度:50。
///
[System.ComponentModel.DataAnnotations.MinLengthaAttribute(1)]
[System.ComponentModel.DataAnnotations.MaxLengthaAttribute(50)]
[System.Xml.Serialization.XmlAttributeAttribute(“TestAttribute”,Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
公共字符串TestAttribute{get;set;}
}
支持对元素、属性和类型进行注释。它还根据限制和开放源代码生成XML文档。完全披露:我是主要作者
//
///复杂的根类型。
///信息根。
///
[System.CodeDom.Compiler.GeneratedCodeAttribute(“XmlSchemaClassGenerator”、“1.0.0.0”)]
[System.SerializableAttribute()]
[System.Xml.Serialization.XmlTypeAttribute(“根”,命名空间=”http://example.org/annotations")]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute(“代码”)]
[System.Xml.Serialization.XmlRootAttribute(“根”,命名空间=”http://example.org/annotations")]
公共部分类根
{
///
///
///元素中的测试数据。
///
///最小长度:1。
///最大长度:50。
///
[System.ComponentModel.DataAnnotations.MinLengthaAttribute(1)]
[System.ComponentModel.DataAnnotations.MaxLengthaAttribute(50)]
[System.Xml.Serialization.XmlElementAttribute(“TestElement”,命名空间=”http://example.org/annotations")]
公共字符串TestElement{get;set;}
///
///
///属性中的可选测试数据。
///
///最小长度:1。
///最大长度:50。