Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » XML Schema Definition (XSD) » Help me plz...
Help me plz... [message #11450] Fri, 14 February 2003 00:24 Go to next message
Eclipse User
Originally posted by: dwjang.jkdsoft.co.kr

It's so hard to use xsd for me.
Can you help me create XSDSchema object that contains this schema?

<xsd:element name = "XIDocument">
<xsd:complexType>
<xsd:sequence>
<xsd:element name = "PrimaryTable"/>
<xsd:element ref = "Database" minOccurs = "0" maxOccurs = "unbounded"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>

I made something like this code but it didn't work.

XSDSchema schema = XSDFactory.eINSTANCE.createXSDSchema();
XSDElementDeclaration elementDeclaration =
XSDFactory.eINSTANCE.createXSDElementDeclaration();
elementDeclaration.setName("XIDocument");
XSDComplexTypeDefinition complexTypeDefinition =
XSDFactory.eINSTANCE.createXSDComplexTypeDefinition();

elementDeclaration.getSchema().getContents().add(complexType Definition);
..
..
..
Re: Help me plz... [message #11488 is a reply to message #11450] Fri, 14 February 2003 07:29 Go to previous message
Eclipse User
Originally posted by: merks.ca.ibm.com

--------------D58311A5BEB731091C0E4A65
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit

You should follow the examples in

http://dev.eclipse.org/viewcvs/indextech.cgi/~checkout~/xsd- home/docs/javadoc/org/eclipse/xsd/util/XSDPrototypicalSchema .html

Your code below tries to get the element's containing schema without ever
adding the element to the schema's contents. You'll need to do
elementDeclaration.setAnonymousTypeDefinition(comlexTypeDefi nition). The body
of the complex type isn't so different from this example:

// <xsd:complexType name="PurchaseOrderType">
// <xsd:sequence>
// <xsd:element name="shipTo" type="po:USAddress"/>
// <xsd:element name="billTo" type="po:USAddress"/>
// <xsd:element minOccurs="0" ref="po:comment"/>
// </xsd:sequence>
// <xsd:attribute name="orderDate" type="xsd:Date"/>
// </xsd:complexType>


"
Re: Help me plz... [message #565280 is a reply to message #11450] Fri, 14 February 2003 07:29 Go to previous message
Ed Merks is currently offline Ed Merks
Messages: 26013
Registered: July 2009
Senior Member
--------------D58311A5BEB731091C0E4A65
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit

You should follow the examples in

http://dev.eclipse.org/viewcvs/indextech.cgi/~checkout~/xsd- home/docs/javadoc/org/eclipse/xsd/util/XSDPrototypicalSchema .html

Your code below tries to get the element's containing schema without ever
adding the element to the schema's contents. You'll need to do
elementDeclaration.setAnonymousTypeDefinition(comlexTypeDefi nition). The body
of the complex type isn't so different from this example:

// <xsd:complexType name="PurchaseOrderType">
// <xsd:sequence>
// <xsd:element name="shipTo" type="po:USAddress"/>
// <xsd:element name="billTo" type="po:USAddress"/>
// <xsd:element minOccurs="0" ref="po:comment"/>
// </xsd:sequence>
// <xsd:attribute name="orderDate" type="xsd:Date"/>
// </xsd:complexType>


"
Previous Topic:Help me plz...
Next Topic:Extension Attributes
Goto Forum:
  


Current Time: Thu Aug 28 09:21:23 EDT 2014

Powered by FUDForum. Page generated in 0.02766 seconds