Defining Array Type Schema for a Complex File Structure

6-106 Oracle Fusion Middleware Users Guide for Technology Adapters

5. Click Browse and select the array.txt file, as shown in

Figure 6–58 . The Native Format Builder File Description page is displayed. Figure 6–58 Native Format Builder File Description Page

6. Click Next. The Native Format Builder Design Schema Page is displayed.

7. Create a global element called NewArray and drag and drop the native data to the

newly created global element.

8. Select NewArray, as shown in

Figure 6–59 , and click the Edit Node icon. The Element Details dialog is displayed. Figure 6–59 Native Format Builder Design Schema Page 9. Set the options in the Element Details dialog, as shown in Figure 6–60 , and then click OK. Native Format Builder Wizard 6-107 Figure 6–60 Element Details Dialog The Native Format Builder Design Schema dialog is displayed.

10. Click Next. The Generated Native Format Schema File page is displayed, as shown

in Figure 6–61 , which displays the native format file. Figure 6–61 Generated Native Format Schema File Page Native Schema The native schema definition corresponding to the preceding native data can be defined as follows: ?xml version=1.0 encoding=UTF-8 ? xsd:schema xmlns:xsd=http:www.w3.org2001XMLSchema xmlns:nxsd=http:xmlns.oracle.compcbpelnxsd xmlns:tns=http:TargetNamespace.comtestnewArray targetNamespace=http:TargetNamespace.comtestnewArray 6-108 Oracle Fusion Middleware Users Guide for Technology Adapters elementFormDefault=qualified attributeFormDefault=unqualified nxsd:version=NXSD nxsd:stream=chars nxsd:encoding=ASCII xsd:element name=Root-Element xsd:complexType xsd:sequence xsd:element name=NewArray type=xsd:string maxOccurs=unbounded nxsd:style=array nxsd:cellSeparatedBy=; nxsd:arrayTerminatedBy=. xsd:sequence xsd:complexType xsd:element xsd:schema

11. Click Test. The Test NXSD Schema dialog is displayed.

12. Click the Generate XML icon. The Result XML is displayed on the right pane of

the Test NXSD Schema dialog, as shown in Figure 6–62 . Figure 6–62 Test NXSD Schema Dialog Translated XML Using the Native Schema The translated XML looks as follows: ?xml version = 1.0 encoding = UTF-8? Root-Element xmlns=http:TargetNamespace.comtestnewArray NewArrayJohnNewArray NewArraySteveNewArray NewArrayPaulNewArray NewArrayToddNewArray Root-Element Native Format Builder Wizard 6-109

13. Click OK. The Generated Native Format File page is displayed.

14. Click Next. The Native Format Builder Finish page is displayed.

6.4.8 Defining the Schema for a DTD File Structure

This use case takes you through the procedure for defining the schema for the native data type, DTD file. Use the DTD to be converted to XSD option in the Native Format Builder wizard when creating the XML schema for this native file. In this use case, the Native Format Builder uses a DTD file type .dtd. You can generate the corresponding NXSD and also test it. Perform the following steps to run the use case: 1. Use any DTD file. 2. Launch the Adapter Configuration Wizard and navigate to the Messages page, as displayed in Figure 6–4 , and click Define Schema For Native Format. The Native Format Builder Welcome page is displayed, as shown in Figure 6–5 .

3. Click Next. The Choose Type page is displayed, as shown in

Figure 6–26 .

4. Select DTD to be converted to XSD. The Choose Type page is displayed, as

shown in Figure 6–63 . Figure 6–63 Native Format Builder Wizard Choose Type Page

5. Click Next. The Native Format Builder DTD Description page is displayed.

6. Click Browse and select the db.dtd file, and select DatabaseInventory from the

Root Element list, as displayed in Figure 6–64 . 6-110 Oracle Fusion Middleware Users Guide for Technology Adapters Figure 6–64 Native Format Builder Wizard File Description Page

7. Click Next. The Generated Native Format File page is displayed, as shown in

Figure 6–65 . Figure 6–65 Native Format Builder Wizard Field Properties Page The following is the sample native schema that is generated: ?xml version=1.0 encoding=UTF-8 ? --This Schema has been generated from a DTD. A target namespace has been added to the schema.-- xs:schema xmlns:xs=http:www.w3.org2001XMLSchema targetNamespace=http:TargetNamespace.comReadUI xmlns=http:TargetNamespace.comReadUI nxsd:version=DTD xmlns:nxsd=http:xmlns.oracle.compcbpelnxsd xs:element name=GlobalDatabaseName type=xs:string