好的。我正在尝试从以下位置生成 c# 类: http ://www.xbrl.org/2003/xbrl-instance-2003-12-31.xsd(基本上是 xbrl 模式)。
我对元组和项目有问题。
这是 xsd 的样子:
<element name="tuple" type="anyType" abstract="true">
<annotation>
<documentation>
Abstract tuple element used as head of tuple substitution group
</documentation>
</annotation>
</element>
<element name="xbrl">
<annotation>
<documentation>
XBRL instance root element.
</documentation>
</annotation>
<complexType>
<sequence>
<element ref="link:schemaRef" minOccurs="1" maxOccurs="unbounded" />
<element ref="link:linkbaseRef" minOccurs="0" maxOccurs="unbounded" />
<element ref="link:roleRef" minOccurs="0" maxOccurs="unbounded" />
<element ref="link:arcroleRef" minOccurs="0" maxOccurs="unbounded" />
<choice minOccurs="0" maxOccurs="unbounded">
<element ref="xbrli:item"/>
<element ref="xbrli:tuple"/>
<element ref="xbrli:context"/>
<element ref="xbrli:unit"/>
<element ref="link:footnoteLink"/>
</choice>
</sequence>
<attribute name="id" type="ID" use="optional" />
<anyAttribute namespace="http://www.w3.org/XML/1998/namespace"
processContents="lax" />
</complexType>
</element>
序列的生成属性如下所示:
[System.Xml.Serialization.XmlElementAttribute("context", typeof(context))]
[System.Xml.Serialization.XmlElementAttribute("item", typeof(object))]
[System.Xml.Serialization.XmlElementAttribute("tuple", typeof(object))]
[System.Xml.Serialization.XmlElementAttribute("unit", typeof(unit))]
[System.Xml.Serialization.XmlElementAttribute("footnoteLink", typeof(footnoteLink),
Namespace="http://www.xbrl.org/2003/linkbase")]
public object[] Items {
get {
return this.itemsField;
}
set {
this.itemsField = value;
}
}
基本上不会生成元组和项抽象基类。所以即使其他模式有替代组=“元组”我也不能把它放进去。(我可以,但它不会序列化)。