Home » Archived » XML Schema Definition (XSD) » How to get resolvedModelGroupDefinition()?
How to get resolvedModelGroupDefinition()? [message #53312] |
Mon, 27 September 2004 02:53  |
Eclipse User |
|
|
|
Originally posted by: annasser.breathe.com
Hi,
I have got an XSD Schema which has only one model group definition given
below:
...other elements .....
<group name = "XYZ">
<sequence>
<element name = "A" type = "sd:String" />
<element name = "B" type = "xsd:String" />
</sequence>
</group>
......other elements .....
The above group definition is used by various elements by means of a Ref.
For example:
<complexType name = "PQ" >
<sequnec>
<group ref ="xsd:XYZ" />
<element name = "C" type = "someType" />
</sequence>
<element name = "Me" type = "PQ" />
I want to list element named "Me" as the Parent and its children which are
elements "A,B, and C", any help!!!
/Anne
|
|
| |
Re: How to get resolvedModelGroupDefinition()? [message #53551 is a reply to message #53420] |
Mon, 27 September 2004 20:39   |
Eclipse User |
|
|
|
Originally posted by: annasser.breathe.com
Marks,
This is what I have done:
Void getChildren(XSDElementDeclaration element)
{
XSDComplexTypeDefinition xType =
(XSDComplexTypeDefinition)element.getTypeDefinition();
XSDParticle particle = (XSDParticle)xType.getContentType();
XSDTerm term = parcticle.getTerm();
if ( term instanmceof XSDModelGroup){ // Do some processing }
else if ( term instanceof XSDElementDeclaration){ //Do some Processing }
else if ( term instanceof XSDModelGroupDefinition)
{
XSDModelGroupDefinition group = (XSDModelGroupXDefinition)term;
XSDModelGroup mGroup = group.getResolvedModelGroupDefinition();
// Process the model group particles as a recursive call
else { // Do some thing }
}
}
The rest works fine but I cannot get the elements declared in the group
named "XYZ" as part of the "PQ"'s model group.
HOW DO I analyse [ <group ref ="xsd:XYZ" /> ] declaration.
Thanks,
/anne
Ed Merks wrote:
> Anne,
> If you look only at XSDParticle.getTerm, you should see only the
> resolved model groups, element declarations, or wildcards.
> Anne wrote:
> >Hi,
> >
> >I have got an XSD Schema which has only one model group definition given
> >below:
> >
> > ...other elements .....
> ><group name = "XYZ">
> > <sequence>
> > <element name = "A" type = "sd:String" />
> > <element name = "B" type = "xsd:String" />
> > </sequence>
> ></group>
> >.....other elements .....
> >
> >The above group definition is used by various elements by means of a Ref.
> >
> >For example:
> >
> ><complexType name = "PQ" >
> ><sequnec>
> > <group ref ="xsd:XYZ" />
> > <element name = "C" type = "someType" />
> ></sequence>
> >
> ><element name = "Me" type = "PQ" />
> >
> >I want to list element named "Me" as the Parent and its children which are
> >elements "A,B, and C", any help!!!
> >
> >/Anne
> >
> >
> >
> >
> >
> >
> >
> >
|
|
|
Re: How to get resolvedModelGroupDefinition()? [message #53606 is a reply to message #53551] |
Tue, 28 September 2004 07:10  |
Eclipse User |
|
|
|
Originally posted by: merks.ca.ibm.com
This is a multi-part message in MIME format.
--------------030508010805090105050706
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit
Anne,
Since XSDParticle.getTerm can only return an XSDWildcard, XSDModelGroup,
or XSDElementDeclaration, you shouldn't need an XSDModelGroupDefinition
case. I would expect that your case for XSDModelGroup will need to
process its contents recursively via XSDModelGroup.getParticles.
Anne wrote:
>Marks,
>
>This is what I have done:
>Void getChildren(XSDElementDeclaration element)
>{
>
>XSDComplexTypeDefinition xType =
>(XSDComplexTypeDefinition)element.getTypeDefinition();
>XSDParticle particle = (XSDParticle)xType.getContentType();
>XSDTerm term = parcticle.getTerm();
>
>if ( term instanmceof XSDModelGroup){ // Do some processing }
>else if ( term instanceof XSDElementDeclaration){ //Do some Processing }
>else if ( term instanceof XSDModelGroupDefinition)
>{
> XSDModelGroupDefinition group = (XSDModelGroupXDefinition)term;
> XSDModelGroup mGroup = group.getResolvedModelGroupDefinition();
> // Process the model group particles as a recursive call
>else { // Do some thing }
>}
>
>}
>
>The rest works fine but I cannot get the elements declared in the group
>named "XYZ" as part of the "PQ"'s model group.
>
>HOW DO I analyse [ <group ref ="xsd:XYZ" /> ] declaration.
>
>Thanks,
>
>/anne
>
>
>Ed Merks wrote:
>
>
>
>>Anne,
>>
>>
>
>
>
>>If you look only at XSDParticle.getTerm, you should see only the
>>resolved model groups, element declarations, or wildcards.
>>
>>
>
>
>
>
>>Anne wrote:
>>
>>
>
>
>
>>>Hi,
>>>
>>>I have got an XSD Schema which has only one model group definition given
>>>below:
>>>
>>>...other elements .....
>>><group name = "XYZ">
>>> <sequence>
>>> <element name = "A" type = "sd:String" />
>>> <element name = "B" type = "xsd:String" />
>>> </sequence>
>>></group>
>>>.....other elements .....
>>>
>>>The above group definition is used by various elements by means of a Ref.
>>>
>>>For example:
>>>
>>><complexType name = "PQ" >
>>><sequnec>
>>> <group ref ="xsd:XYZ" />
>>> <element name = "C" type = "someType" />
>>></sequence>
>>>
>>><element name = "Me" type = "PQ" />
>>>
>>>I want to list element named "Me" as the Parent and its children which are
>>>elements "A,B, and C", any help!!!
>>>
>>>/Anne
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>
>
>
>
--------------030508010805090105050706
Content-Type: text/html; charset=ISO-8859-15
Content-Transfer-Encoding: 8bit
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-15"
http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Anne,<br>
<br>
Since XSDParticle.getTerm can only return an XSDWildcard,
XSDModelGroup, or XSDElementDeclaration, you shouldn't need an
XSDModelGroupDefinition case.
|
|
|
Re: How to get resolvedModelGroupDefinition()? [message #591772 is a reply to message #53312] |
Mon, 27 September 2004 08:03  |
Eclipse User |
|
|
|
Anne,
If you look only at XSDParticle.getTerm, you should see only the
resolved model groups, element declarations, or wildcards.
Anne wrote:
>Hi,
>
>I have got an XSD Schema which has only one model group definition given
>below:
>
> ...other elements .....
><group name = "XYZ">
> <sequence>
> <element name = "A" type = "sd:String" />
> <element name = "B" type = "xsd:String" />
> </sequence>
></group>
>.....other elements .....
>
>The above group definition is used by various elements by means of a Ref.
>
>For example:
>
><complexType name = "PQ" >
><sequnec>
> <group ref ="xsd:XYZ" />
> <element name = "C" type = "someType" />
></sequence>
>
><element name = "Me" type = "PQ" />
>
>I want to list element named "Me" as the Parent and its children which are
>elements "A,B, and C", any help!!!
>
>/Anne
>
>
>
>
>
>
>
>
|
|
|
Re: How to get resolvedModelGroupDefinition()? [message #591849 is a reply to message #53420] |
Mon, 27 September 2004 20:39  |
Eclipse User |
|
|
|
Marks,
This is what I have done:
Void getChildren(XSDElementDeclaration element)
{
XSDComplexTypeDefinition xType =
(XSDComplexTypeDefinition)element.getTypeDefinition();
XSDParticle particle = (XSDParticle)xType.getContentType();
XSDTerm term = parcticle.getTerm();
if ( term instanmceof XSDModelGroup){ // Do some processing }
else if ( term instanceof XSDElementDeclaration){ //Do some Processing }
else if ( term instanceof XSDModelGroupDefinition)
{
XSDModelGroupDefinition group = (XSDModelGroupXDefinition)term;
XSDModelGroup mGroup = group.getResolvedModelGroupDefinition();
// Process the model group particles as a recursive call
else { // Do some thing }
}
}
The rest works fine but I cannot get the elements declared in the group
named "XYZ" as part of the "PQ"'s model group.
HOW DO I analyse [ <group ref ="xsd:XYZ" /> ] declaration.
Thanks,
/anne
Ed Merks wrote:
> Anne,
> If you look only at XSDParticle.getTerm, you should see only the
> resolved model groups, element declarations, or wildcards.
> Anne wrote:
> >Hi,
> >
> >I have got an XSD Schema which has only one model group definition given
> >below:
> >
> > ...other elements .....
> ><group name = "XYZ">
> > <sequence>
> > <element name = "A" type = "sd:String" />
> > <element name = "B" type = "xsd:String" />
> > </sequence>
> ></group>
> >.....other elements .....
> >
> >The above group definition is used by various elements by means of a Ref.
> >
> >For example:
> >
> ><complexType name = "PQ" >
> ><sequnec>
> > <group ref ="xsd:XYZ" />
> > <element name = "C" type = "someType" />
> ></sequence>
> >
> ><element name = "Me" type = "PQ" />
> >
> >I want to list element named "Me" as the Parent and its children which are
> >elements "A,B, and C", any help!!!
> >
> >/Anne
> >
> >
> >
> >
> >
> >
> >
> >
|
|
|
Re: How to get resolvedModelGroupDefinition()? [message #591884 is a reply to message #53551] |
Tue, 28 September 2004 07:10  |
Eclipse User |
|
|
|
This is a multi-part message in MIME format.
--------------030508010805090105050706
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit
Anne,
Since XSDParticle.getTerm can only return an XSDWildcard, XSDModelGroup,
or XSDElementDeclaration, you shouldn't need an XSDModelGroupDefinition
case. I would expect that your case for XSDModelGroup will need to
process its contents recursively via XSDModelGroup.getParticles.
Anne wrote:
>Marks,
>
>This is what I have done:
>Void getChildren(XSDElementDeclaration element)
>{
>
>XSDComplexTypeDefinition xType =
>(XSDComplexTypeDefinition)element.getTypeDefinition();
>XSDParticle particle = (XSDParticle)xType.getContentType();
>XSDTerm term = parcticle.getTerm();
>
>if ( term instanmceof XSDModelGroup){ // Do some processing }
>else if ( term instanceof XSDElementDeclaration){ //Do some Processing }
>else if ( term instanceof XSDModelGroupDefinition)
>{
> XSDModelGroupDefinition group = (XSDModelGroupXDefinition)term;
> XSDModelGroup mGroup = group.getResolvedModelGroupDefinition();
> // Process the model group particles as a recursive call
>else { // Do some thing }
>}
>
>}
>
>The rest works fine but I cannot get the elements declared in the group
>named "XYZ" as part of the "PQ"'s model group.
>
>HOW DO I analyse [ <group ref ="xsd:XYZ" /> ] declaration.
>
>Thanks,
>
>/anne
>
>
>Ed Merks wrote:
>
>
>
>>Anne,
>>
>>
>
>
>
>>If you look only at XSDParticle.getTerm, you should see only the
>>resolved model groups, element declarations, or wildcards.
>>
>>
>
>
>
>
>>Anne wrote:
>>
>>
>
>
>
>>>Hi,
>>>
>>>I have got an XSD Schema which has only one model group definition given
>>>below:
>>>
>>>...other elements .....
>>><group name = "XYZ">
>>> <sequence>
>>> <element name = "A" type = "sd:String" />
>>> <element name = "B" type = "xsd:String" />
>>> </sequence>
>>></group>
>>>.....other elements .....
>>>
>>>The above group definition is used by various elements by means of a Ref.
>>>
>>>For example:
>>>
>>><complexType name = "PQ" >
>>><sequnec>
>>> <group ref ="xsd:XYZ" />
>>> <element name = "C" type = "someType" />
>>></sequence>
>>>
>>><element name = "Me" type = "PQ" />
>>>
>>>I want to list element named "Me" as the Parent and its children which are
>>>elements "A,B, and C", any help!!!
>>>
>>>/Anne
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>
>
>
>
--------------030508010805090105050706
Content-Type: text/html; charset=ISO-8859-15
Content-Transfer-Encoding: 8bit
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-15"
http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Anne,<br>
<br>
Since XSDParticle.getTerm can only return an XSDWildcard,
XSDModelGroup, or XSDElementDeclaration, you shouldn't need an
XSDModelGroupDefinition case.
|
|
|
Goto Forum:
Current Time: Tue May 13 06:57:10 EDT 2025
Powered by FUDForum. Page generated in 0.03611 seconds
|