Database Reference
In-Depth Information
Importing from .xml files
XML format is often used for exchanging information between programs, both on and off
the web. XML format is similar to HTML format in two ways: both are plain text that indicate
formatting within tags, and both use start and end tags. However, HTML tags describe how
elements should look, whereas XML tags specify the structure of the elements in a docu-
ment. Also, as its name implies, the XML tag set is extensible—there are ways to add your
own tags. The following is an example of a simple .xml file.
<?xml version=”1.0”?><ORDER> <CUSTOMER>Michele Martin</CUSTOMER>
<PRODUCT> <ITEM>Sterilized soil</ITEM> <PRICE>$8.65</PRICE>
<QUANTITY>1 bag</QUANTITY> </PRODUCT></ORDER>
This simple file describes an order that Michele Martin (the customer) placed for one bag
(the quantity) of Sterilized soil (the item) at a cost of $8.65 (the price). Because XML tags the
data's structure rather than its appearance , you can easily import the data from an .xml file
into a database table. An actual file created for this purpose would contain one instance of
the <ORDER> through </ORDER> block for each order.
An.xml file might store both the data and the structure for a table; or the data might be
stored in an .xml file for which the structure is defined by an accompanying schema stored
in an .xsd file. If the structure is defined by a scheme, be sure the schema's .xsd file is in the
same folder as the corresponding .xml file; otherwise Access will import only the data and
assign default properties to all fields.
TIP Access 2013 can apply a transform to XML data as you import or export it. A transform is
a type of template used to convert XML data to other formats. When you apply a transform
during the import process, the data is transformed before it enters the table, so you can
adapt an .xml file to a different table structure. In-depth coverage of transforms is beyond
the scope of this topic.
 
Search WWH ::




Custom Search