Example with no empty elements
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.

Example 1
This example contains two rows, each with five elements that
match the column order, type, and validation requirements for the DataWindow object.
|
1 |
<?xml version="1.0"?><br><d_emp_birth_listing><br>   <d_emp_birth_row><br>      <element_1>105</element_1><br>      <element_2>Matthew</element_2><br>      <element_3>Cobb</element_3><br>      <element_4>6175553840</element_4><br>      <element_5>04/12/1960</element_5><br>   </d_emp_birth_row><br>   <d_emp_birth_row><br>      <element_1>148</element_1><br>      <element_2>Julie</element_2><br>      <element_3>Jordan</element_3><br>      <element_4>6175557835</element_4><br>      <element_5>11/12/1951</element_5><br>   </d_emp_birth_row><br></d_emp_birth_listing> |
Example 2
In this example, the elements are not contained in rows, but
they still match the DataWindow object.
|
1 |
<?xml version="1.0"?><br><root_element><br>   <element_1>105</element_1><br>   <element_2>Matthew</element_2><br>   <element_3>Cobb</element_3><br>   <element_4>6175553840</element_4><br>   <element_5>04/12/1960</element_5><br>   <element_6>148</element_6><br>   <element_7>Julie</element_7><br>   <element_8>Jordan</element_8><br>   <element_9>6175557835</element_9><br>   <element_10>11/12/1951</element_10><br></root_element> |
Example 3
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.
|
1 |
<?xml version="1.0"?><br><root_element><br><!-- some comment --><br><row_element><?process me="no"?>105<name Title="Mr"><br><first>Matthew</first><br><last>Cobb</last><br></name><br><!-- another comment --><br><phone>6175553840</phone><br><birthdate>04/12/1960</birthdate><br></row_element><br><row_element>148<name Title="Ms"><br><first>Julie</first><br><last>Jordan</last><br></name><br><phone>6175557835</phone><br><birthdate>11/12/1951</birthdate><br></row_element><br></root_element> |
Result
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 |