Title: Message
Like I said in my previous post, in the current incarnation of XMLSchema there is _no difference_ between declaring groups as reference to named groups vs declaring them inline, so the API reflects this and in no way does it mean XmlBeans can't handle that particular Schema. As far as checking the Schema for corectness, validation behavior, PSVI contributions and Java binding, that Schema is indeed supported fully. I think this point should be very clear.
 
But as far as the component model (which is a non-normative part of the spec) goes, things are less clear. Since it doesn't require us to make available name group references, we don't. To be sure, there are a lot of other pieces of information that we provide about the Schema model that aren't in the component model, this just isn't one of them. The fact that you can't get to all the annotations is the bigger problem here, and we need to address this (there are also other aspects of the component model that fall under the same category).
 
I didn't mean at all to minimize the importance of annotations, I am aware that applications need them, I was just referring to the group ref.
 
I have seen the enhancement request proposing new interfaces for model groups and have been meaning to comment on it, never got around to it. In any case, I think by now it's obvious that I am not a big fan of model groups :p
 
Here's an alternative way of handling your usecase until more comprehensive annotation information (and, just maybe, model group info too) becomes available:
Get the XmlObject representing the Schema and use XPath and/or the getters to navigate to the model groups and model group references you are interested in. In the "raw" Schema model, all the information is available, just as with any other XML file. This sounds to me like it may be easier than what you are currently doing.
 
Sorry for having to disagree so much,
Radu
 
