Adding XSD components to an existing schema [message #591232] |
Wed, 01 September 2004 21:27 |
Gary J Messages: 61 Registered: July 2009 |
Member |
|
|
Hi,
I want to add a Simple Element declaration to a ModelGroup (sequence). What
I have is the XSDModelGroup object (modelGroup) and the name of the element.
Do I have enough information to add this element or do I need to start with
the Particle of the ModelGroup?
For instance:
void addElementToGroup(XSDModelGroup modelGroup, String elementName)
{
// user defined function
XSDParticle particle = newXSDElement(elementName, 0, 1);
// add new Element to model group
modelGroup.getContents().add(particle);
}
Is this enough to update my XSD model or is there something else I need to
do?
Also, in my tree model I'm only storing XSDModelGroup and
XSDElementDeclaration objects. Should I perhaps store the Particles of each
instead or is there a way to determine the "parent" particle from these?
In this example I'm updating the concrete schema. I assume the abstract
representation will work as well after this update. Is that correct?
I hope I'm not being too cryptic.
thanks
Gary
|
|
|
Powered by
FUDForum. Page generated in 0.02087 seconds