Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » XML Schema Definition (XSD) » Adding XSD components to an existing schema
Adding XSD components to an existing schema [message #52057] Wed, 01 September 2004 21:27 Go to next message
Eclipse UserFriend
Originally posted by: gj.puredge.com

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
Re: Adding XSD components to an existing schema [message #52084 is a reply to message #52057] Wed, 01 September 2004 21:37 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

Gary,

I've tried to make sure there is an example of how to construct pretty
much everything in XSDPrototypicalSchema.java. What you've outlined
makes sense and should be sufficient. Maybe storing the particles is
better because there can be many particles that have the same element
declaration (model group) as their term. But then again there is a
getContainer reference available for all concrete components, so maybe
that's enough for what you need. And yes, the abstract relations are
populated as you change the concrete ones.

If I couldn't handle cryptic, these newsgroups would have driven me
insane long ago! ;-)


Gary J wrote:

>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
>
>
>
>
Re: Adding XSD components to an existing schema [message #52109 is a reply to message #52084] Wed, 01 September 2004 22:13 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: gj.puredge.com

Thanks Ed,

XSDPrototypicalSchema was a big help.

To summarize the relationships in the concrete model:

elementParticle.getContent() returns the Element declaration
elementParticle.getTerm() returns the abstract Element declaration
elementDeclaration.getContainer() returns the concrete particle

Does the same hold true for a ModelGroup? In other words:

modelGroupParticle.getContent() returns the XSDModelGroup
modelGroupParticle.getTerm() returns the abstract model group
modelGroupDeclaration.getContainer() returns the concrete particle

That's why I would prefer to reference particles rather than
have a mix and match of different objects.




"Ed Merks" <merks@ca.ibm.com> wrote in message
news:ch5f8n$31u$1@eclipse.org...
Gary,

I've tried to make sure there is an example of how to construct pretty
much everything in XSDPrototypicalSchema.java. What you've outlined
makes sense and should be sufficient. Maybe storing the particles is
better because there can be many particles that have the same element
declaration (model group) as their term. But then again there is a
getContainer reference available for all concrete components, so maybe
that's enough for what you need. And yes, the abstract relations are
populated as you change the concrete ones.

If I couldn't handle cryptic, these newsgroups would have driven me
insane long ago! ;-)


Gary J wrote:

>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
>
>
>
>
Re: Adding XSD components to an existing schema [message #52809 is a reply to message #52109] Mon, 13 September 2004 12:02 Go to previous message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

This is a multi-part message in MIME format.
--------------060404060701090703060203
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

Gary,

Model groups work a little differently because there is a model group
definition component as well as a model group component. At the
concrete level you'll see a model group definition and at the abstract
level, you'll just see the model group.


Gary J wrote:

>Thanks Ed,
>
>XSDPrototypicalSchema was a big help.
>
>To summarize the relationships in the concrete model:
>
>elementParticle.getContent() returns the Element declaration
>elementParticle.getTerm() returns the abstract Element declaration
>elementDeclaration.getContainer() returns the concrete particle
>
>Does the same hold true for a ModelGroup? In other words:
>
>modelGroupParticle.getContent() returns the XSDModelGroup
>modelGroupParticle.getTerm() returns the abstract model group
>modelGroupDeclaration.getContainer() returns the concrete particle
>
>That's why I would prefer to reference particles rather than
>have a mix and match of different objects.
>
>
>
>
>"Ed Merks" <merks@ca.ibm.com> wrote in message
>news:ch5f8n$31u$1@eclipse.org...
>Gary,
>
>I've tried to make sure there is an example of how to construct pretty
>much everything in XSDPrototypicalSchema.java. What you've outlined
>makes sense and should be sufficient. Maybe storing the particles is
>better because there can be many particles that have the same element
>declaration (model group) as their term. But then again there is a
>getContainer reference available for all concrete components, so maybe
>that's enough for what you need. And yes, the abstract relations are
>populated as you change the concrete ones.
>
>If I couldn't handle cryptic, these newsgroups would have driven me
>insane long ago! ;-)
>
>
>Gary J wrote:
>
>
>
>>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
>>
>>
>>
>>
>>
>>
>
>
>
>


--------------060404060701090703060203
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Gary,<br>
<br>
Model groups work a little differently because there is a model group
definition component as well as a model group component.&nbsp; At the
concrete level you'll see a model group definition and at the abstract
level, you'll just see the model group.<br>
<br>
<br>
Gary J wrote:
<blockquote cite="midch5hbd$5vv$1@eclipse.org" type="cite">
<pre wrap="">Thanks Ed,

XSDPrototypicalSchema was a big help.

To summarize the relationships in the concrete model:

elementParticle.getContent() returns the Element declaration
elementParticle.getTerm() returns the abstract Element declaration
elementDeclaration.getContainer() returns the concrete particle

Does the same hold true for a ModelGroup? In other words:

modelGroupParticle.getContent() returns the XSDModelGroup
modelGroupParticle.getTerm() returns the abstract model group
modelGroupDeclaration.getContainer() returns the concrete particle

That's why I would prefer to reference particles rather than
have a mix and match of different objects.




"Ed Merks" <a class="moz-txt-link-rfc2396E" href="mailto:merks@ca.ibm.com">&lt;merks@ca.ibm.com&gt;</a> wrote in message
<a class="moz-txt-link-freetext" href="news:ch5f8n$31u$1@eclipse.org">news:ch5f8n$31u$1@eclipse.org</a>...
Gary,

I've tried to make sure there is an example of how to construct pretty
much everything in XSDPrototypicalSchema.java. What you've outlined
makes sense and should be sufficient. Maybe storing the particles is
better because there can be many particles that have the same element
declaration (model group) as their term. But then again there is a
getContainer reference available for all concrete components, so maybe
that's enough for what you need. And yes, the abstract relations are
populated as you change the concrete ones.

If I couldn't handle cryptic, these newsgroups would have driven me
insane long ago! ;-)


