You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by xuliujuan <xu...@hotmail.com> on 2004/02/04 03:00:47 UTC

axis_1.1 and axis 1.2apha does not supports substitutionGroup feature of XML schema correctly

Hi all,

I found axis_1.1 does not supports substitutionGroup feature of XML schema correctly.While I using substitutionGroup ,it does not work .

In Generic schema definition is:

..

<xs:complexType name="AbstractCreateAttributeType" abstract="true"/>

<xs:element name="CreateMODefinition" type="AbstractCreateAttributeType" abstract="true"/>

..

SubstutionGroup element schema definition is:

..

<xs:element name="CreateCSAttributes" substitutionGroup="cai3g:CreateMODefinition">

<xs:annotation>

<xs:documentation>The attributes for creating customer segment</xs:documentation>

</xs:annotation>

<xs:complexType>

<xs:complexContent>

<xs:extension base="cai3g:AbstractCreateAttributeType">

<xs:sequence>

<xs:element name="cdsCSId" type="xs:unsignedLong"/>

<xs:element name="cdsCSName" type="xs:string" minOccurs="0"/>

<xs:element name="cdsCSDescription" type="xs:string" minOccurs="0"/>

<xs:element name="cdsCSServicePackageId" minOccurs="0" maxOccurs="unbounded">

<xs:complexType>

<xs:sequence>

<xs:element name="cdsSPId"/>

</xs:sequence>

</xs:complexType>

<xs:key name="CreateServicePackageId" id="CAI3GKey">

<xs:selector xpath="./cpm:cdsCSServicePackageId"/>

<xs:field xpath="@cdsSPId"/>

</xs:key>

<xs:keyref name="CSPIdRef" refer="cpm:CreateServicePackageId">

<xs:selector xpath="./cpm:cdsCSServicePackageId"/>

<xs:field xpath="cpm:cdsSPId"/>

</xs:keyref>

</xs:element>

</xs:sequence>

</xs:extension>

</xs:complexContent>

</xs:complexType>

<xs:key name="CreateCSMsg" id="CAI3GKey">

<xs:selector xpath="."/>

<xs:field xpath="@cdsCSId"/>

</xs:key>

<xs:keyref name="CCSMsgRef" refer="cpm:CreateCSMsg">

<xs:selector xpath="."/>

<xs:field xpath="cpm:cdsCSId"/>

</xs:keyref>

</xs:element>

..

The actual xml we got:



<CreateMODefinition>

<cdsCSId>8888001</cdsCSId>

<cdsCSName>PreviligeCS</cdsCSName>

<cdsCSDescription> Previlige = Customers</cdsCSDescription>

<cdsCSServicePackageId>

<cdsSPId>8888001</cdsSPId>

<cdsCSServicePackageId>

</CreateMODefinition>

The expected xml should be like below in SubstituionGroup case:



<CreateCSAttributes cdsCSId= "8888001">

<cdsCSId>8888001</cdsCSId>

<cdsCSName>PreviligeCS</cdsCSName>

<cdsCSDescription> Previlige =Customers</cdsCSDescription>

<cdsCSServicePackageId>

<cdsSPId>8888001</cdsSPId>

<cdsCSServicePackageId>

</CreateCSAttributes>

And I have tried according to Jim Murphy 's comments:

Make the concrete element decl that is part of the substitution group

reference a new global type decl.

like:

<xs:element name="CreateCSAttributes" type="CreateCSAttributesType"

substitutionGroup="cai3g:CreateMODefinition"/>

and:

<xs:complexType name="CreateCSAttributesType">

<xs:complexContent>

<xs:extension base="cai3g:AbstractCreateAttributeType">

<xs:sequence>

<xs:element name="cdsCSId" type="xs:unsignedLong"/>

<xs:element name="cdsCSName" type="xs:string" minOccurs="0"/>

<xs:element name="cdsCSDescription" type="xs:string" minOccurs="0"/>

<xs:element name="cdsCSServicePackageId" minOccurs="0" maxOccurs="unbounded">

<xs:complexType>

<xs:sequence>

<xs:element name="cdsSPId" type="xs:unsignedLong"/>

</xs:sequence>

<xs:attribute name="cdsSPId" type="xs:unsignedLong" use="required"/>

</xs:complexType>

<xs:key name="CreateServicePackageId" id="CAI3GKeyCreateServicePackageId">

<xs:selector xpath="."/>

<xs:field xpath="@cdsSPId"/>

</xs:key>

<xs:keyref name="CSPIdRef" refer="cpm:CreateServicePackageId">

<xs:selector xpath="."/>

<xs:field xpath="cpm:cdsSPId"/>

</xs:keyref>

</xs:element>

</xs:sequence>

<xs:attribute name="cdsCSId" type="xs:unsignedLong"use="required"/>

</xs:extension>

</xs:complexContent>

</xs:complexType>

But it still have differences compared to the expected xml:

and it still does not work

The actual xml we got:

<CreateMODefinition type="CreateCSAttributesType">

<cdsCSId>8888001</cdsCSId>

<cdsCSName>PreviligeCS</ns3:cdsCSName>

<cdsCSDescription>Previlige =Customers</cdsCSDescription>

<:cdsCSServicePackageId>

<:cdsSPId>8888001</cdsSPId>

</cdsCSServicePackageId>

</CreateMODefinition>

The expected xml should be like below in SubstituionGroup case:

<CreateCSAttributes cdsCSId= "8888001">

<cdsCSId>8888001</cdsCSId>

<cdsCSName>PreviligeCS</cdsCSName>

<cdsCSDescription> Previlige =Customers</cdsCSDescription>

<cdsCSServicePackageId>

<cdsSPId>8888001</cdsSPId>

</cdsCSServicePackageId>

</CreateCSAttributes>


Can someone help me to solve it?


Thanks a lot ^_^

Best wishes.

/Liujuan