users@jaxb.java.net

RE: Re: Binder and dom customization

From: Petteri Stenius <Petteri.Stenius_at_ubisecure.com>
Date: Wed, 8 Nov 2006 12:43:19 +0200

Ok, thanks. I have filed this as issue #276.

Petteri

-----Original Message-----
From: Kohsuke Kawaguchi [mailto:Kohsuke.Kawaguchi_at_Sun.COM]
Sent: Wednesday, November 08, 2006 1:42 AM
To: users_at_jaxb.dev.java.net
Subject: Re: Binder and dom customization

Petteri Stenius wrote:
> Hi,
>
> Some of my Java interfaces return DOM objects as the result of anyType wildcard mapping or DOM customization.
>
> If I'm unmarshalling with Binder from a DOM document instance then it would be very nice if the returned DOM objects belonged to the original DOM document instance.

Interseting. That would be nice indeed. Can you file an RFE for this in http://jaxb.dev.java.net/issues/ ?

I think I might be able to do this.


> The following sample should make this request more clear. This is my schema fragment:
>
> <complexType name="RootType">
> <sequence>
> <element name="Wildcard">
> <annotation><appinfo><jaxb:dom/></appinfo></annotation>
> </element>
> </sequence>
> </complexType>
>
> The jaxb generated RootType interface defines an accessor method "Element getWildcard()".
>
> Now when I do this
>
> Document xml = documentBuilder.parse(input); Binder<Node> binder =
> jaxb.createBinder(); RootType root = binder.unmarshal(xml,
> RootType.class).getValue(); Element wildcard = root.getWildcard();
>
> What I'd like to see is root.getWildcard() return a DOM element from my original DOM instance. The following conditions for example should then be true:
> -- wildcard.getOwnerDocument() == xml
> -- wildcard.getParentNode() == binder.getXMLNode(root)
>
> An other option is to be able to use DOM elements as input to Binder.getXMLNode. Currently however getXMLNode returns null for DOM elements.
>
> Petteri
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
> For additional commands, e-mail: users-help_at_jaxb.dev.java.net
>
>


--
Kohsuke Kawaguchi
Sun Microsystems                   kohsuke.kawaguchi_at_sun.com