logo       

RE: Problems trying to use annotation support in v2: msg#00120

text.xml.xmlbeans.user

Subject: RE: Problems trying to use annotation support in v2

I don't think so, but there is a difference between having the annotation on
the type and on the element. Yours is on the element, in particular
SchemaLocalElement also implements SchemaAnnotated (via SchemaField) and that's
where you need to get the annotation from. Otherwise, if you had both an
annotation on the element (like in your example) and on the type (like your
modified version) how would you get to both of them?

Radu

-----Original Message-----
From: Jim McMaster [mailto:jim.mcmaster@xxxxxxxxxxx]
Sent: Wednesday, January 19, 2005 2:46 PM
To: user@xxxxxxxxxxxxxxxxxxx
Subject: RE: Problems trying to use annotation support in v2



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Wednesday, January 19, 2005 1:04 PM, Jim McMaster
<mailto:jmcmaster@xxxxxxxxx> wrote:

> On Wed, 2005-01-19 at 11:31 -0800, Radu Preotiuc-Pietro wrote:
>> The "SchemaType for the name attribute"? I don't think you are
>> using the API correctly. Try getting the annotation off the "name"
>> element directly
> instead, since the element itself is annotated, not the type.
>>
>> Radu
>>
> I guess I should be more clear about my goal. I a not trying
> to read a
> document containing a category type. I am trying to create
> one. I want
> to read xs:appinfo elements in the schema to tell my program where
> to find the values (Class and Method to call) needed to write
> the xml file.
>
> It is very possible I am misreading the API documentation, and I
> would welcome any help in figuring this out. In metacode, here is
> what I am trying to do:
>
> 1) Load the main XmlBeans document class
> 2) Use XmlBeans.typeForClass() to get the Schema Type
> 3) If there is an appinfo element, process it
> 4) Use SchemaType.getProperties() to get all elements and
> attributes 5) For each property, recursively call 2)
>
> Is this the wrong approach? The way I read the doc, the
> annotation is a
> property of the SchemaType, which implements SchemaAnnotated,
> not of the
> XmlObject. As I said, I would welcome and assistance.

Sorry to reply to myself, but I have an update on the problem. The
SchemaType seems to contain only annotations that are defined at the
top level of the schema. In my previous example, placing the
xs:annotation immediately under <category> works, but the occurrence
under <name> is ignored. Is this a bug in XmlBeans?

- --
Jim McMaster
mailto:jim.mcmaster@xxxxxxxxxxx


-----BEGIN PGP SIGNATURE-----
Version: PGP 8.1

iQA/AwUBQe7jI2aP5l7/atSJEQKtUgCfbqbKW1r962YzPYgTk+LC+vt8aQgAnjK4
6Vqy2iiH9buo09ymgmeLpNUq
=tV0l
-----END PGP SIGNATURE-----



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xxxxxxxxxxxxxxxxxxx
For additional commands, e-mail: user-help@xxxxxxxxxxxxxxxxxxx


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise