This might be a silly question, but I'm having a problem validating against
an xsd:choice and I just can't see what is wrong.
The incoming XML looks like this:
<?xml version="1.0"?>
<XMLMSG>
<HEADER>
<SENDERAPPL>SONYNET</SENDERAPPL>
<SENDERUSR>*NA*</SENDERUSR>
<RECIPIENTAPPL>SONYNET</RECIPIENTAPPL>
<RECIPIENTUSR>*NA*</RECIPIENTUSR>
<MSG>ABO</MSG>
<PROCESS>GCPEATTRProcessTestConnexionEAI</PROCESS>
<PROCESSID>2194</PROCESSID>
</HEADER>
<BODY/>
</XMLMSG>
and I am trying to validate against a schema that matches HEADER against
this:
<xsd:complexType name="Header">
<xsd:choice>
<xsd:group ref="stdmessage" />
<xsd:group ref="ackFromEAI" />
</xsd:choice>
</xsd:complexType>
where the two groups are:
<xsd:group name="stdmessage">
<xsd:sequence>
<xsd:element name="SENDERAPPL" type="mandatory" />
<xsd:element name="SENDERUSR" type="xsd:string"
minOccurs="0" />
<xsd:element name="RECIPIENTAPPL" type="mandatory" />
<xsd:element name="RECIPIENTUSR" type="xsd:string"
minOccurs="0" />
<xsd:element name="MSG" type="message"/>
<xsd:element name="PROCESS" type="mandatory" />
<xsd:element name="PROCESSID"
type="xsd:positiveInteger" />
<xsd:element name="ACTID"
type="xsd:positiveInteger" />
</xsd:sequence>
</xsd:group>
<xsd:group name="ackFromEAI">
<xsd:sequence>
<xsd:element name="SENDERAPPL" type="mandatory" />
<xsd:element name="SENDERUSR" type="xsd:string" />
<xsd:element name="RECIPIENTAPPL" type="mandatory" />
<xsd:element name="RECIPIENTUSR" type="xsd:string" />
<xsd:element name="MSG" type="ackMessage" />
<xsd:element name="PROCESS" type="mandatory" />
<xsd:element name="PROCESSID"
type="xsd:positiveInteger" />
</xsd:sequence>
</xsd:group>
The incoming XML does not have an ACTID and should match against the
"ackFromEAI" group. Instead, I get a validation error. However, if I remove
the "stdmessage" group from the xsd:choice, it works fine.
Am I misunderstanding how this should work?
regards
Mark Lines-Davies
*************************************************************************
The information contained in this message or any of its
attachments may be privileged and confidential and intended
for the exclusive use of the addressee. If you are not the
addressee any disclosure, reproduction, distribution or other
dissemination or use of this communication is strictly prohibited
*************************************************************************
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]