Studying the XML schema, I want to be able to collect elements inside another element. It seems simple enough, not quite sure how to do this, though.
This is the diagram:
<xs:attributeGroup name="ProcedureMappingFragment"> <xs:attribute name="ParameterName" type="xs:string" /> <xs:attribute name="TypeName" type="xs:string" /> <xs:attribute name="PropertyName" type="xs:string" />
<xs:complexType name="ProcedureMappingSection"> <xs:sequence> <xs:element name="ProcMapping" type="ProcedureMapping" /> </xs:sequence> </xs:complexType> <xs:complexType name="ProcedureMapping"> <xs:attributeGroup id="two" ref="ProcedureMappingFragment" /> <xs:attribute name="ProcedureName" type="xs:string" /> </xs:complexType>
And I'm trying to create something like this:
<MappingSection xmlns="http://tempuri.org/ServiceMapping.xsd"> <ProcMapping ParameterName="ParameterName1" TypeName="TypeName1" PropertyName="PropertyName1" ProcedureName="ProcedureName1" /> <ProcMapping ParameterName="ParameterName1" TypeName="TypeName1" PropertyName="PropertyName1" ProcedureName="ProcedureName1" /> <ProcMapping ParameterName="ParameterName1" TypeName="TypeName1" PropertyName="PropertyName1" ProcedureName="ProcedureName1" /> <ProcMapping ParameterName="ParameterName1" TypeName="TypeName1" PropertyName="PropertyName1" ProcedureName="ProcedureName1" /> </MappingSection>
However, he tells me that I can only have one ProcMapping inside a MappingSection. In particular, this invokes the 2nd ProcMapping element for the MappingSection namespace.
source share