users@jaxb.java.net

Re: Custom mapping for Maps in JAXB

From: Leo Romanoff <romixlev_at_yahoo.com>
Date: Fri, 18 Jun 2010 03:51:32 -0700 (PDT)

Hi,


> Ah, that "ON MY OWN" is stating clearly what you'd like to have.
> My JAXB Tutorial adresses the topic in this section
> <https://jaxb.dev.java.net/tutorial/section_2_2_16_1-Elements-With-Any-Type.html#Elements%20With%20Any%20Type>.

OK. Now we're talking! ;-)


> I've actually used this technique, either to access "unknown" XML
> with the basic techniques, or even a two-level marshalling and
> unmarshalling process, when the "inner" structure can not be
> included in a generic XML schema defining the outer XML structure.

Cool! As far as I understand, JAXB would return a generic DOM tree for the
xsd:anyType elements.
Then I can process it on my own and convert into whatever structure I'd like
it to be.
Is there any way to integrate it a bit more tightly with the rest of JAXB
parsing? I mean, can I say:
"Do now directly return any raw DOM elements, but use first my custom
function to pre-process it". Then I could provide a function that would
convert an XML fragment into e.g. a Map and this map would be then stored in
my model, instead of raw DOM elements that need post-processing.
I guess something like this is probably possible, or?

Thanks,
  Leo
-- 
View this message in context: http://old.nabble.com/Custom-mapping-for-Maps-in-JAXB-tp28779221p28924739.html
Sent from the java.net - jaxb users mailing list archive at Nabble.com.