You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@xmlbeans.apache.org by Vlad Mangeym <ma...@yahoo.com> on 2006/02/05 02:53:05 UTC
Need help with substitutionGroup
I have the following types:
(Element I am trying to update):
<xs:element name="Apply" type="xacml:ApplyType" substitutionGroup="xacml:Expression"/>
<xs:complexType name="ApplyType">
<xs:complexContent>
<xs:extension base="xacml:ExpressionType">
<xs:sequence>
<xs:element ref="xacml:Expression" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="FunctionId" type="xs:anyURI" use="required"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
(Element I want to add to it):
<xs:element name="Apply" type="xacml:ApplyType" substitutionGroup="xacml:Expression"/>
<xs:complexType name="ApplyType">
<xs:complexContent>
<xs:extension base="xacml:ExpressionType">
<xs:sequence>
<xs:element ref="xacml:Expression" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="FunctionId" type="xs:anyURI" use="required"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
I am trying this Java code, but the element still stays as Expression (not AttributeValue):
//I already have applyXml loaded
ExpressionType exp = null;
AttributeValueDocument exprDoc = AttributeValueDocument.Factory
.newInstance();
AttributeValueType value = exprDoc.addNewAttributeValue();
value.setDataType(dataType);
((SimpleValue) value).setStringValue("test");
exp = value;
applyXml.addNewExpression(0);
applyXml.getExpressionArray()[0].set(exp);
Pleas help!
---------------------------------
Relax. Yahoo! Mail virus scanning helps detect nasty viruses!