Table of Contents

Search

  1. Preface
  2. Introduction to Data Validation Option
  3. New Features and Behavior Changes
  4. Repositories
  5. XML Data Source
  6. Tests for XML Data Sources
  7. Connections
  8. Expressions
  9. Table Pairs
  10. Tests for Table Pairs
  11. Single-Table Constraints
  12. Tests for Single-Table Constraints
  13. Examples of Tests from Spreadsheets
  14. SQL Views
  15. Lookup Views
  16. Join Views
  17. Aggregate Views
  18. Business Intelligence and Reporting Tools Reports
  19. Dashboards
  20. DVOCmd Command Line Program
  21. Troubleshooting
  22. Datatype Reference
  23. Reporting Views
  24. Metadata Import Syntax
  25. Jasper Reports
  26. Glossary

Data Validation Option User Guide

Data Validation Option User Guide

XML Data Conversion to a Relational Structure

XML Data Conversion to a Relational Structure

You can create a join view based on the XML file to converts the hierarchical XML data to a relational structure. You can then use the join view as a table in a single-table constraint or table pair.
To create the join view, you create a self join based on the XML file. You can manually create or automatically generate a join view based on an XML file.
When you create the join view, you can specify which XML groups to include in the join view. An error occurs if you include multiple XML groups that are not connected.
For example, you have the following XML file:
<Root> <Customers> <Customer CustomerID="GLFM"> <CompanyName>Great Lakes Food Market</CompanyName> <ContactName>Howard Snyder</ContactName> <ContactTitle>Marketing Manager</ContactTitle> <Phone>(503) 555-7555</Phone> <FullAddress> <Address>32 Baker Blvd.</Address> <City>Eugene</City> <Region>OR</Region> <PostalCode>97403</PostalCode> <Country>USA</Country> </FullAddress> </Customer> <Customer CustomerID="HCIS"> <CompanyName>Hungry Coyote Import Store</CompanyName> <ContactName>Yoshi Latimer</ContactName> <ContactTitle>Sales Representative</ContactTitle> <Phone>(503) 555-6874</Phone> <Fax>(503) 555-2376</Fax> <FullAddress> <Address>165 Main St.</Address> <City>Elgin</City> <Region>OR</Region> <PostalCode>97827</PostalCode> <Country>USA</Country> </FullAddress> </Customer> <Customer CustomerID="LCCS"> <CompanyName>Little Cap Country Store</CompanyName> <ContactName>Martha Lamponelli</ContactName> <ContactTitle>Marketing Manager</ContactTitle> <Phone>(509) 555-7969</Phone> <Fax>(509) 555-6221</Fax> <FullAddress> <Address>412 Orchestra Terrace</Address> <City>Walla Walla</City> <Region>WA</Region> <PostalCode>99362</PostalCode> <Country>USA</Country> </FullAddress> </Customer> </Customers> </Root>
The XML file has the following XML groups and hierarchy: Root > Customers > Customer > Full Address.
An error appears when you automatically generate a join view and include the Customers XML group and the Full Address XML group, but exclude the Customer XML group. The Customer XML group is the link between the Customers XML group and Full Address XML group.