Ok,I will do it.

On 23/03/06, Werner Guttmann <[EMAIL PROTECTED]> wrote:
Hi Hristo,
 
can you please create a new issue at http://jira.codehaus.org/browse/CASTOR and attach all relevant files (your patch, the OASIS schema, a test case (if possible)) as well ?
 
Regards
Werner


From: Hristo Ganev [mailto:[EMAIL PROTECTED]]
Sent: Donnerstag, 23. März 2006 16:17
To: [email protected]
Subject: [castor-user] bug in annotation documentation schema writing

 
Problem is found in org.exolab.castor.xml.schema.writer.SchemaWriter in processAnnotation(Annotation, String) method.
It appears when we try to read schemas from OAGIS and try to write it.
 
Case:
    - There is schema that includes another schemas and they include others.
      When we read parent schema and try to write it, result file is different - all includes are included in schema file.
 
Then problem appears. Sometimes in <annotaion> element in its <documentation> element "source" attribute is writen twice.
 
Example:

        <xs:annotation><xs:documentation source=" http://www.openapplications.org/oagis" source=" http://www.openapplications.org/oagis">Example</xs:documentation></xs:annotation>

So in processAnnotation(Annotation, String) method of SchemaWriter class we've added check for existence of this attribute and problem is fixed.

The test case was made with OAGIS BillOfMaterial.wsdl include schemas.

I attached zip file with my example project which generate problem and its solution in eclipse patch (SchemaWriterPatch.txt).

 

The next exception is shown in console when problem appears: Hi  

org.xml.sax.SAXException: In document: 'file:///E:/workspace/TestCastorProject/OAGIS/Result.xsd '

Parsing Error : Attribute "source" was already specified for element "xs:documentation".

Line : 33

Column : 6597

at org.exolab.castor.xml.schema.reader.Sax2ComponentReader.fatalError(Sax2ComponentReader.java:294)

at org.apache.xerces.framework.XMLParser.reportError(XMLParser.java:1179)

at org.apache.xerces.framework.XMLDocumentScanner.reportFatalXMLError(XMLDocumentScanner.java:654)

at org.apache.xerces.framework.XMLDocumentScanner.scanElement(XMLDocumentScanner.java:1839)

at org.apache.xerces.framework.XMLDocumentScanner$ContentDispatcher.dispatch(XMLDocumentScanner.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.schema.reader.SchemaReader.read(SchemaReader.java:248)

at CastorBugTest.main(CastorBugTest.java:88)

 

 


Reply via email to