.NET 的 XACML2 架构生成错误 - 无法在架构的顶层使用通配符

发布于 2024-09-08 20:49:09 字数 318 浏览 2 评论 0原文

有人能够从 XACML2 模式文件成功生成 C# 实体类吗?我收到“无法在架构的顶层使用通配符”。我认为这与 xs:any 元素有关。我尝试更改 processContents="skip" (从“lax”)但无济于事。我使用 WSCF Blue 以及 xsd.exe

Has anyone been able to successfully generate C# entity classes from XACML2 schema files? I am getting "Cannot use wildcards at the top level of a schema." I think this has something to do with xs:any elements. I have tried change the processContents="skip" (from "lax") but to no avail. I get this using WSCF Blue as well as xsd.exe.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

眼中杀气 2024-09-15 20:49:09

使用 VS 2010 附带的 xsd.exe 版本非常适合我。

Works perfectly for me using the version of xsd.exe that ships w/ VS 2010.

往昔成烟 2024-09-15 20:49:09

我通过 VS2010 XSD.exe 运行 Xacml3 架构没有任何问题,但在尝试使用 XSD 处理 Xacml2 架构时,我确实看到了“无法在架构顶层使用通配符”错误。

XSD 处理 Xacml2 策略架构时没有错误。

处理 Xacml2 上下文架构时,XSD 报告此通配符错误。

问题似乎是 xacml-context:AttributeValueType 架构定义中 ##anymixed="true" 的组合。 Xacml2 策略架构和 Xacml3 中 AttributeValueType 的其他定义使用 xs:complexContent 包装器围绕 ExpressionType 扩展,该扩展又包含 xs :anyxs:anyAttribute 定义。 Xacml2 context:AttributeValueType 不包含此包装器。

解决方案:从 Xacml2 xacml-context:AttributeValueType 定义中删除 mixed="true",XSD 将为架构生成正确的类类型。生成的 AttributeValueType 类将具有元素列表和属性列表的属性,涵盖所有基础。

I have no problems running the Xacml3 schema through VS2010 XSD.exe, but I do see this "Cannot use wildcards at the top level of a schema" error when trying to process the Xacml2 schema with XSD.

XSD processes the Xacml2 Policy schema with no errors.

XSD reports this wildcard error when processing the Xacml2 Context schema.

The issue appears to be the combination of ##any and mixed="true" in the xacml-context:AttributeValueType schema definition. Other definitions of AttributeValueType in Xacml2 Policy schema and Xacml3 use an xs:complexContent wrapper around an ExpressionType extension, which in turn contains xs:any and xs:anyAttribute definitions. The Xacml2 context:AttributeValueType does not contain this wrapper.

Solution: Remove mixed="true" from the Xacml2 xacml-context:AttributeValueType definition and XSD will generate the correct class types for the schema. The generated AttributeValueType class will have properties for a list of elements and a list of attributes, which covers all the bases.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文