users@jaxb.java.net

RE: anyAttribute

From: Robert Lowe <rmlowe_at_rmlowe.com>
Date: Sun, 14 Dec 2003 19:41:12 +0800

In my case the schema is something like this:

   <xsd:element name="foo" type="fooType"/>
   <xsd:complexType name="fooType">
      <xsd:sequence>
         <xsd:element ref="bar"/>
         <xsd:element ref="baz"/>
      </xsd:sequence>
      <xsd:anyAttribute namespace="##other" processContents="strict"/>
   </xsd:complexType>

If I'm understanding correctly, currently the only way I can access the
attributes of a "foo" element is to bind the whole element to a DOM node; in
which case I'd also have to use the DOM API to access the "bar" and "baz"
elements and, recursively, all their children--hence losing all the
advantages of type-safety that I'd normally get from JAXB.

I guess what I'd like to be able to do is to bind "fooType" to something
like this:

public interface FooType {
    BarType getBar();
    void setBar(BarType value);
    BazType getBaz();
    void setBaz(BazType value);
    List getAnyAttribute();
}

That is, "anyAttribute" is bound to a list, much like "any" would be. I
guess the elements of the list would be instances of org.w3c.dom.Attr.

- Rob



-----Original Message-----
From: yuexiang [mailto:yxyang_at_jwcc.net]
Sent: Monday, December 01, 2003 9:01 AM
To: users_at_jaxb.dev.java.net
Subject: RE: anyAttribute


I am not sure the context of your problem is the same. In my case, my
schema has some any Node, for these nodes, my server side just pass
these data to the clients. So, basically, the server doesn't do
anything. The any elements can be client specific data.



On Sat, 2003-11-29 at 21:47, Robert Lowe wrote:
> Thanks Yuexiang, I guess you are talking about this:
>
>
http://java.sun.com/webservices/docs/1.3/jaxb/vendorCustomizations.html#dom
>
> So basically I can add a (RI-specific) customization that makes that
> particular element appear as a DOM node instead of a binding class
instance.
> And then I can access all that node's attributes.
>
> Too bad it has to affect the whole element. But I'm not sure what would be
a
> better solution.
>
>
>
> Best regards,
>
> Robert Lowe
> http://RMLowe.com/
>
>
>
> -----Original Message-----
> From: yuexiang [mailto:yxyang_at_jwcc.net]
> Sent: Saturday, November 29, 2003 9:31 AM
> To: users_at_jaxb.dev.java.net
> Subject: Re: anyAttribute
>
>
> the RI (reference implementation) supports it by using DOM object.
>
> See vendor specific features.
>
>
> On Fri, 2003-11-28 at 21:04, Robert Lowe wrote:
> > Does the standard implementation have any support for the W3C schema's
> > "anyAttribute" construct?
> >
> > I know it's not required by the spec, but I was wondering if there was
any
> > support in the SI? Or if there are any plans to support it?
> >
> >
> > Best regards,
> >
> > Robert Lowe
> > http://RMLowe.com/
> >
> >
> >
> > ---------------------------------------------------------------------
> > 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
>


---------------------------------------------------------------------
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