Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » XML Schema Definition (XSD) » Help with ComplexTypes
Help with ComplexTypes [message #43365] Tue, 04 May 2004 19:19 Go to next message
Lance Phillips is currently offline Lance PhillipsFriend
Messages: 210
Registered: July 2009
Senior Member
I'm trying to create a complex type with simple content. I've copied the
creation logic as close to exactly as possible from the XsdProtypicalSchema.
However, when I write out my xsd it gets written out with complex content.
Any ideas? Here is my code block...

final XSDSimpleTypeDefinition xsdDt = resolveSimpleDatatype(eObject, value);
if (xsdDt != null) {

((XSDComplexTypeDefinition)eObject).setDerivationMethod(XSDD erivationMethod.
EXTENSION_LITERAL);
((XSDComplexTypeDefinition)eObject).setBaseTypeDefinition(xs dDt);
((XSDComplexTypeDefinition)eObject).setContent(xsdDt);
}

And here is the resulting ComplexType....
<xs:complexType abstract="false" mixed="false" name="gYearMonth">
<xs:complexContent>
<xs:extension base="xs:gYearMonth">
<xs:attributeGroup ref="Q1:commonAttributes"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>

thanks,

lp
Re: Help with ComplexTypes [message #43396 is a reply to message #43365] Tue, 04 May 2004 19:30 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

--------------FB882CCC9D80301CB79CFB57
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Lance,

You must do this from the example code in order to create the syntactic
<simpleContent> "scaffolding":

XSDSimpleTypeDefinition anonymousSimpleTypeDefinition =
xsdFactory.createXSDSimpleTypeDefinition();
simpleContentComplexTypeDefinition.setContent(anonymousSimpl eTypeDefinition);

Lance Phillips wrote:

> I'm trying to create a complex type with simple content. I've copied the
> creation logic as close to exactly as possible from the XsdProtypicalSchema.
> However, when I write out my xsd it gets written out with complex content.
> Any ideas? Here is my code block...
>
> final XSDSimpleTypeDefinition xsdDt = resolveSimpleDatatype(eObject, value);
> if (xsdDt != null) {
>
> ((XSDComplexTypeDefinition)eObject).setDerivationMethod(XSDD erivationMethod.
> EXTENSION_LITERAL);
> ((XSDComplexTypeDefinition)eObject).setBaseTypeDefinition(xs dDt);
> ((XSDComplexTypeDefinition)eObject).setContent(xsdDt);
> }
>
> And here is the resulting ComplexType....
> <xs:complexType abstract="false" mixed="false" name="gYearMonth">
> <xs:complexContent>
> <xs:extension base="xs:gYearMonth">
> <xs:attributeGroup ref="Q1:commonAttributes"/>
> </xs:extension>
> </xs:complexContent>
> </xs:complexType>
>
> thanks,
>
> lp

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

<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
Lance,
<p>You must do this from the example code in order to create the syntactic
&lt;simpleContent> "scaffolding":
<blockquote>XSDSimpleTypeDefinition anonymousSimpleTypeDefinition = xsdFactory.createXSDSimpleTypeDefinition();
<br> simpleContentComplexTypeDefinition.setContent(anonymousSimpl eTypeDefinition); </blockquote>

<p><br>Lance Phillips wrote:
<blockquote TYPE=CITE>I'm trying to create a complex type with simple content.&nbsp;
I've copied the
<br>creation logic as close to exactly as possible from the XsdProtypicalSchema.
<br>However, when I write out my xsd it gets written out with complex content.
<br>Any ideas?&nbsp; Here is my code block...
<p>final XSDSimpleTypeDefinition xsdDt = resolveSimpleDatatype(eObject,
value);
<br>if (xsdDt != null) {
<p> ((XSDComplexTypeDefinition)eObject).setDerivationMethod(XSDD erivationMethod.
<br>EXTENSION_LITERAL);
<br>&nbsp;&nbsp;&nbsp; ((XSDComplexTypeDefinition)eObject).setBaseTypeDefinition(xs dDt);
<br>&nbsp;&nbsp;&nbsp; ((XSDComplexTypeDefinition)eObject).setContent(xsdDt);
<br>}
<p>And here is the resulting ComplexType....
<br>&lt;xs:complexType abstract="false" mixed="false" name="gYearMonth">
<br>&nbsp;&nbsp;&nbsp; &lt;xs:complexContent>
<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &lt;xs:extension base="xs:gYearMonth">
<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;xs:attributeGroup ref="Q1:commonAttributes"/>
<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &lt;/xs:extension>
<br>&nbsp;&nbsp;&nbsp; &lt;/xs:complexContent>
<br>&lt;/xs:complexType>
<p>thanks,
<p>lp</blockquote>
</html>

--------------FB882CCC9D80301CB79CFB57--
Re: Help with ComplexTypes [message #43425 is a reply to message #43396] Tue, 04 May 2004 21:20 Go to previous message
Lance Phillips is currently offline Lance PhillipsFriend
Messages: 210
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.

------=_NextPart_000_000B_01C431F3.B1985160
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

thanks Ed... that worked.
"Ed Merks" <merks@ca.ibm.com> wrote in message =
news:4097EF47.80254ED4@ca.ibm.com...
Lance,=20
You must do this from the example code in order to create the =
syntactic <simpleContent> "scaffolding":=20

XSDSimpleTypeDefinition anonymousSimpleTypeDefinition =3D =
xsdFactory.createXSDSimpleTypeDefinition();=20
=
simpleContentComplexTypeDefinition.setContent(anonymousSimpl eTypeDefiniti=
on);

Lance Phillips wrote:=20

I'm trying to create a complex type with simple content. I've =
copied the=20
creation logic as close to exactly as possible from the =
XsdProtypicalSchema.=20
However, when I write out my xsd it gets written out with complex =
content.=20
Any ideas? Here is my code block...=20
final XSDSimpleTypeDefinition xsdDt =3D =
resolveSimpleDatatype(eObject, value);=20
if (xsdDt !=3D null) {=20

=
((XSDComplexTypeDefinition)eObject).setDerivationMethod(XSDD erivationMeth=
od.=20
EXTENSION_LITERAL);=20
=
((XSDComplexTypeDefinition)eObject).setBaseTypeDefinition(xs dDt);=20
((XSDComplexTypeDefinition)eObject).setContent(xsdDt);=20
}=20

And here is the resulting ComplexType....=20
<xs:complexType abstract=3D"false" mixed=3D"false" =
name=3D"gYearMonth">=20
<xs:complexContent>=20
<xs:extension base=3D"xs:gYearMonth">=20
<xs:attributeGroup ref=3D"Q1:commonAttributes"/>=20
</xs:extension>=20
</xs:complexContent>=20
</xs:complexType>=20

thanks,=20

lp

------=_NextPart_000_000B_01C431F3.B1985160
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2800.1400" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>thanks Ed... that worked.</FONT></DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Ed Merks" &lt;<A =
href=3D"mailto:merks@ca.ibm.com">merks@ca.ibm.com</A>&gt;=20
wrote in message <A=20
=
href=3D"news:4097EF47.80254ED4@ca.ibm.com">news:4097EF47.80254ED4@ca.ibm.=
com</A>...</DIV>Lance,=20

<P>You must do this from the example code in order to create the =
syntactic=20
&lt;simpleContent&gt; "scaffolding":=20
<BLOCKQUOTE>XSDSimpleTypeDefinition anonymousSimpleTypeDefinition =3D=20
xsdFactory.createXSDSimpleTypeDefinition();=20
=
<BR> simpleContentComplexTypeDefinition.setContent(anonymousSimpl eTypeDefi=
nition);</BLOCKQUOTE>
<P><BR>Lance Phillips wrote:=20
<BLOCKQUOTE TYPE=3D"CITE">I'm trying to create a complex type with =
simple=20
content.&nbsp; I've copied the <BR>creation logic as close to =
exactly as=20
possible from the XsdProtypicalSchema. <BR>However, when I write out =
my xsd=20
it gets written out with complex content. <BR>Any ideas?&nbsp; Here =
is my=20
code block...=20
<P>final XSDSimpleTypeDefinition xsdDt =3D =
resolveSimpleDatatype(eObject,=20
value); <BR>if (xsdDt !=3D null) {=20
=
<P> ((XSDComplexTypeDefinition)eObject).setDerivationMethod(XSDD erivationM=
ethod.=20
<BR>EXTENSION_LITERAL); <BR>&nbsp;&nbsp;&nbsp;=20
((XSDComplexTypeDefinition)eObject).setBaseTypeDefinition(xs dDt);=20
<BR>&nbsp;&nbsp;&nbsp;=20
((XSDComplexTypeDefinition)eObject).setContent(xsdDt); <BR>}=20
<P>And here is the resulting ComplexType.... <BR>&lt;xs:complexType=20
abstract=3D"false" mixed=3D"false" name=3D"gYearMonth"&gt; =
<BR>&nbsp;&nbsp;&nbsp;=20
&lt;xs:complexContent&gt; =
<BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;=20
&lt;xs:extension base=3D"xs:gYearMonth"&gt;=20
=
<BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
&lt;xs:attributeGroup ref=3D"Q1:commonAttributes"/&gt;=20
<BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &lt;/xs:extension&gt; =

<BR>&nbsp;&nbsp;&nbsp; &lt;/xs:complexContent&gt;=20
<BR>&lt;/xs:complexType&gt;=20
<P>thanks,=20
<P>lp</P></BLOCKQUOTE></BLOCKQUOTE></BODY></HTML>

------=_NextPart_000_000B_01C431F3.B1985160--
Re: Help with ComplexTypes [message #586622 is a reply to message #43365] Tue, 04 May 2004 19:30 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33136
Registered: July 2009
Senior Member
--------------FB882CCC9D80301CB79CFB57
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Lance,

You must do this from the example code in order to create the syntactic
<simpleContent> "scaffolding":

XSDSimpleTypeDefinition anonymousSimpleTypeDefinition =
xsdFactory.createXSDSimpleTypeDefinition();
simpleContentComplexTypeDefinition.setContent(anonymousSimpl eTypeDefinition);

Lance Phillips wrote:

> I'm trying to create a complex type with simple content. I've copied the
> creation logic as close to exactly as possible from the XsdProtypicalSchema.
> However, when I write out my xsd it gets written out with complex content.
> Any ideas? Here is my code block...
>
> final XSDSimpleTypeDefinition xsdDt = resolveSimpleDatatype(eObject, value);
> if (xsdDt != null) {
>
> ((XSDComplexTypeDefinition)eObject).setDerivationMethod(XSDD erivationMethod.
> EXTENSION_LITERAL);
> ((XSDComplexTypeDefinition)eObject).setBaseTypeDefinition(xs dDt);
> ((XSDComplexTypeDefinition)eObject).setContent(xsdDt);
> }
>
> And here is the resulting ComplexType....
> <xs:complexType abstract="false" mixed="false" name="gYearMonth">
> <xs:complexContent>
> <xs:extension base="xs:gYearMonth">
> <xs:attributeGroup ref="Q1:commonAttributes"/>
> </xs:extension>
> </xs:complexContent>
> </xs:complexType>
>
> thanks,
>
> lp

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

<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
Lance,
<p>You must do this from the example code in order to create the syntactic
&lt;simpleContent> "scaffolding":
<blockquote>XSDSimpleTypeDefinition anonymousSimpleTypeDefinition = xsdFactory.createXSDSimpleTypeDefinition();
<br> simpleContentComplexTypeDefinition.setContent(anonymousSimpl eTypeDefinition); </blockquote>

<p><br>Lance Phillips wrote:
<blockquote TYPE=CITE>I'm trying to create a complex type with simple content.&nbsp;
I've copied the
<br>creation logic as close to exactly as possible from the XsdProtypicalSchema.
<br>However, when I write out my xsd it gets written out with complex content.
<br>Any ideas?&nbsp; Here is my code block...
<p>final XSDSimpleTypeDefinition xsdDt = resolveSimpleDatatype(eObject,
value);
<br>if (xsdDt != null) {
<p> ((XSDComplexTypeDefinition)eObject).setDerivationMethod(XSDD erivationMethod.
<br>EXTENSION_LITERAL);
<br>&nbsp;&nbsp;&nbsp; ((XSDComplexTypeDefinition)eObject).setBaseTypeDefinition(xs dDt);
<br>&nbsp;&nbsp;&nbsp; ((XSDComplexTypeDefinition)eObject).setContent(xsdDt);
<br>}
<p>And here is the resulting ComplexType....
<br>&lt;xs:complexType abstract="false" mixed="false" name="gYearMonth">
<br>&nbsp;&nbsp;&nbsp; &lt;xs:complexContent>
<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &lt;xs:extension base="xs:gYearMonth">
<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;xs:attributeGroup ref="Q1:commonAttributes"/>
<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &lt;/xs:extension>
<br>&nbsp;&nbsp;&nbsp; &lt;/xs:complexContent>
<br>&lt;/xs:complexType>
<p>thanks,
<p>lp</blockquote>
</html>

--------------FB882CCC9D80301CB79CFB57--


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Help with ComplexTypes [message #586636 is a reply to message #43396] Tue, 04 May 2004 21:20 Go to previous message
Lance Phillips is currently offline Lance PhillipsFriend
Messages: 210
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.

------=_NextPart_000_000B_01C431F3.B1985160
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

thanks Ed... that worked.
"Ed Merks" <merks@ca.ibm.com> wrote in message =
news:4097EF47.80254ED4@ca.ibm.com...
Lance,=20
You must do this from the example code in order to create the =
syntactic <simpleContent> "scaffolding":=20

XSDSimpleTypeDefinition anonymousSimpleTypeDefinition =3D =
xsdFactory.createXSDSimpleTypeDefinition();=20
=
simpleContentComplexTypeDefinition.setContent(anonymousSimpl eTypeDefiniti=
on);

Lance Phillips wrote:=20

I'm trying to create a complex type with simple content. I've =
copied the=20
creation logic as close to exactly as possible from the =
XsdProtypicalSchema.=20
However, when I write out my xsd it gets written out with complex =
content.=20
Any ideas? Here is my code block...=20
final XSDSimpleTypeDefinition xsdDt =3D =
resolveSimpleDatatype(eObject, value);=20
if (xsdDt !=3D null) {=20

=
((XSDComplexTypeDefinition)eObject).setDerivationMethod(XSDD erivationMeth=
od.=20
EXTENSION_LITERAL);=20
=
((XSDComplexTypeDefinition)eObject).setBaseTypeDefinition(xs dDt);=20
((XSDComplexTypeDefinition)eObject).setContent(xsdDt);=20
}=20

And here is the resulting ComplexType....=20
<xs:complexType abstract=3D"false" mixed=3D"false" =
name=3D"gYearMonth">=20
<xs:complexContent>=20
<xs:extension base=3D"xs:gYearMonth">=20
<xs:attributeGroup ref=3D"Q1:commonAttributes"/>=20
</xs:extension>=20
</xs:complexContent>=20
</xs:complexType>=20

thanks,=20

lp

------=_NextPart_000_000B_01C431F3.B1985160
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2800.1400" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>thanks Ed... that worked.</FONT></DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Ed Merks" &lt;<A =
href=3D"mailto:merks@ca.ibm.com">merks@ca.ibm.com</A>&gt;=20
wrote in message <A=20
=
href=3D"news:4097EF47.80254ED4@ca.ibm.com">news:4097EF47.80254ED4@ca.ibm.=
com</A>...</DIV>Lance,=20

<P>You must do this from the example code in order to create the =
syntactic=20
&lt;simpleContent&gt; "scaffolding":=20
<BLOCKQUOTE>XSDSimpleTypeDefinition anonymousSimpleTypeDefinition =3D=20
xsdFactory.createXSDSimpleTypeDefinition();=20
=
<BR> simpleContentComplexTypeDefinition.setContent(anonymousSimpl eTypeDefi=
nition);</BLOCKQUOTE>
<P><BR>Lance Phillips wrote:=20
<BLOCKQUOTE TYPE=3D"CITE">I'm trying to create a complex type with =
simple=20
content.&nbsp; I've copied the <BR>creation logic as close to =
exactly as=20
possible from the XsdProtypicalSchema. <BR>However, when I write out =
my xsd=20
it gets written out with complex content. <BR>Any ideas?&nbsp; Here =
is my=20
code block...=20
<P>final XSDSimpleTypeDefinition xsdDt =3D =
resolveSimpleDatatype(eObject,=20
value); <BR>if (xsdDt !=3D null) {=20
=
<P> ((XSDComplexTypeDefinition)eObject).setDerivationMethod(XSDD erivationM=
ethod.=20
<BR>EXTENSION_LITERAL); <BR>&nbsp;&nbsp;&nbsp;=20
((XSDComplexTypeDefinition)eObject).setBaseTypeDefinition(xs dDt);=20
<BR>&nbsp;&nbsp;&nbsp;=20
((XSDComplexTypeDefinition)eObject).setContent(xsdDt); <BR>}=20
<P>And here is the resulting ComplexType.... <BR>&lt;xs:complexType=20
abstract=3D"false" mixed=3D"false" name=3D"gYearMonth"&gt; =
<BR>&nbsp;&nbsp;&nbsp;=20
&lt;xs:complexContent&gt; =
<BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;=20
&lt;xs:extension base=3D"xs:gYearMonth"&gt;=20
=
<BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
&lt;xs:attributeGroup ref=3D"Q1:commonAttributes"/&gt;=20
<BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &lt;/xs:extension&gt; =

<BR>&nbsp;&nbsp;&nbsp; &lt;/xs:complexContent&gt;=20
<BR>&lt;/xs:complexType&gt;=20
<P>thanks,=20
<P>lp</P></BLOCKQUOTE></BLOCKQUOTE></BODY></HTML>

------=_NextPart_000_000B_01C431F3.B1985160--
Previous Topic:Help with ComplexTypes
Next Topic:SchemaLocation help
Goto Forum:
  


Current Time: Thu Apr 18 15:10:43 GMT 2024

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

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

Back to the top