xml spy
Previous  Top  Next
Importing a table using ODBC

ODBC currently only supports the importing of a single database table, hierarchical data cannot be imported using this method.

To import a table using ODBC:
1.Select the menu option Convert | Import Database data...  
tut_s1_odb5a  
2.Click the ODBC connection string radio button, and then the Build button.  
tut_s1_odb5b  
3.Click the Machine Data Source tab, select the previously defined "shape" data source, and click the OK button. The ODBC connection string now appears in the text box.  
If a User name and Password dialog box is opened at this point, enter the information as requested.  
tut_s1_odb5bb  
4.Click the Choose database table button and select the database table you want to import (in this case Person). The select statement SELECT * FROM "Person", appears in the Selection statement text box.  
5.Click the Preview button to see the database data.  
6.Activate the Exclude Primary/Foreign Keys check box, to avoid importing the key fields (this only applies to key fields that were created by XML Spy during the export process).  
tut_s1_odb5bcc  

Defining which fields to import:

The preview window allows you to directly select and define the field data you want to import.
Clicking
repeatedly on the element symbol ic_element to the left of the element name, cycles through the available possibilities:

ic_elementDefine and import this field as an Element.  
ic_attribDefine and import this field as an Attribute.  
ic_del_fieldSkip, do not import this field.  
 
Starting the data import:
1.Click the OK button of the database import dialog box, when you have decided which fields you want to import (no changes in this example).  
tut_s1_odb5dd     
 
XML Spy creates an untitled XML file containing the Person table data. The root element is called Import, and each Person element is a table row.  
 


Previous  Top  Next

© 2002 Altova