The XML schema can be specified inline with the XML data file itself, as shown below. In this case, you should not repeat the URL for data source once it is entered in the Data Definition Location in the Define XML Query dialog box. An inline schema will be useful if the data definition is generated dynamically with the specific data source. This model is easier to maintain because the schema will always match the XML data.
Following is an example for inline XML schema:
<?xml version="1.0"?>
<Company>
<schema xmlns='http://www.w3.org/1999/XMLSchema'>
<element name="Company" >
<complexType>
<sequence>
<element name="Department" minOccurs="0" maxOccurs="unbounded">
<complexType>
<sequence>
<element name="Deptno" type="int"/>
<element name="Dname" type="string"/>
<element name="Loc" type="string"/>
<element name="Count" type="integer"/>
</sequence>
</complexType>
</element>
</sequence>
</complexType>
</element>
</schema>
<Department>
<Deptno>100</Deptno>
<Dname>Degsin</Dname>
<Loc>England</Loc>
<Count>25</Count>
</Department>
<Department>
<Deptno>101</Deptno>
<Dname>Devlopment</Dname>
<Loc>US</Loc>
<Count>150</Count>
</Department>
<Department>
<Deptno>102</Deptno>
<Dname>Production</Dname>
<Loc>France</Loc>
<Count>58</Count>
</Department>
</Company>
Copyright © 1984, 2005, Oracle. All rights reserved.