开发者

XACML2 Schema Generation Error for .NET - Cannot use wildcards at the top level of a schema

开发者 https://www.devze.com 2023-01-06 00:38 出处:网络
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

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 chang开发者_StackOverflow中文版e the processContents="skip" (from "lax") but to no avail. I get this using WSCF Blue as well as xsd.exe.


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


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消