In this tutorial we will show you how you can present the XML data (stored as page attachment) to your end users
With ConfiDoc you can easily show the data from XML, JSON, CSV, RSS and SQL sources using the same approach an methods.
The structure of the XML is as follows:
<users> <user> <name>Sam Smith</name> <email>ss@domain.com</email> </user> <user> <name>John Doe</name> <email>jd@domain.com</email> </user> </users>
We will show the data in a Table (using TableView macro) and then as a bulleted list (using ListView macro)
Showing as Table
Will add a TableView macro
A choose the attachment to be used as source:
We also specify a root element to use, so our "user" nodes will be used as an array of nodes
Then we add 2 fields
Referencing Fields: name and email
End result (Live view using ConfiDoc TableView)Name Email Sam Smith ss@domain.com John Doe jd@domain.com Showing the same dataset as bulleted list using ListView macro
We also set the root element to be "users.user" in the ListViewAnd the final config looks like:
End result (Live view using ConfiDoc ListView macro)- Sam Smith ss@domain.com
- John Doe jd@domain.com
Here you have learnt how easy it is to show the data with ConfiDoc. There are more macros to show the data at your service: PlainView and CardView. Using those macros is very similar to what you have seen in this tutorial. With one exception - PlainView operates on raw data and expects you to use [entry.FIELD_NAME] notation to reference fields valuesYou can show the data from files attached to other pages, as long as the user has an access to the page where the attachment is stored