Example Schema: XML

This example shows how you can import records from an XML document.

With the following schema:

table accounts
field acctno varchar accounts/account@acctno ''
field firstName varchar accounts/account/firstName ''
field lastName varchar accounts/account/lastName ''
field balance float accounts/account/balance 0

Importing the following XML document:

<?xml version="1.0" encoding="utf-8"?>
  <account acctno="12345">
  <account acctno="67890">
  <account acctno="13579">

Will get you a table like the following:

id       acctno    firstName     lastName      balance
4284d70513   12345        John         Smith             1532.43
4284d70516   67890        Jane         Doe                  1.32
4284d70519   13579        Mike         Schmidt                 0

Note that because the balance wasn't present in the 3rd record, it took on the default value from the schema (0).

Copyright © Thunderstone Software     Last updated: May 19 2023
Copyright © 2023 Thunderstone Software LLC. All rights reserved.