Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Info

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.In this tutorial we will show you how you can present the XML data (stored as page attachment) to  your end users

The structure of the XML is as follows:

Code Block
<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)

  1. Showing as Table

    Will add a TableView macro
    Image Added


    A choose the attachment to be used as source:
    Image Added

    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 
    Image Added
    Referencing Fields: name and email

    Image Added
    End result (Live view using ConfiDoc TableView)

    ConfiDoc TableView Macro
    rootusers.user
    values7045256:7045257
    serviceId3ef0b857-984b-4180-82ce-55a15265a88c

    nameName

    emailEmail 

  2. Showing the same dataset as bulleted list using ListView macro

    Image Added
    We also set the root element to be "users.user" in the ListView

    Image Added

    And the final config looks like:

    Image Added

    End result (Live view using ConfiDoc ListView macro)

    ConfiDoc ListView Macro
    rootusers.user
    values7045256:7045257
    serviceId3ef0b857-984b-4180-82ce-55a15265a88c

    nameName emailEmail


    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 values

    Info

    You 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