验证 .NET 中的 XBRL 实例文档
我目前正在使用 C# 创建和验证 XBRL 实例文档,并且遇到了一些有关 XBRL 实例架构文件的问题:
http://www.xbrl.org/2003/xbrl-instance-2003-12-31.xsd
根据.NET架构验证器,架构无效。它引发以下异常:
System.Xml.Schema.XmlSchemaException: If ref is present, all of <complexType>, <simpleType>, <key>, <keyref>, <unique>, nillable, default, fixed, form, block, and type must be absent.
当我尝试使用 XML 架构定义工具 (Xsd.exe) 生成架构的类表示形式时,我遇到了相同的异常。
这让我感到惊讶,因为 XBRL 在相当多的应用程序中使用,而且我在网上找不到太多关于这方面的信息。这里有一个相当古老的讨论,表明它取决于用于验证的工具:
http://www.xml.com/cs/user/view/cs_msg/1849
这似乎是正确的,因为其他模式验证器不会抱怨。 XMLSpy,XML 复制编辑器以及 w3 自己的验证器
http://www. w3.org/2001/03/webdata/xsv#hlp-addr
验证架构没有任何问题,而 XMLFox 报告了与 .NET 相同的问题。
所以我的问题是:
- XBRL 实例架构有效吗?我怀疑架构规范。可能不清楚,因此不同工具的作者对其有不同的解释。
- 如果我想使用 .NET 中的架构,我应该怎么做?作为一名程序员,您可以以任何方式改变验证引擎规则吗?除了 System.XML.Schema 中的验证机制之外,还有其他可能性吗?也许是 Java 世界中的 Xerces 等第三方工具?
谢谢
I'm currently working with creation and validation of XBRL instance documents in C#, and I've run into some problems regarding the XBRL instance schema file:
http://www.xbrl.org/2003/xbrl-instance-2003-12-31.xsd
According to the .NET schema validator, the schema is not valid. It throws the following exception:
System.Xml.Schema.XmlSchemaException: If ref is present, all of <complexType>, <simpleType>, <key>, <keyref>, <unique>, nillable, default, fixed, form, block, and type must be absent.
I get the same exception when I try to use the XML Schema Definition Tool (Xsd.exe) to generate a class representation of the schema.
This surprises me since XBRL is used in quite a lot of applications, and I can't find much information about this on the web. The an rather old discussion here which suggest that it depends on the tools used for the validation:
http://www.xml.com/cs/user/view/cs_msg/1849
This seems to be right since other schema validators do not complain. XMLSpy, XML Copy Editor and also w3's own validator
http://www.w3.org/2001/03/webdata/xsv#hlp-addr
validates the schema without any problems, where as XMLFox reports the same problem as .NET.
So my questions are:
- Is the XBRL instance schema valid? I suspect that the schema spec. might be unclear, so the authors of the different tool interpret it differently.
- What should I do if I want to work with the schema in .NET? Can you as a programmer, alter the validation engine rules in any way? Are there any other possibilities than the validation mechanisms in System.XML.Schema? Perhaps third party tool as Xerces in the Java world?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论