-----Original Message-----
From: Mike Skells [mailto:[EMAIL PROTECTED]
Sent: Thursday, October 13, 2005 2:36 PM
To: user@xmlbeans.apache.org
Subject: RE: [newbe] Navigation from SchemaType to the schema view of the model

Hi Radu,
The problem with using the SchemaModelGroup the that I see is there is no way to interrelate the elements that contain groups in the schema and the schema group itself
 
for instance
how do I determine which elements have groups?
if I know that an element has a group then how do I read the content of the group ( there is no getContnetModel on a SchemaModelGroup) 
 
 
I can understand the rationale for minimising the particle tree, but IMHO there needs to be an unminimised view available, maybe getOriginalContentModel(), that allows you to navigate the structure that is present in the schema, and relate this to the properties
 
I cannot see any other way to make the annotations not be distorted and lossy.One of the major attractions to me of using XmlBeans is the fll schema support. This is one of the USPs for XmlBeans (to quote the WhatMakesXMLBEans diffene ton the web site 'XML Schema oriented applications can take full advantage of the power of XML Schema and not have to restrict themselvs to a subset. ' I would hope that this includes the custom attributes as well ;-)
 
I fully understand, and agree that the existing behavior of the getContentModel should not chnage, after all most people are not use the annotations in groups, sequences choices etc, and they are relying on the functionallity that is present. I would guess that most users are not interested in the annotations at all.
 
The same issue relate to the use of attribute groups
 
------
 
Regarding being against the grain, I thaink that it depends on what the annotations represent. In my case the annotations determine the beharior of a UI that helps to generate the XML. If does not affect the XML that is generated, but for instance is indicated that a class specified in an attribute must implement an interface, or that when you are drilling down the tree view of the XML structure, which nodes are to be flattened in the UI and which are not. Al of the annotation are (currently) UI related.
 
When the annotation is in a group it may indicate that he content of the groups properties, when viewed, should be presents together, e.g. these are 'task management properties' and theses are 'routing', 'error handling etc'
 
I do not know what other people use the custom attributes for, and therfore cannot make comments as to whether other usage scanarios are approperiate
 
--------
 
In the system that I am useing the behavior is specified with significant groups of functionaillity specified in the attribute groups and model groups, to promote reuse
 
I have filed an enhancement request to expose the 'functionallity' /commonallity as additional interfaces
 
------
 
For the moment as a hack :-
 
I pre-process the schemas xml to add additional top level elements that just include the groups (one for each) and move the annotations to the global element. ( I am pre-processing the schemas before passing to scomp as they contain other struvture that scmp is not happy with, such as elements with minOccurs=0)
 
I insert custom annotations to the elements that include groups them to show that they include the groups
 
Currently I manually associate (hard coded) the synthetic elements (representing groups) with the elements that contain then by scanning for the custom attributes, hopefully this will be replaced by xmlbeans implementing an interface, or fialing that AOP dependency injection of the interface
 
A similar process operates for attribute groups
 
This is far from ideal :-((
 
Mike
 
 
 


From: Radu Preotiuc-Pietro [mailto:[EMAIL PROTECTED]
Sent: 13 October 2005 21:08
To: user@xmlbeans.apache.org
Subject: RE: [newbe] Navigation from SchemaType to the schema view of the model

Mike,
You are right about all three points below. However, in XMLSchema there is _no difference_ (as far as the resulting Schema components) between referring to a model group definition and including the same particles inline, so the API reflects this. You can get to model groups separately using SchemaTypeSystem.modelGroups() to check what model groups were defined and what annotations they had on them, but specifiying different behavior for the case where there is a model group ref is going against the grain of the spec IMO.
 
Point 1. about pointless particles is debatable, removing them upfront makes things a lot simpler and there is so much code depending on the fact that they have been removed that I don't think that it is practical to change it at this point.
 
But we should make annotations on the particle accessible.
 
Radu
-----Original Message-----
From: Mike Skells [mailto:[EMAIL PROTECTED]
Sent: Friday, October 07, 2005 1:00 AM
To: user@xmlbeans.apache.org
Subject: RE: [newbe] Navigation from SchemaType to the schema view of the model

Hi Laurance,
Thanks for the quick reply, however this is not the solution.
This does not give access to the groups, or attribute groups, as they appear to be removed for the model.
 
Attribute and attribute groups are not part of the content model of the SchemaType
Groups are removed from the content model.
 
Further than that I see that
1. the SchemaParticle has already had 'pointless particles' removed (which also gets rid of these annotations)
2. it doesnt include groups (which gets rid of these annotations)
3. the SchemaParticle does not implement SchemaAnnotated, so that the annotations on the particle are not accessable
 
 
 
Mike


From: Lawrence Jones [mailto:[EMAIL PROTECTED]
Sent: 06 October 2005 23:11
To: user@xmlbeans.apache.org
Subject: RE: [newbe] Navigation from SchemaType to the schema view of the model

Hi Mike

 

There have been a number of discussions on this before. It is not altogether obvious and a JIRA (http://issues.apache.org/jira/browse/XMLBEANS-195) has been raised to look into making it much easier but in the meantime these email threads should help:

 

http://mail-archives.apache.org/mod_mbox/xmlbeans-user/200509.mbox/[EMAIL PROTECTED]

 

http://mail-archives.apache.org/mod_mbox/xmlbeans-user/200508.mbox/[EMAIL PROTECTED]

 

http://mail-archives.apache.org/mod_mbox/xmlbeans-user/200507.mbox/[EMAIL PROTECTED]

 

Cheers,

 

Lawrence

 


From: Mike Skells [mailto:[EMAIL PROTECTED]
Sent: Thursday, October 06, 2005 2:48 PM
To: user@xmlbeans.apache.org
Subject: [newbe] Navigation from SchemaType to the schema view of the model

 

hi,

I am working with a schema where I need to access the actual structure of the schema. I need to retrieve information from the custom annotations of, for instance the attribyute groups and the groups. 

 

So stating from a SchemaType that represents a complex type, how should I navigate to the SchemaLocalElement or SchemaGlobalElement

 

Also once at a SchemaLocalElement how can I access the content model, to retrieve an annotation on a contained group

(I cannot use the content model of the SchemaType as that has already folded the group into the parent model)

 

The same issues relate to attribute groups etc.

 

I feel like I am missing the plot somewhere

 

 

Mike

Reply via email to