Schema to XML document by JDeveloper

This tutorial explain creating xml schema from scratch and creating xml document from it as well. Jdeveloper 10g has a very easy visual editor for creating xml schema as well as xml document. It is considered that you have basic knowledge of schema. Here are step by step approach

1.Create new project and them create new XML schema

2009-07-08_2102.png 

2009-07-08_2104.png

2.By default, a simple schema header tag  and an example element

2009-07-08_2105.png 

3. Here we are going to construct schema for an Order xml document like  Order>>Item_list>>Item . A order will have id,description,shipTo address and list of items. To construct such structure we will have three complex type order_type, item_type and order_list_type. So create order_type complex type by drag and drop Complex Type component and edit properties

2009-07-08_2112.png

2009-07-08_2114.png 

4. Now drag and drop sequence component to complex component

2009-07-08_2118.png

5.  now drag and drop element components one by one and edit the properties

2009-07-08_2118.png

 

2009-07-08_2120.png

6. There will multiple items under an order so we will set “maxoccurrence” property to “unbounded

 2009-07-08_2122.png

7.After creating all required complex type, its time to create root node.

2009-07-08_2125.png

8.Here is complete order xml schema

2009-07-08_2239.png

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

9. Its time to create xml document out of this schema, select new XMl from xml schema option

2009-07-08_2133.png

2009-07-08_2134.png

10. select root name and dept.

2009-07-08_2134_001.png

11 . Here is default xml document

Fullscreen capture 782009 85301 PM.bmp

12 Xml with data

Fullscreen capture 782009 85422 PM.bmp

Comments

Popular posts from this blog

Composite Design Pattern by example

State Design Pattern by Example

Eclipse command framework core expression: Property tester