Hi Aldrin,
can you post a *minimal* XML schema that allowed me to generate the Java
classes and look at things myself ? As it was basically me that
(re)added support for substitution groups to post-1.1 releases (based
upon the work with a client of mine), your problem should be resolvable.
But first of all, I need something to 'play with'. And pretty please,
please try to keep things as minimal as possible if you wanted me to
look at this in my (private) spare time. In other words, try to strip
down your XML schema to the absolute minimum that's required to showcase
the problem.
If that's not an option to you, but you'd still require help in a timely
manner, please do consider taking up professional support as explained at
http://castor.org/professional-services.html
Regards
Werner
aldrin d'souza wrote:
Hello,
I'm facing a problem which has been discussed on this mailing list before -
http://www.mail-archive.com/[email protected]/msg04355.html
Here is the the issue:
I am using castor 1.1.2.1 <http://1.1.2.1> to generate the java classes
that correspond to the XACML 2.0 XSD which makes use of substitution groups.
An element "Apply" can appear wherever an element "Expression" is
expected. Based on the schema the following is a valid document:
---------------------------------------------------
<PolicySet xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
xmlns='urn:oasis:names:tc:xacml: 2.0:policy:schema:os'
xsi:schemaLocation='urn:oasis:names:tc:xacml:2.0:policy:schema:os
http://docs.oasis-open.org/xacml/access_control-xacml-2.0-policy-schema-os.xsd
<http://docs.oasis-open.org/xacml/access_control-xacml-2.0-policy-schema-os.xsd>'
PolicySetId="policy-set"
PolicyCombiningAlgId="urn:oasis:names:tc:xacml:1.0:policy-combining-algorithm:deny-overrides">
<Target/>
<Policy PolicyId="policy"
RuleCombiningAlgId="urn:oasis:names:tc:xacml:
1.0:rule-combining-algorithm:first-applicable">
<Target/>
<Rule RuleId="primary-rule" Effect="Permit">
<Condition>
<Apply
FunctionId="urn:oasis:names:tc:xacml:
1.0:function:string-at-least-one-member-of">
<Apply
FunctionId="urn:oasis:names:tc:xacml:1.0:function:string-bag">
<AttributeValue
DataType=" http://www.w3.org/2001/XMLSchema#string">
Admin
</AttributeValue>
<AttributeValue
DataType=" http://www.w3.org/2001/XMLSchema#string">
Operator
</AttributeValue>
</Apply>
<SubjectAttributeDesignator
AttributeId="urn:oasis:names:tc:xacml:2.0:subject:role"
DataType="http://www.w3.org/2001/XMLSchema#string"
SubjectCategory="urn:oasis:names:tc:xacml:
1.0:subject-category:access-subject" />
</Apply>
</Condition>
</Rule>
</Policy>
</PolicySet>
-------------------------------------
However, when I try to unmarshal it - the code fails with the following
exception:
-------------------------------------
org.exolab.castor.xml.MarshalException: unable to find FieldDescriptor
for 'Apply' in ClassDescriptor of ConditionType
-------------------------------------
Apparently, the unmarshalling code does not seem to understand the
substitution group.
Based on the suggestions I found on the web I enabled the following
options in my castorbuilder.properties file:
-------------------------------------
org.exolab.castor.builder.automaticConflictResolution=true
org.exolab.castor.builder.javaclassmapping=type
-------------------------------------
However, it still doesn't work.
Any help on this would be appreciated.
thanks,
--
ajd.
---------------------------------------------------------------------
To unsubscribe from this list please visit:
http://xircles.codehaus.org/manage_email