Btw, I just noticed (re-reading parts of your message again) that you
are using 'type' mode during code generation. As far as I remember, that
will not work with substitution groups, but I am not 100% sure. Can you
please switch to 'element' mode and see whetehr that makes a difference ?
Thanks in advance
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