Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » XML Schema Definition (XSD) » Help me plz...
Help me plz... [message #11450] Fri, 14 February 2003 05:24 Go to next message
Eclipse UserFriend
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 12:29 Go to previous message
Eclipse UserFriend
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 12:29 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
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>


"


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:Help me plz...
Next Topic:Extension Attributes
Goto Forum:
  


Current Time: Thu Apr 25 09:19:12 GMT 2024

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

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

Back to the top