Ok. I'm trying to generate c# classes from: http://www.xbrl.org/2003/xbrl-instance-2003-12-31.xsd (The xbrl schema basically).
I am having problem with the tuple and the item.
Here's what the xsd looks like:
<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>
And the generated property for the sequence looks like this:
[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;
}
}
Basically the tuple and item abstract base class are not generated. So even when other schema has substitutiongroup="tuple" i can't put it in. (Well I can, but it won't serialize).
Xsd.exe does not cope with some of the more complex constructs within the W3C XSD standard. So your probably going to have to look to a third party data binding product.
A list of products can be found here (but they are both a bit out of date)
We've had good results with Liquid XML Data Binder.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With