The three XML documents that follow all show the same result when you select Rows>Import in the DataWindow painter of if ImportFile is called with or without default arguments for start and end column, start and end row, and DataWindow start column.
The DataWindow object has five columns: emp_id, emp_fname, emp_lname, phone, and birth_date.
This example contains two rows, each with five elements that match the column order, type, and validation requirements for the DataWindow object.
<?xml version="1.0"?> <d_emp_birth_listing> <d_emp_birth_row> <element_1>105</element_1> <element_2>Matthew</element_2> <element_3>Cobb</element_3> <element_4>6175553840</element_4> <element_5>04/12/1960</element_5> </d_emp_birth_row> <d_emp_birth_row> <element_1>148</element_1> <element_2>Julie</element_2> <element_3>Jordan</element_3> <element_4>6175557835</element_4> <element_5>11/12/1951</element_5> </d_emp_birth_row> </d_emp_birth_listing>
In this example, the elements are not contained in rows, but they still match the DataWindow object.
<?xml version="1.0"?> <root_element> <element_1>105</element_1> <element_2>Matthew</element_2> <element_3>Cobb</element_3> <element_4>6175553840</element_4> <element_5>04/12/1960</element_5> <element_6>148</element_6> <element_7>Julie</element_7> <element_8>Jordan</element_8> <element_9>6175557835</element_9> <element_10>11/12/1951</element_10> </root_element>
The comments and processing instructions in this example are not imported. The nesting of the <first> and <last> elements within the <Name> element is ignored.
<?xml version="1.0"?> <root_element> <!-- some comment --> <row_element><?process me="no"?>105<name Title="Mr"> <first>Matthew</first> <last>Cobb</last> </name> <!-- another comment --> <phone>6175553840</phone> <birthdate>04/12/1960</birthdate> </row_element> <row_element>148<name Title="Ms"> <first>Julie</first> <last>Jordan</last> </name> <phone>6175557835</phone> <birthdate>11/12/1951</birthdate> </row_element> </root_element>
All three XML documents produce this result:
emp_id |
emp_fname |
emp_lname |
phone |
birth_date |
---|---|---|---|---|
105 |
Matthew |
Cobb |
6175553840 |
04/12/1960 |
148 |
Julie |
Jordan |
6175557835 |
11/12/1951 |