Gary J wrote:

</pre>
<blockquote type="cite">
<pre wrap="">Hi,

I want to add a Simple Element declaration to a ModelGroup (sequence).
</pre>
</blockquote>
<pre wrap=""><!---->What
</pre>
<blockquote type="cite">
<pre wrap="">I have is the XSDModelGroup object (modelGroup) and the name of the
</pre>
</blockquote>
<pre wrap=""><!---->element.
</pre>
<blockquote type="cite">
<pre wrap="">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
</pre>
</blockquote>
<pre wrap=""><!---->each
</pre>
<blockquote type="cite">
<pre wrap="">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




</pre>
</blockquote>
<pre wrap=""><!---->

</pre>
</blockquote>
<br>
</body>
</html>

--------------060404060701090703060203--
Re: Adding XSD components to an existing schema [message #591246 is a reply to message #52057] Wed, 01 September 2004 21:37 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33142
Registered: July 2009
Senior Member
Gary,

I've tried to make sure there is an example of how to construct pretty
much everything in XSDPrototypicalSchema.java. What you've outlined
makes sense and should be sufficient. Maybe storing the particles is
better because there can be many particles that have the same element
declaration (model group) as their term. But then again there is a
getContainer reference available for all concrete components, so maybe
that's enough for what you need. And yes, the abstract relations are
populated as you change the concrete ones.

If I couldn't handle cryptic, these newsgroups would have driven me
insane long ago! ;-)


Gary J wrote:

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


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Adding XSD components to an existing schema [message #591255 is a reply to message #52084] Wed, 01 September 2004 22:13 Go to previous message
Gary J is currently offline Gary JFriend
Messages: 61
Registered: July 2009
Member
Thanks Ed,

XSDPrototypicalSchema was a big help.

To summarize the relationships in the concrete model:

elementParticle.getContent() returns the Element declaration
elementParticle.getTerm() returns the abstract Element declaration
elementDeclaration.getContainer() returns the concrete particle

Does the same hold true for a ModelGroup? In other words:

modelGroupParticle.getContent() returns the XSDModelGroup
modelGroupParticle.getTerm() returns the abstract model group
modelGroupDeclaration.getContainer() returns the concrete particle

That's why I would prefer to reference particles rather than
have a mix and match of different objects.




"Ed Merks" <merks@ca.ibm.com> wrote in message
news:ch5f8n$31u$1@eclipse.org...
Gary,

I've tried to make sure there is an example of how to construct pretty
much everything in XSDPrototypicalSchema.java. What you've outlined
makes sense and should be sufficient. Maybe storing the particles is
better because there can be many particles that have the same element
declaration (model group) as their term. But then again there is a
getContainer reference available for all concrete components, so maybe
that's enough for what you need. And yes, the abstract relations are
populated as you change the concrete ones.

If I couldn't handle cryptic, these newsgroups would have driven me
insane long ago! ;-)


Gary J wrote:

