I have solved my problem. Now, UnmarshalHandler, right before creating
AnyNode objects for unrecognized types, checks if the namespace is assigned
to a Java package in the properties file. If so, it initiates an instance of
the right class.

This has resulted that now Marshaller prints out
xsi:type="java:package_name" attribute for the object, which is something I
don't mind because if I unmarshal these XML documents, Castor works fine.

So, now I want Marshaller to work the same way. Before processing the object
for xsi:types, it should check the properties file for namespace packages,
and assign the right namespace to the object. It should use object's marshal
method/class descriptor/whatever if there is any.

Marhsaller's code looked more confusing than UnmarshalHandler. Developers?
Do you have any hint for where to start?

Ozgur Balsoy
Pervasive Technology Labs
Indiana University

> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of
> Ozgur Balsoy
> Sent: Thursday, December 20, 2001 2:49 PM
> To: [EMAIL PROTECTED]
> Subject: [castor-dev] namespace checking in UnmarshalHandler
>
>
>
> Hi there,
> I was wondering why UnmarshalHandler does not check properties
> file to find
> package and class names. I have this XML:
>
> <section xmlns="namespace1" xmlns:cg="namespace2">
>       <title>my title</title>
>       <cg:screen view="portal" link="relative"/>
> </section>
>
> In castor.properties, I give:
>
> org.exolab.castor.builder.nspackages=\
>       namespace1=java.namespace1,\
>       namespace2=java.namespace2
>
> In schema, section element has 'any' group after 'title'. When I unmarshal
> 'section', UnmarshalHandler finds the namespace of  cg:screen fine but it
> does not check the above packages, rather it unmarshals it as an AnyNode.
>
> Ozgur
>
> -----------------------------------------------------------
> 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