There have been a lot more problems while testing with larger/more complete files. Since I did not have the time to debug all of these, I switched to DOM4J for (the small parts of) reading the document.
I came to the conclusion, that castor is not yet ready to handle that sort of documents. Reason: XPDL defines "ExtendedAttributes" which contain "AnyNode"-Elements. For these AnyNode-Elements there exist a seperate XSD. In this seperate XSD, most Elements have the same name as in XPDL-Schema. Castor does not handle this second Namespace correctly (the Namespace-Mapping is ignored). Are there any plans to improve the Namespace-Handling in future versions? Markus 2007/11/29, Ralf Joachim <[EMAIL PROTECTED]>: > > If you are logged in to jira there will be a link 'CREATE NEW ISSUE' in > the menu bar in the top area of the page. Or use: > > http://jira.codehaus.org/secure/CreateIssue!default.jspa > > I suggest you to first ask the list if you face a problem and create new > issues on request except when you are sure there is a bug in castor. If > you are able to produce a minimal example that showcases your problem > the chance to get help from the list is quite good. > > Ralf > > > Markus Schlegel schrieb: > > I did not find the "Add new issue" Link in Jira. Therefore I decided > > to post it to the list. > > I have still some trouble with the namespaces... > > > > 2007/11/29, Ralf Joachim <[EMAIL PROTECTED]>: > >> Hi Markus, > >> > >> can you please check if there is an existing issue about that in jira > >> and if not create a new one. It would be great if you could attach a > >> test case to reproduce the problem you found and a patch with your > >> suggested fix to this issue. > >> > >> Thanks for your help > >> Ralf > >> > >> > >> Markus Schlegel schrieb: > >>> Hi > >>> I wrote a Mapping for a custom XPDL file (has some vendor specific > >>> additions in it). > >>> Marshalling works ok, but when I tried tu unmarshal a marshaled file, > >>> I got a "SaxException" stating that a Classdescriptor could not be > >>> Found. > >>> When I debugged the thing, I found out, that the namespaceMapping does > >>> not work, if there are Elements with the same name used in different > >>> Namespaces. > >>> Take the Example: > >>> <activity> > >>> .... > >>> <ns1:activity> > >>> ... > >>> </ns1:activity> > >>> </activity> > >>> > >>> On line 2549 of UnmarshalHandler.getInstanceType(..) the call to > >>> "_cdResolver.resolveByXMLName(..)" returns the classDescriptor of > >>> <activity>, even for <ns1:activity>, because the cache in > >>> "XMLClassDescriptorResolverImpl" has exactly one entry when called and > >>> therefore does not check if the Namespace matches. > >>> > >>> I have now added a namespace-check to > UnmarshalHandler.getInstanceType(..). > >>> Instead of : > >>> (Line 2540) > >>> classDesc = _cdResolver.resolveByXMLName(type, > >>> typeNamespaceURI, _loader); > >>> > >>> if (classDesc != null) > >>> return classDesc.getJavaClass().getName(); > >>> > >>> I now have: > >>> classDesc = _cdResolver.resolveByXMLName(type, > >>> typeNamespaceURI, _loader); > >>> > >>> if (classDesc != null) { //TODO must check for correct > >>> namespace before... > >>> if ((typeNamespaceURI == null) || > >>> (typeNamespaceURI.length() == 0) || classDesc.getNameSpaceURI() == > >>> null || > >>> (namespaceEquals(typeNamespaceURI, > >>> classDesc.getNameSpaceURI()))) { > >>> return classDesc.getJavaClass().getName(); > >>> } > >>> classDesc=null; > >>> } > >>> > >>> > >>> Cheers > >>> Markus Schlegel > >>> > >>> --------------------------------------------------------------------- > >>> To unsubscribe from this list please visit: > >>> > >>> http://xircles.codehaus.org/manage_email > >> -- > >> > >> Syscon Ingenieurbüro für Meß- und Datentechnik GmbH > >> Ralf Joachim > >> Raiffeisenstraße 11 > >> 72127 Kusterdingen > >> Germany > >> > >> Tel. +49 7071 3690 52 > >> Mobil: +49 173 9630135 > >> Fax +49 7071 3690 98 > >> > >> Internet: www.syscon.eu > >> E-Mail: [EMAIL PROTECTED] > >> > >> Sitz der Gesellschaft: D-72127 Kusterdingen > >> Registereintrag: Amtsgericht Stuttgart, HRB 382295 > >> Geschäftsleitung: Jens Joachim, Ralf Joachim > >> > >> --------------------------------------------------------------------- > >> To unsubscribe from this list please visit: > >> > >> http://xircles.codehaus.org/manage_email > >> > >> > > > > --------------------------------------------------------------------- > > To unsubscribe from this list please visit: > > > > http://xircles.codehaus.org/manage_email > > -- > > Syscon Ingenieurbüro für Meß- und Datentechnik GmbH > Ralf Joachim > Raiffeisenstraße 11 > 72127 Kusterdingen > Germany > > Tel. +49 7071 3690 52 > Mobil: +49 173 9630135 > Fax +49 7071 3690 98 > > Internet: www.syscon.eu > E-Mail: [EMAIL PROTECTED] > > Sitz der Gesellschaft: D-72127 Kusterdingen > Registereintrag: Amtsgericht Stuttgart, HRB 382295 > Geschäftsleitung: Jens Joachim, Ralf Joachim > > --------------------------------------------------------------------- > To unsubscribe from this list please visit: > > http://xircles.codehaus.org/manage_email > >