>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
>
>
>
>
Re: Adding XSD components to an existing schema [message #591534 is a reply to message #52109] Mon, 13 September 2004 12:02 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33142
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------060404060701090703060203
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

Gary,

Model groups work a little differently because there is a model group
definition component as well as a model group component. At the
concrete level you'll see a model group definition and at the abstract
level, you'll just see the model group.


Gary J wrote:

>Thanks Ed,
>
>XSDPrototypicalSchema was a big help.
>
>To summarize the relationships in the concrete model:
>
>elementParticle.getContent() returns the Element declaration
>elementParticle.getTerm() returns the abstract Element declaration
>elementDeclaration.getContainer() returns the concrete particle
>
>Does the same hold true for a ModelGroup? In other words:
>
>modelGroupParticle.getContent() returns the XSDModelGroup
>modelGroupParticle.getTerm() returns the abstract model group
>modelGroupDeclaration.getContainer() returns the concrete particle
>
>That's why I would prefer to reference particles rather than
>have a mix and match of different objects.
>
>
>
>
>"Ed Merks" <merks@ca.ibm.com> wrote in message
>news:ch5f8n$31u$1@eclipse.org...
>Gary,
>
>I've tried to make sure there is an example of how to construct pretty
>much everything in XSDPrototypicalSchema.java. What you've outlined
>makes sense and should be sufficient. Maybe storing the particles is
>better because there can be many particles that have the same element
>declaration (model group) as their term. But then again there is a
>getContainer reference available for all concrete components, so maybe
>that's enough for what you need. And yes, the abstract relations are
>populated as you change the concrete ones.
>
>If I couldn't handle cryptic, these newsgroups would have driven me
>insane long ago! ;-)
>
>
>Gary J wrote:
>
>
>
>>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
>>
>>
>>
>>
>>
>>
>
>
>
>


--------------060404060701090703060203
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Gary,<br>
<br>
Model groups work a little differently because there is a model group
definition component as well as a model group component.&nbsp; At the
concrete level you'll see a model group definition and at the abstract
level, you'll just see the model group.<br>
<br>
<br>
Gary J wrote:
<blockquote cite="midch5hbd$5vv$1@eclipse.org" type="cite">
<pre wrap="">Thanks Ed,

XSDPrototypicalSchema was a big help.

To summarize the relationships in the concrete model:

elementParticle.getContent() returns the Element declaration
elementParticle.getTerm() returns the abstract Element declaration
elementDeclaration.getContainer() returns the concrete particle

Does the same hold true for a ModelGroup? In other words:

modelGroupParticle.getContent() returns the XSDModelGroup
modelGroupParticle.getTerm() returns the abstract model group
modelGroupDeclaration.getContainer() returns the concrete particle

That's why I would prefer to reference particles rather than
have a mix and match of different objects.




"Ed Merks" <a class="moz-txt-link-rfc2396E" href="mailto:merks@ca.ibm.com">&lt;merks@ca.ibm.com&gt;</a> wrote in message
<a class="moz-txt-link-freetext" href="news:ch5f8n$31u$1@eclipse.org">news:ch5f8n$31u$1@eclipse.org</a>...
Gary,

I've tried to make sure there is an example of how to construct pretty
much everything in XSDPrototypicalSchema.java. What you've outlined
makes sense and should be sufficient. Maybe storing the particles is
better because there can be many particles that have the same element
declaration (model group) as their term. But then again there is a
getContainer reference available for all concrete components, so maybe
that's enough for what you need. And yes, the abstract relations are
populated as you change the concrete ones.

If I couldn't handle cryptic, these newsgroups would have driven me
insane long ago! ;-)


Gary J wrote:

</pre>
<blockquote type="cite">
<pre wrap="">Hi,

I want to add a Simple Element declaration to a ModelGroup (sequence).
</pre>
</blockquote>
<pre wrap=""><!---->What
</pre>
<blockquote type="cite">
<pre wrap="">I have is the XSDModelGroup object (modelGroup) and the name of the
</pre>
</blockquote>
<pre wrap=""><!---->element.
</pre>
<blockquote type="cite">
<pre wrap="">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
</pre>
</blockquote>
<pre wrap=""><!---->each
</pre>
<blockquote type="cite">
<pre wrap="">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




</pre>
</blockquote>
<pre wrap=""><!---->

</pre>
</blockquote>
<br>
</body>
</html>

--------------060404060701090703060203--


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:HowTo reference definitions in multiple schemas
Next Topic:maxlength value missing
Goto Forum:
  


Current Time: Fri Apr 26 11:00:54 GMT 2024

Powered by FUDForum. Page generated in 0.03123 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top