users@jaxb.java.net

Re: schema location or namespace of JAXB object

From: Christophe Alexandre <alexandre_at_magillem.com>
Date: Thu, 28 Jun 2007 10:01:12 +0200

Well, you reassure me ;) .
With JAXB 2.1, I see a package-info.java file generated with the
schema location information in it. I guess the JAXBContext loads
this information from it ?
With JAXB 1, I guess the information is more deeply hidden in the
generated files.

Regards.
Christophe


Le 27 juin 07 à 15:22, Kenny MacLeod a écrit :

> You know, the more I think about this, the less I understand... for
> the life of me, I can't see how the namespace URI is marshalled
> when the annotated classes contain no such information. It must be
> something obvious, but I can't see it.
>
> Anyone?
>
>> - How does JAXB manage to marshal a .xml with the schema location
>> and namespace information
>> when the only argument I give to the marshaller is the
>> ObjectFactory ?
>> - When my .xml is unmarshalled, how the unmarshaller manages the
>> schema location and namespace information ?
>> Regards.
>> Christophe
>> Le 27 juin 07 à 14:00, Kenny MacLeod a écrit :
>>>> Isn't SchemaFactory reliant on a .xsd ?
>>>
>>> It is, but JAXB isn't reliant on schema at all. You can inject a
>>> Schema into the JAXB unmarshaller if you wish, but that's only to
>>> add validation.
>>>
>>>> My problem is that at runtime I don't have access to the schema
>>>> but to JAXB instances generated from a .xml unmarshalling.
>>>> And I want to access the schema location information from any
>>>> JAXB object.
>>>
>>> JAXB itself gives you no help there, you'll need to locate the
>>> schema yourself.
>>>
>>> --------------------------------------------------------------------
>>> -
>>> To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
>>> For additional commands, e-mail: users-help_at_jaxb.dev.java.net
>>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
>> For additional commands, e-mail: users-help_at_jaxb.dev.java.net
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
> For additional commands, e-mail: users-help_at_jaxb.dev.java.net
>