This example shows how you can import records from an XML document that may be nested in other tags. If the XML you're importing is created by another program and nested in some other tags, then you can use the xmldatasetlevel specifier to declare how deep the dataset tag is.
With the following schema:
field acctno varchar export/personnel/accounts/account@acctno ''
field first varchar export/personnel/accounts/account/firstName ''
field last varchar export/personnel/accounts/account/lastName ''
field balance float export/personnel/accounts/account/balance 0
Importing the following XML document:
<?xml version="1.0" encoding="utf-8"?>
Will get you the same data as before. Instead of the 1st tag (
being regarded as the dataset and seeing a single record (
it will instead see the 3-deep tag as the dataset (
accounts) and three
<account> records (which is what we want).