Hi Sridhar

It says

[Error] cvc-complex-type.2.4.b: The content of element 'HEADER' is not
complete. It must match
'((((((((("":SENDERAPPL),("":SENDERUSR){0-1}),("":RECIPI
ENTAPPL)),("":RECIPIENTUSR){0-1}),("":MSG)),("":PROCESS)),("":PROCESSID)),("
":AC
TID))|((((((("":SENDERAPPL),("":SENDERUSR)),("":RECIPIENTAPPL)),("":RECIPIEN
TUSR
)),("":MSG)),("":PROCESS)),("":PROCESSID)))'.

which looks ok to me, and I would have thought it would match the right hand
side of the "|"...

regards

Mark

-----Original Message-----
From: Sridhar Raju Y [mailto:[EMAIL PROTECTED]
Sent: 19 March 2002 17:52
To: [EMAIL PROTECTED]
Subject: RE: choice using Xerces 2.0.0 (beta4)


hi Mark,
 Can you specify the error.

regards,
Sridhar.

-----Original Message-----
From: Mark Lines-Davies [mailto:[EMAIL PROTECTED]
Sent: Tuesday, March 19, 2002 11:14 PM
To: [EMAIL PROTECTED]
Subject: xsd:choice using Xerces 2.0.0 (beta4)


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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to