Hi Joseph,

this is an identified bug we are working on (at least it is on our to-do list
;+)).
Arnaud

> -----Original Message-----
> From: Joseph Campolongo [mailto:[EMAIL PROTECTED]]
> Sent: Saturday, August 04, 2001 12:20 AM
> To: [EMAIL PROTECTED]
> Subject: [castor-dev] XML SourceGen question
>
>
> I have the following element described in my xsd:
>
> <element name='cXML'>
>   <complexType>
>    <choice>
>     <sequence>
>      <element ref='Header'/>
>      <choice>
>       <element ref='Message'/>
>       <element ref='Request'/>
>      </choice>
>     </sequence>
>     <element ref='Response'/>
>    </choice>
>    <attribute name='version' type='string' default='1.2.005'/>
>    <attribute name='payloadID' type='string' use='required'/>
>    <attribute name='timestamp' type='string' use='required'/>
>    <attribute name='xml:lang' type='string' use='optional'/>
>   </complexType>
>  </element>
>
> It generates a class with _response and _cxmlSequence members for the
> elements.
>
> The problem is that when I try to unmarshal the XML
>
> <?xml version="1.0" encoding="UTF-8"?>
> <cXML payloadID="996539335546.1513265632@demo-nt1"
> timestamp="2001-07-30T17:28:55-07:00" version="1.0" xml:lang="en">
>     <Header>
>        ....
>     </Header>
>     <Request deploymentMode="production">
>      ...
>     </Request>
> </cXML>
>
> I get the following exception:
>
> org.xml.sax.SAXException: unable to find FieldDescriptor for 'Request' in
> ClassDescriptor of cXML
>         at
> org.exolab.castor.xml.UnmarshalHandler.startElement(UnmarshalHandler.java:80
> 4)
>         at
> org.apache.xerces.parsers.SAXParser.startElement(SAXParser.java:1340)
>         at
> org.apache.xerces.validators.common.XMLValidator.callStartElement(XMLValidat
> or.java:1197)
>         at
> org.apache.xerces.framework.XMLDocumentScanner.scanElement(XMLDocumentScanne
> r.java:1862)
>         at
> org.apache.xerces.framework.XMLDocumentScanner$ContentDispatcher.dispatch(XM
> LDocumentScanner.java:1238)
>         at
> org.apache.xerces.framework.XMLDocumentScanner.parseSome(XMLDocumentScanner.
> java:381)
>         at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:1035)
>         at
> org.exolab.castor.xml.Unmarshaller.unmarshal(Unmarshaller.java:338)
>         at
> org.exolab.castor.xml.Unmarshaller.unmarshal(Unmarshaller.java:270)
>         at
> org.exolab.castor.xml.Unmarshaller.unmarshal(Unmarshaller.java:391)
>         at com.cascadeworks.app.cXML.protocol.CXML.unmarshal(CXML.java:226)
>         at com.cascadeworks.app.cXML.protocol.Main.main(Main.java:33)
>
> It looks like at least part of the error is in
> UnmarshalHandler.searchContainers(), where it doesn't recurse more than one
> level into a container, and XMLFieldDescriptor.match() also recurses one
> level, meaning that you can only have a schema with two levels of group tags
> at most.
>
> Is this analysis correct, or am I simply doing something wrong?  The
> particular schema, matching the DTD
>
> <!ELEMENT cXML (( Header, (Message | Request)) | Response)>
> <!ATTLIST cXML
>     version    %string;       "&cxml.version;"
>     payloadID  %string;       #REQUIRED
>     timestamp  %datetime.tz;  #REQUIRED
>     xml:lang   %xmlLangCode;  #IMPLIED
> >
>
> is reasonably common, so I'm surprised this hasn't come up before.
>
> jvc
>
> -----------------------------------------------------------
> If you wish to unsubscribe from this mailing, send mail to
> [EMAIL PROTECTED] with a subject of:
>       unsubscribe castor-dev

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

Reply via email to