Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » XML Schema Definition (XSD) » short question on minOccurs and maxOccurs on XSDElementDeclaration
short question on minOccurs and maxOccurs on XSDElementDeclaration [message #41823] Tue, 20 April 2004 11:51 Go to next message
Joachim Lusiardi is currently offline Joachim LusiardiFriend
Messages: 18
Registered: July 2009
Junior Member
hello,
i have the following xml schema snippet:

<xs:element name="vorname" type="xs:string" maxOccurs="4"/>

how do i get the maxOccurs from the XSDElementDeclaration?
Or do i have to think it real over?
greets
Joachim Lusiardi
Re: short question on minOccurs and maxOccurs on XSDElementDeclaration [message #41884 is a reply to message #41823] Tue, 20 April 2004 15:05 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

Joachim,

The maxOccurs attribute is on the XSDParticle not on the
XSDElementDeclaration.


Joachim Lusiardi wrote:

> hello,
> i have the following xml schema snippet:
>
> <xs:element name="vorname" type="xs:string" maxOccurs="4"/>
>
> how do i get the maxOccurs from the XSDElementDeclaration?
> Or do i have to think it real over?
> greets
> Joachim Lusiardi
Re: short question on minOccurs and maxOccurs on XSDElementDeclaration [message #42003 is a reply to message #41884] Tue, 20 April 2004 20:15 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: joachim.lusiardi.web.de

Hello again,
sorry for the question, but a can't find any method to access this
XSDParticle directly. org.eclipse.emf.ecore.EObject.eContainer returns
an XSDParticle if i have min- or maxOccurs set. Wouldn't in be better to
have a method to return the XSDParticle or null if there is no XSDParticle?
Greetz
Joachim


Ed Merks wrote:

> Joachim,
>
> The maxOccurs attribute is on the XSDParticle not on the
> XSDElementDeclaration.
>
>
> Joachim Lusiardi wrote:
>
>
>> hello,
>> i have the following xml schema snippet:
>>
>> <xs:element name="vorname" type="xs:string" maxOccurs="4"/>
>>
>> how do i get the maxOccurs from the XSDElementDeclaration?
>> Or do i have to think it real over?
>> greets
>> Joachim Lusiardi
>
>
>
Re: short question on minOccurs and maxOccurs on XSDElementDeclaration [message #42034 is a reply to message #42003] Tue, 20 April 2004 20:39 Go to previous message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

Joachim,

In general I do not like to have named "container" references unless there is
only one possible container because many things can be contained in many
different places so you would tend to have a lot of container references where
only one can be non-null at any point in time. An element can be contained by
a schema or by a particle, so there aren't so many for this case, but for
something like a simple type, there are many more possible containers, i.e., a
schema, a simple type, a complex type, an element, an attribute, a redefine...

If xsdElementDeclaration.isGlobal is false xsdElementDeclaration.getContainer()
will be an XSDParticle.


joachim lusiardi wrote:

> Hello again,
> sorry for the question, but a can't find any method to access this
> XSDParticle directly. org.eclipse.emf.ecore.EObject.eContainer returns
> an XSDParticle if i have min- or maxOccurs set. Wouldn't in be better to
> have a method to return the XSDParticle or null if there is no XSDParticle?
> Greetz
> Joachim
>
> Ed Merks wrote:
>
> > Joachim,
> >
> > The maxOccurs attribute is on the XSDParticle not on the
> > XSDElementDeclaration.
> >
> >
> > Joachim Lusiardi wrote:
> >
> >
> >> hello,
> >> i have the following xml schema snippet:
> >>
> >> <xs:element name="vorname" type="xs:string" maxOccurs="4"/>
> >>
> >> how do i get the maxOccurs from the XSDElementDeclaration?
> >> Or do i have to think it real over?
> >> greets
> >> Joachim Lusiardi
> >
> >
> >
Re: short question on minOccurs and maxOccurs on XSDElementDeclaration [message #585838 is a reply to message #41823] Tue, 20 April 2004 15:05 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33139
Registered: July 2009
Senior Member
Joachim,

The maxOccurs attribute is on the XSDParticle not on the
XSDElementDeclaration.


Joachim Lusiardi wrote:

> hello,
> i have the following xml schema snippet:
>
> <xs:element name="vorname" type="xs:string" maxOccurs="4"/>
>
> how do i get the maxOccurs from the XSDElementDeclaration?
> Or do i have to think it real over?
> greets
> Joachim Lusiardi


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: short question on minOccurs and maxOccurs on XSDElementDeclaration [message #585900 is a reply to message #41884] Tue, 20 April 2004 20:15 Go to previous message
Eclipse UserFriend
Originally posted by: joachim.lusiardi.web.de

Hello again,
sorry for the question, but a can't find any method to access this
XSDParticle directly. org.eclipse.emf.ecore.EObject.eContainer returns
an XSDParticle if i have min- or maxOccurs set. Wouldn't in be better to
have a method to return the XSDParticle or null if there is no XSDParticle?
Greetz
Joachim


Ed Merks wrote:

> Joachim,
>
> The maxOccurs attribute is on the XSDParticle not on the
> XSDElementDeclaration.
>
>
> Joachim Lusiardi wrote:
>
>
>> hello,
>> i have the following xml schema snippet:
>>
>> <xs:element name="vorname" type="xs:string" maxOccurs="4"/>
>>
>> how do i get the maxOccurs from the XSDElementDeclaration?
>> Or do i have to think it real over?
>> greets
>> Joachim Lusiardi
>
>
>
Re: short question on minOccurs and maxOccurs on XSDElementDeclaration [message #585912 is a reply to message #42003] Tue, 20 April 2004 20:39 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33139
Registered: July 2009
Senior Member
Joachim,

In general I do not like to have named "container" references unless there is
only one possible container because many things can be contained in many
different places so you would tend to have a lot of container references where
only one can be non-null at any point in time. An element can be contained by
a schema or by a particle, so there aren't so many for this case, but for
something like a simple type, there are many more possible containers, i.e., a
schema, a simple type, a complex type, an element, an attribute, a redefine...

If xsdElementDeclaration.isGlobal is false xsdElementDeclaration.getContainer()
will be an XSDParticle.


joachim lusiardi wrote:

> Hello again,
> sorry for the question, but a can't find any method to access this
> XSDParticle directly. org.eclipse.emf.ecore.EObject.eContainer returns
> an XSDParticle if i have min- or maxOccurs set. Wouldn't in be better to
> have a method to return the XSDParticle or null if there is no XSDParticle?
> Greetz
> Joachim
>
> Ed Merks wrote:
>
> > Joachim,
> >
> > The maxOccurs attribute is on the XSDParticle not on the
> > XSDElementDeclaration.
> >
> >
> > Joachim Lusiardi wrote:
> >
> >
> >> hello,
> >> i have the following xml schema snippet:
> >>
> >> <xs:element name="vorname" type="xs:string" maxOccurs="4"/>
> >>
> >> how do i get the maxOccurs from the XSDElementDeclaration?
> >> Or do i have to think it real over?
> >> greets
> >> Joachim Lusiardi
> >
> >
> >


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:Processing complexTypes derived by extension
Next Topic:XsdValidation
Goto Forum:
  


Current Time: Tue Apr 23 06:21:55 GMT 2024

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

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

Back to the top